Commit 3dd4672
committed
libbpf-tools/offcputime: Add multi process/thread support
This is a test example.
# ./offcputime -p 16,48
Tracing off-CPU time (us) of PID [16, 48]... Hit Ctrl-C to end.
bpf_prog_a42aae11c0bc18f2_sched_switch
bpf_prog_a42aae11c0bc18f2_sched_switch
bpf_trace_run4
__traceiter_sched_switch
__schedule
schedule
worker_thread
kthread
ret_from_fork
ret_from_fork_asm
- kworker/2:1 (48)
3353019
bpf_prog_a42aae11c0bc18f2_sched_switch
bpf_prog_a42aae11c0bc18f2_sched_switch
bpf_trace_run4
__traceiter_sched_switch
__schedule
schedule
rcu_gp_kthread
kthread
ret_from_fork
ret_from_fork_asm
- rcu_preempt (16)
1720974
The -p and -t options can be used together as follows:
# ./offcputime -p 26209 -t 16,44
Tracing off-CPU time (us) of PID [26209] TID [16, 44]... Hit Ctrl-C to end.
bpf_prog_8c5e0b074cb1a4bc_sched_switch
bpf_prog_8c5e0b074cb1a4bc_sched_switch
bpf_trace_run4
__traceiter_sched_switch
__schedule
schedule
schedule_timeout
kcompactd
kthread
ret_from_fork
ret_from_fork_asm
- kcompactd0 (44)
3023928
bpf_prog_8c5e0b074cb1a4bc_sched_switch
bpf_prog_8c5e0b074cb1a4bc_sched_switch
bpf_trace_run4
__traceiter_sched_switch
__schedule
schedule
schedule_timeout
rcu_gp_fqs_loop
rcu_gp_kthread
kthread
ret_from_fork
ret_from_fork_asm
- rcu_preempt (16)
3963
bpf_prog_8c5e0b074cb1a4bc_sched_switch
bpf_prog_8c5e0b074cb1a4bc_sched_switch
bpf_trace_run4
__traceiter_sched_switch
__schedule
schedule
irqentry_exit_to_user_mode
asm_sysvec_apic_timer_interrupt
strlen
b
a
main
__libc_start_main
- test-strlen-abc (26209)
381 parent 9f3d0df commit 3dd4672
3 files changed
+137
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
45 | 59 | | |
46 | 60 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
50 | 68 | | |
51 | 69 | | |
52 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| |||
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
55 | | - | |
56 | | - | |
| 53 | + | |
| 54 | + | |
57 | 55 | | |
58 | 56 | | |
59 | 57 | | |
| |||
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
65 | | - | |
66 | | - | |
| 63 | + | |
| 64 | + | |
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
| |||
82 | 80 | | |
83 | 81 | | |
84 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
85 | 104 | | |
86 | 105 | | |
87 | 106 | | |
| 107 | + | |
88 | 108 | | |
89 | 109 | | |
90 | 110 | | |
| |||
94 | 114 | | |
95 | 115 | | |
96 | 116 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
101 | 125 | | |
102 | 126 | | |
103 | 127 | | |
104 | 128 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
109 | 137 | | |
110 | 138 | | |
111 | 139 | | |
| |||
281 | 309 | | |
282 | 310 | | |
283 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
284 | 347 | | |
285 | 348 | | |
286 | 349 | | |
| |||
291 | 354 | | |
292 | 355 | | |
293 | 356 | | |
294 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
295 | 360 | | |
296 | 361 | | |
297 | 362 | | |
| |||
314 | 379 | | |
315 | 380 | | |
316 | 381 | | |
317 | | - | |
318 | | - | |
319 | 382 | | |
320 | 383 | | |
321 | 384 | | |
322 | 385 | | |
323 | 386 | | |
324 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
325 | 394 | | |
326 | 395 | | |
327 | 396 | | |
| |||
331 | 400 | | |
332 | 401 | | |
333 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
334 | 425 | | |
335 | 426 | | |
336 | 427 | | |
| |||
349 | 440 | | |
350 | 441 | | |
351 | 442 | | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
| 443 | + | |
| 444 | + | |
357 | 445 | | |
358 | 446 | | |
359 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
0 commit comments