Skip to content

cmd/trace: show end stack traces #70570

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

Closed
felixge opened this issue Nov 26, 2024 · 7 comments
Closed

cmd/trace: show end stack traces #70570

felixge opened this issue Nov 26, 2024 · 7 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@felixge
Copy link
Contributor

felixge commented Nov 26, 2024

Go version

go version devel go1.24-733df2bc0a 2024-11-25 02:23:41 +0000 darwin/arm64

Output of go env in your module/workspace:

n/a

What did you do?

I generated an execution trace for a simple Go program that has a single goroutine that runs for 10ms on CPU followed by 10ms of sleep in a loop.

What did you see happen?

Clicking on the first three goroutine spans, I see:

Showing only the start stack traces also makes it impossible to see the last stack trace produced by a goroutine.

What did you expect to see?

Showing both start and end stack traces would make it much easier to understand the trace:

update: I realized this is not just a "nice to have" but actually a regression compared to go1.22, see comment below.

cc @mknyszek @prattmic @nsrip-dd - CL for this is submitted below

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 26, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/631895 mentions this issue: cmd/trace: also show end stack traces

@felixge
Copy link
Contributor Author

felixge commented Nov 26, 2024

I just realized that this also seems to be a regression compared to go1.22. It seems like the old behavior was to always show the end stack trace, and only to show the start stack trace when the goroutine was created (?), see screenshots below. (I re-executed the program in go1.22, but the 3rd screenshot also shows a span that was preceeded by a short execution that got preempted).

So maybe the case can be made to include this into go1.24 despite the freeze and potentially even a backport to go1.23?

@GoVeronicaGo
Copy link

cc: @golang/runtime

@GoVeronicaGo GoVeronicaGo added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 26, 2024
@prattmic
Copy link
Member

Since this is a regression and very simple, I personally think it would be OK to backport.

@mknyszek mknyszek moved this to All-But-Submitted in Go Compiler / Runtime Nov 26, 2024
@mknyszek mknyszek added this to the Go1.24 milestone Nov 26, 2024
@felixge
Copy link
Contributor Author

felixge commented Nov 27, 2024

@gopherbot please consider this for backport to 1.23, it’s a regression.

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #70592 (for 1.23).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@github-project-automation github-project-automation bot moved this from All-But-Submitted to Done in Go Compiler / Runtime Nov 27, 2024
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

7 participants