Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offcputime: Support tracking specified processes and threads #5095

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

ELWIN-MAO
Copy link

@ELWIN-MAO ELWIN-MAO commented Aug 29, 2024

Inspired by the perf-top command, the offcputime tool is enhanced to support tracking multiple processes and threads.

$ man perf-top
-p , --pid=
Profile events on existing Process ID (comma separated list).
-t , --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]

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]>
@yonghong-song yonghong-song merged commit ebdd760 into iovisor:master Sep 3, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants