Conversation
Sometimes one span covers more than one kind of operation. Let users pass extra arguments to the span-end probe so tracers can split its latency by category. To that end extend span_with_probe! with a probe_args option: a [u64; N] array expression:(N = 0..=3) whose values are exposed to the tracer as the probe's arguments after the span duration (arg0). The macro emits a per-span probe function of matching arity and a stapsdt note with one -8@<reg> descriptor per argument, so each call site chooses how many values it passes. The probe function pointer is type-erased (as *const ()) in the shared SpanProbe, which carries the args in a fixed [u64; 4] array; Drop casts it back to the right fn(u64, ..) arity. Spans without probe_args keep a duration-only probe, and tracers reading only arg0 are unaffected.
Add a cache_task span that alternates cache hits and misses, passing a hit flag as arg1 via probe_args. The bpftrace script buckets the single probe's durations by outcome with /arg1 == 1/ and /arg1 == 0/ filters.
oga35767-eng
approved these changes
Sep 21, 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.
Sometimes one span covers more than one kind of operation. Let users pass extra arguments to the span-end probe so tracers can split its latency by category.