-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/pprof: Dots and slashes aren't allowed in profile names #13195
Comments
/cc @matloob |
Now that we've got support for generating binary profiles, we should use that for all the profiles we generate. Then the legacy parsing code here won't matter. |
Never generating legacy profiles will take a bit more work; see e.g. #18641. |
It's fine to generate them when debug=1. That's not the problem here. |
In addition to the "goroutine" and "threadcreate" profiles, Go code can generate custom profiles using the runtime/pprof package. The user must name these profiles, and the docs recommend using the convention "import/path" to avoid namespace conflicts. This CL updates the pprof tool to be able to parse legacy profiles whose types contain slashes and other non-space characters. This is the upstream fix for golang/go#13195. This change will need to be mirrored to github.com/golang/go/src/cmd/pprof/internal/profile/legacy_profile.go
Upstream PR pending review: google/pprof#81 |
I've merged the fix into the upstream pprof, and will include it in my upcoming rebase of golang pprof. +1 to generating profiles in profile.proto format, though. |
OK, then I won't touch cmd/pprof on the Go end; I'll leave that to your
rebase.
Per your comment on the PR, I'll send a CL to update runtime/pprof on the
permitted names.
…On Tue, Feb 7, 2017 at 1:07 PM Raul Silvera ***@***.***> wrote:
I've merged the fix into the upstream pprof, and will include it in my
upcoming rebase of golang pprof.
+1 to generating profiles in profile.proto format, though.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#13195 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AJSK3TwZcaqpXF-tNP4iiDho2bn1YYzNks5raLLIgaJpZM4Ge5vt>
.
|
https://go-review.googlesource.com/36533 updates the runtime/pprof docs. |
The docs for runtime/pprof.NewProfile suggest a particular naming format for custom profiles.
The cmd/pprof tool does not load profiles named with that convention, giving the error "parsing profile: unrecognized profile format".
I'd expect
go tool pprof
to successfully load profiles made using the runtime/pprof package and its instructions. The regexp that's supposed to match custom profiles,\A(\w+) profile: total \d+\n\z
, should match the format described in the runtime/pprof docs.The full variety of import paths may be too much to support, but at the very least '.' and '/' should be allowed.
The text was updated successfully, but these errors were encountered: