USDT: normalize names for STATE_ENTER#13346
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes ATS USDT probe naming for STATE_ENTER in HttpSM so probe names no longer contain illegal characters (&, ::) and can be attached by tools like bpftrace/perf.
Changes:
- Update the
STATE_ENTERmacro to emit probes with astate_enter_prefix and a normalized handler/state token. - Update all
STATE_ENTERcall sites inHttpSM.ccto pass the bare handler/state name (and fix the&HttpSM :typo atstate_cache_open_write).
STATE_ENTER passed `&HttpSM::<state>` straight through as the USDT probe name, so probes were emitted as e.g. `&HttpSM::state_read_client_request_header`. The `&` and `::` characters are illegal in USDT probe names: bpftrace and perf treat `:` as the provider/name field separator and reject `&`, so these probes could not be attached by name. Pass the bare handler name from each call site and add the prefix in the macro, producing valid names like `state_enter_state_read_client_request_header` that share a common `state_enter_*` wildcard. Also fixes a `&HttpSM :` typo that had collapsed one probe to a bare `&HttpSM`, and a call site that passed the wrong label (`tunnel_handler_plugin_client` from `tunnel_handler_plugin_agent`) so the probe name matches its handler.
db3f0ca to
af4b9d2
Compare
JosiahWI
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
STATE_ENTERpassed&HttpSM::<state>straight through as the USDT probename, so the probes were emitted with names like:
The
&and::characters are illegal in USDT probe names —bpftraceand
perftreat:as the provider/name field separator and reject&— so these ~41 probes could not be attached by name at all.
This passes the bare handler name from each call site and prepends the
prefix inside the macro, producing valid names that share a common
wildcard:
It also fixes a
&HttpSM :typo (STATE_ENTERforstate_cache_open_write)that had collapsed one probe to a bare
&HttpSM. The debug log isunchanged in meaning (
[state_read_client_request_header, EVENT]).The broken names were introduced by #11769; this is independent of the
in-flight USDT work in #13344.