Skip to content
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

runtime/trace: stop treating cgo calls as syscalls #64865

Open
dominikh opened this issue Dec 25, 2023 · 0 comments
Open

runtime/trace: stop treating cgo calls as syscalls #64865

dominikh opened this issue Dec 25, 2023 · 0 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dominikh
Copy link
Member

The tracer currently treats calls into C as syscalls. In the old tracer, this was fine, because cgo calls are either few or they don't take enough time to cause state transitions. However, the new tracer emits state transitions for all syscalls, regardless of duration.

For OpenGL applications that don't have optimized renderers this can result in hundreds to thousands of state transitions per frame, two per call into OpenGL. A trace of Gotraceui (with vsync disabled) managed to have 5 million spans in 2.5 seconds, with half of the spans being for "blocked in syscall" and the other half being for "running."

With the new implementation, treating cgo calls as syscalls is as tenable as tracing every Go function call.

Treating cgo calls as syscalls was never done intentionally as far as I can tell, and is a side-effect of the implementation.

/cc @mknyszek

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Dec 25, 2023
@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 28, 2023
@mknyszek mknyszek self-assigned this Jan 3, 2024
@mknyszek mknyszek added this to the Backlog milestone Jan 3, 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. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

4 participants