Commit 6b3d3a1
offcputime: Support tracking specified processes and threads
Inspired by the perf-top command, the offcputime tool is
enhanced to support tracking multiple processes and threads.
$ man perf-top
-p <pid>, --pid=<pid>
Profile events on existing Process ID (comma separated list).
-t <tid>, --tid=<tid>
Profile events on existing thread ID (comma separated list).
Before:
$ offcputime -h
optional arguments:
-p PID, --pid PID trace this PID only
-t TID, --tid TID trace this TID only
examples:
./offcputime -p 185 # only trace threads for PID 185
./offcputime -t 188 # only trace thread 188
After:
$ offcputime -h
optional arguments:
-p PID, --pid PID trace these PIDs only, comma separated list
-t TID, --tid TID trace these TIDs only, comma separated list
examples:
./offcputime -p 185,175,165 # only trace threads for PID 185,175,165
./offcputime -t 188,120,134 # only trace threads 188,120,134
Signed-off-by: Yingming Mao <[email protected]>
Reviewed-by: Shuo Li <[email protected]>1 parent 2718177 commit 6b3d3a1
1 file changed
+22
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
26 | 36 | | |
27 | 37 | | |
28 | 38 | | |
| |||
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
55 | | - | |
56 | | - | |
| 65 | + | |
| 66 | + | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
| |||
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
73 | 83 | | |
74 | 84 | | |
75 | 85 | | |
| |||
200 | 210 | | |
201 | 211 | | |
202 | 212 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
209 | 219 | | |
210 | 220 | | |
211 | 221 | | |
| |||
0 commit comments