2

When I do performance profiling using perf, normally this works:

perf record -g -F99 $BINARY_NAME

Upon completion, the command says:

[ perf record: Captured and wrote 0.006 MB output.data (37 samples) ]

And I can read the captured stack traces using perf script.

However my program is doing asynchronous networking, and if the server(s) it's connecting are offline (my program is getting "No route to host (os error 113)", and handling them, and trying to connect again.), the perf command doesn't manage to collect samples:

[ perf record: Captured and wrote 0.006 MB output.data ]

When inspected with perf script, it doesn't output anything. When the servers are online, it works normally.

My program is a native binary writen in Rust. Any ideas why might this happen?

  • Turns out the whole question was flawed. When I tested the another command, the server was offline, and it was that what affected collecting the samples. So now the question is: why doesn't perf collect samples, when the attempts to connect return "No route to host (os error 113)". – GolDDranks Apr 27 '17 at 7:26
  • I have already one clue: when I turn the sampling frequncy to -F 9997, it manages to collect three samples. That's a low number! However, it now seems that it isn't collecting anything while it's waiting for kernel to do something for it. (Create a TCP socket, in this case.) Is it filtering samples out? I think it's important to know also how much time is being used in external code. – GolDDranks Apr 27 '17 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.