Skip to content

Rename WARN* functions to BugTraceback*, and optimize them for inlining. #11994

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

Merged
merged 1 commit into from
Aug 6, 2025

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Aug 1, 2025

Rename WARN* functions to BugTraceback*, and optimize them for inlining.

The rename is todo with following a more Go-style naming convention. To this
end, the "default" BugTraceback will be the one that takes a single error
parameter. The simple "cond" variant will likely not be widely used and has
been removed.

As to inlining the BugTraceback(err) variant seems to require a hack from
pkg/sync/gate_unsafe.go:Enter where there is a noinline helper, so as to make
it check err == nil before making an expensive err.Error() call.

@copybara-service copybara-service bot added the exported Issue was exported automatically label Aug 1, 2025
@copybara-service copybara-service bot force-pushed the test/cl789915634 branch 2 times, most recently from 79a462f to 84aa92b Compare August 6, 2025 00:21
The rename is todo with following a more Go-style naming convention. To this
end, the "default" BugTraceback will be the one that takes a single error
parameter. The simple "cond" variant will likely not be widely used and has
been removed.

As to inlining the BugTraceback(err) variant seems to require a hack from
pkg/sync/gate_unsafe.go:Enter where there is a noinline helper, so as to make
it check err == nil before making an expensive err.Error() call.

PiperOrigin-RevId: 791443090
@copybara-service copybara-service bot merged commit 2099bc1 into master Aug 6, 2025
@copybara-service copybara-service bot deleted the test/cl789915634 branch August 6, 2025 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exported Issue was exported automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant