Commit 0e8c031b authored by Brendan Gregg's avatar Brendan Gregg Committed by GitHub

Merge pull request #1361 from navytux/y/hardirqs-d-fix

hardirqs, softirqs: Fix distribution mode units handling
parents 920319d1 f2d125e2
...@@ -109,7 +109,7 @@ int trace_completion(struct pt_regs *ctx) ...@@ -109,7 +109,7 @@ int trace_completion(struct pt_regs *ctx)
# code substitutions # code substitutions
if args.dist: if args.dist:
bpf_text = bpf_text.replace('STORE', bpf_text = bpf_text.replace('STORE',
'irq_key_t key = {.slot = bpf_log2l(delta)};' + 'irq_key_t key = {.slot = bpf_log2l(delta / %d)};' % factor +
'bpf_probe_read(&key.name, sizeof(key.name), name);' + 'bpf_probe_read(&key.name, sizeof(key.name), name);' +
'dist.increment(key);') 'dist.increment(key);')
else: else:
......
...@@ -103,7 +103,7 @@ TRACEPOINT_PROBE(irq, softirq_exit) ...@@ -103,7 +103,7 @@ TRACEPOINT_PROBE(irq, softirq_exit)
# code substitutions # code substitutions
if args.dist: if args.dist:
bpf_text = bpf_text.replace('STORE', bpf_text = bpf_text.replace('STORE',
'key.vec = vec; key.slot = bpf_log2l(delta); ' + 'key.vec = vec; key.slot = bpf_log2l(delta / %d); ' % factor +
'dist.increment(key);') 'dist.increment(key);')
else: else:
bpf_text = bpf_text.replace('STORE', bpf_text = bpf_text.replace('STORE',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment