-
Notifications
You must be signed in to change notification settings - Fork 18k
proposal: runtime/trace: function entry/exit profiling #17988
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
Comments
I've wanted this as well. /cc @aclements |
I've just tried discovering some performance data with tracing, also noting that |
I assume you mean |
Yes, you are correct, i did mean go tool trace. I think there's some
difference with pprof as the trace is complete and pprof is sampled, no? At
least the size of the trace and the size of the pprof data file and a note
on pprof sampling frequency in Hz seem to suggest so?
Basically I'd want a full pprof profile (without sampling), and as I
understood the trace is missing the CPUprofile data to produce that. Having
a full trace also gives the option to produce some per-func histograms and
other visualisation of where Go code is doing things. Thinking something
like a CPU sparkline for main and then drilling down.
Maybe I'm missing something about how this works. Maybe I should just
figure out the sampling for pprof and live with a flame graph.
…On Wed, 21 Jun 2017 at 15:49, Austin Clements ***@***.***> wrote:
I assume you mean go tool trace, not go tool profile. I'm not sure I
quite understand what you're asking, but the execution trace currently
doesn't have enough information in it to produce any sort of call graph
profile. We could add profiling samples to the trace, which could then be
extracted as a profile, though that wouldn't be any different from simply
taking a pprof CPU profile (unless you filtered it or something first, as
suggested by @FiloSottile <https://github.com/filosottile>).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#17988 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAOPkBIqticFs62q04bTCKfeijDizfwlks5sGR9cgaJpZM4K3YEv>
.
|
While that's true, the differences are far more drastic. The execution trace records specific runtime events, like goroutine scheduling, network events, and GC.
It sounds like what you want is a function call trace, which is not what |
I've re-titled this to be what I understand the request to be, which is not actually CPU profiling, but function entry/exit tracing. That's a reasonable feature request, and one could imagine implementing something like XRay for Go, though I don't think anyone is going to work on this unless there's significantly more demand for it. It may be that in the long run something like Intel Processor Trace (PT) is a better answer. The other issue of adding CPU profiling samples to the execution trace is #16895. |
Given that doing this efficiently is basically an active research topic, we're not going to lead here. The "profiles during SIGPROF" is #16895, which is still open, but I'm going to close this issue. (There's also #16619 for user-defined events, which you might use (if we had it) in this situation.) |
This might be patently stupid, but I can't see why right now.
When both CPU profiling and tracing is enabled, could the SIGPROF handler write the pc and the goroutine id to the trace?
That way we would get an approximate idea of what the goroutine is doing during the scheduled time in the trace. Which would get us a bundled performance overview with just the trace.
The big, big difference from profiles however is that we would be able to generate histograms of how much CPU a function takes over the individual goroutines, as opposed to a total average.
(Maybe it's stupid because samples are not granular enough for this to be useful?)
The text was updated successfully, but these errors were encountered: