Skip to content

runtime/pprof: no samples in profile output #14324

@eapache

Description

@eapache

Running on Ubuntu 15.10 x64, on an Intel Haswell i7-4790. I have seen identical behaviour with go 1.5.1 as provided by Ubuntu's repositories and go 1.5.3 as downloaded from https://golang.org/.

I was trying to profile one of my programs, but I was getting weirdly empty profiles (not empty 0-byte files, but syntactically complete pprof files containing no useful samples). I googled around a bunch and eliminated a bunch of common causes before reporting:

The sample app I am profiling is https://gist.github.com/eapache/580b7dbd8800fe9a3234. It runs for ~40 seconds on my machine with no sleeps and only minimal printing to standard output, which should be more than enough to generate samples. I know that the CPU-bound string building dummy code is being run and not optimized out, because I can see it getting slower as the string size grows.

It is running to completion and StopCPUProfile() is getting called. If I interrupt it or remove that, I get a 0-byte profile file instead, which makes sense.

I am not running on OSX or any platform which is known to have profiling problems as far as I have been able to determine.

When inspecting the profile file with pprof I get no errors, but useless output like the following:

(pprof) top10
39.78s of 39.78s total (  100%)
      flat  flat%   sum%        cum   cum%
    39.78s   100%   100%     39.78s   100%  

My first instinct was that I was running without debug symbols for some reason, but I still get correct backtraces if I put a panic in somewhere. I'm really not sure what's going on here. I'm happy to try patches, upload the profile file, or whatever else you might need to debug this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions