Skip to content

10.1.x: USDT: normalize names for STATE_ENTER#13365

Open
moonchen wants to merge 1 commit into
apache:10.1.xfrom
moonchen:pr-usdt-state-enter-10.1.x
Open

10.1.x: USDT: normalize names for STATE_ENTER#13365
moonchen wants to merge 1 commit into
apache:10.1.xfrom
moonchen:pr-usdt-state-enter-10.1.x

Conversation

@moonchen

@moonchen moonchen commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Backport of #13346.

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.

Did not cherry-pick cleanly:

  • state_http_server_open conflicted with the exponential-backoff retry
    logic 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.
  • Two call sites that 10.1.x still carries but master no longer has
    (state_pre_resolve, state_mark_os_down) also needed converting to the
    new macro syntax, or the file wouldn't compile.

Verified traffic_server builds clean on 10.1.x with this applied.

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)
@moonchen

moonchen commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@cmcfarlen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant