pprof - Trouble getting any data from pprof.StartCPUProfile()

164 views
Skip to first unread message

Russtopia

unread,
May 21, 2019, 12:54:32 PM5/21/19
to golang-nuts
Hi all,

I've tried running some of my Go code using CPU Profiling enabled as
described at

https://blog.golang.org/profiling-go-programs

and

https://golang.org/pkg/runtime/pprof/#StartCPUProfile

.. I'm on Funtoo Linux x86_64, and I ensured CONFIG_HIGH_RES_TIMERS=y;
however, it seems no matter what I always end up with a profile output
file of zero bytes.

I tried adding the HTTP endpoint for /debug/ to see profiling and
heap, allocs, and a few others do yield data.. it's just a few such as
pprof are always 0.

1. Is there another kernel config I might be missing for supporting this?
2. There's mention elsewhere of the SIGPROF signal, does my program
*need* to listen for this signal and receive one or more to actually
yield pprof data?

Thanks,
-Russ

jake...@gmail.com

unread,
May 21, 2019, 6:37:06 PM5/21/19
to golang-nuts
I know it is kind of obvious, but are you absolutely sure that StopCPUProfile is getting called?
Reply all
Reply to author
Forward
0 new messages