1

I finished a TCP server by using CGO. Now I wish to do some benchmark analysis and optimization.

The connection flow across Go and C is as follows:

user <--> connFD <--> socketpair[0] <--> socketpair[1] <--> intranet server
|---------- Go domain ----------------|-------------- C domain -----------|

and the server only able to run in a docker container.

I tried using pprof to analysis a few seconds connection with real user I/O, however it gives me nothing:

(pprof) tree
Showing nodes accounting for 0, 0% of 0 total
----------------------------------------------------------+-------------
      flat  flat%   sum%        cum   cum%   calls calls% + context

(pprof) top
Showing nodes accounting for 0, 0% of 0 total
      flat  flat%   sum%        cum   cum%

Thus I would like to know is pprof only be able to analyze pure Go program? How can I do benchmarks on such a program properly?

Changkun
  • 1,502
  • 1
  • 14
  • 29

0 Answers0