10.1.x: USDT: normalize names for STATE_ENTER#13365
Open
moonchen wants to merge 1 commit into
Open
Conversation
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. (cherry picked from commit af4b9d2)
Contributor
Author
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.
Backport of #13346.
STATE_ENTERpassed&HttpSM::<state>straight through as the USDT probename, so probes were emitted as e.g.
&HttpSM::state_read_client_request_header.The
&and::characters are illegal in USDT probe names: bpftrace and perftreat
:as the provider/name field separator and reject&, so these probescould 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_headerthat share a common
state_enter_*wildcard. Also fixes a&HttpSM :typothat had collapsed one probe to a bare
&HttpSM, and a call site that passedthe wrong label (
tunnel_handler_plugin_clientfromtunnel_handler_plugin_agent)so the probe name matches its handler.
Did not cherry-pick cleanly:
state_http_server_openconflicted with the exponential-backoff retrylogic from Retry Connect with Exponential Backoff #12397, which isn't in 10.1.x; resolved by keeping 10.1.x's
version of that function.
(
state_pre_resolve,state_mark_os_down) also needed converting to thenew macro syntax, or the file wouldn't compile.
Verified
traffic_serverbuilds clean on 10.1.x with this applied.