Skip to content

[usdt] http_attach_client_session: add args#13041

Merged
moonchen merged 1 commit intoapache:masterfrom
moonchen:probe-acs-add-params
Mar 31, 2026
Merged

[usdt] http_attach_client_session: add args#13041
moonchen merged 1 commit intoapache:masterfrom
moonchen:probe-acs-add-params

Conversation

@moonchen
Copy link
Copy Markdown
Contributor

Add the following USDT arguments to http_attach_client_session: transaction id, netVC id.

Add the following USDT arguments to http_attach_client_session: transaction id, netVC id.
@moonchen moonchen self-assigned this Mar 30, 2026
@moonchen moonchen added this to the 11.0.0 milestone Mar 30, 2026
@bryancall bryancall requested review from bneradt and Copilot March 30, 2026 22:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds additional USDT (SystemTap) probe arguments to improve observability when a client session is attached in the HTTP state machine.

Changes:

  • Extend http_attach_client_session probe from 2 to 4 arguments.
  • Include transaction id and UnixNetVConnection id (when available) in the probe payload.

Comment on lines +426 to +427
ATS_PROBE4(http_attach_client_session, sm_id, netvc->get_socket(), txn->get_transaction_id(),
dynamic_cast<UnixNetVConnection *>(netvc) ? dynamic_cast<UnixNetVConnection *>(netvc)->id : 0);
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 4th probe argument repeats the same dynamic_cast twice, which is unnecessary work (when probes are enabled) and makes the probe call harder to read. Consider storing the cast result in a local UnixNetVConnection * (or auto *) and passing unix_vc ? unix_vc->id : 0 as the last argument.

Suggested change
ATS_PROBE4(http_attach_client_session, sm_id, netvc->get_socket(), txn->get_transaction_id(),
dynamic_cast<UnixNetVConnection *>(netvc) ? dynamic_cast<UnixNetVConnection *>(netvc)->id : 0);
auto *unix_vc = dynamic_cast<UnixNetVConnection *>(netvc);
ATS_PROBE4(http_attach_client_session, sm_id, netvc->get_socket(), txn->get_transaction_id(),
unix_vc ? unix_vc->id : 0);

Copilot uses AI. Check for mistakes.
@moonchen moonchen merged commit 5f30ce6 into apache:master Mar 31, 2026
19 checks passed
@github-project-automation github-project-automation bot moved this to For v10.1.1 in ATS v10.1.x Mar 31, 2026
@github-project-automation github-project-automation bot moved this to For v10.2.0 in ATS v10.2.x Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: For v10.1.1
Status: For v10.2.0

Development

Successfully merging this pull request may close these issues.

3 participants