Skip to content

Commit 212a6e8

Browse files
committed
Mask CPU id to 16 bits when encoding block req_id
Make the high-16-bits CPU field explicit at the point of use so the encoding matches its doc comment and no longer relies on silent shift overflow to bound the CPU id. Behaviorally equivalent for realistic CPU counts; the mask just documents the field width in the code itself. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Y9in1s3yxA9ZWLKmfQyUa
1 parent 42be501 commit 212a6e8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/tracer/prober/prober.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2898,7 +2898,7 @@ TRACEPOINT_PROBE(block, block_rq_issue) {
28982898
if (gen) {
28992899
u64 seq = *gen;
29002900
*gen = seq + 1;
2901-
ictx.req_id = ((u64)bpf_get_smp_processor_id() << 48) | (seq & 0xFFFFFFFFFFFFULL);
2901+
ictx.req_id = ((u64)(bpf_get_smp_processor_id() & 0xFFFF) << 48) | (seq & 0xFFFFFFFFFFFFULL);
29022902
}
29032903

29042904
block_start_times.update(&key, &ictx);

0 commit comments

Comments
 (0)