这是indexloc提供的服务,不要输入任何密码
Skip to content

profiler: not collecting CPU data for Go code in a c-archive #993

@willie

Description

@willie

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.

Metadata

Metadata

Assignees

Labels

api: cloudprofilerIssues related to the Cloud Profiler API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions