-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Client
Profiler
Describe Your Environment
Ubuntu on GKE, Go code is built with -buildmode=c-archive
. C++ program is calling the built Go archive.
Expected Behavior
I expect to be able to see, for my Go code: CPU, Heap, Contention, and Threads profiles.
Actual Behavior
I see, for my Go code: Heap, Contention, and Threads profiles. The CPU profile is missing.
I know that the docs for pprof note that:
StartCPUProfile does not work by default for Go code built with -buildmode=c-archive or -buildmode=c-shared. StartCPUProfile relies on the SIGPROF signal, but that signal will be delivered to the main program's SIGPROF signal handler (if any) not to the one used by Go. To make it work, call os/signal.Notify for syscall.SIGPROF, but note that doing so may break any profiling being done by the main program.
I'm happy with those limitations. I just need to know how to turn this on in the context of using the stackdriver profiler.