Is there a command to show tracepoints “live”, which includes the PID?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have tried looking at the documentation for perf script
, perf trace
, and trace-cmd
, including the list of commands in "SEE ALSO".
I can trace e.g. sched:sched_process_exec
"live" using perf trace -a --no-syscalls -e sched:sched_process_exec
. However, it only shows the process name (e.g. ls
). It does not show the PID, unless the tracepoint has a specific parameter for it. perf script
always shows the PID, but it does not show live output; it shows the contents of a perf.data
file.
I don't need this to be a single command, like btrace
is for blktrace
. I am happy to use a pipeline, analogous to blktrace -d /dev/sda -o - | blkparse -i -
.
(Both of the above commands show PIDs :-). It is frustrating to see the blktrace
family of commands, which also use trace events, can print live output in the same format as they can print recorded traces. I can't find such power in the general-purpose tracing tools!)
linux linux-kernel perf tracing
add a comment |
up vote
0
down vote
favorite
I have tried looking at the documentation for perf script
, perf trace
, and trace-cmd
, including the list of commands in "SEE ALSO".
I can trace e.g. sched:sched_process_exec
"live" using perf trace -a --no-syscalls -e sched:sched_process_exec
. However, it only shows the process name (e.g. ls
). It does not show the PID, unless the tracepoint has a specific parameter for it. perf script
always shows the PID, but it does not show live output; it shows the contents of a perf.data
file.
I don't need this to be a single command, like btrace
is for blktrace
. I am happy to use a pipeline, analogous to blktrace -d /dev/sda -o - | blkparse -i -
.
(Both of the above commands show PIDs :-). It is frustrating to see the blktrace
family of commands, which also use trace events, can print live output in the same format as they can print recorded traces. I can't find such power in the general-purpose tracing tools!)
linux linux-kernel perf tracing
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have tried looking at the documentation for perf script
, perf trace
, and trace-cmd
, including the list of commands in "SEE ALSO".
I can trace e.g. sched:sched_process_exec
"live" using perf trace -a --no-syscalls -e sched:sched_process_exec
. However, it only shows the process name (e.g. ls
). It does not show the PID, unless the tracepoint has a specific parameter for it. perf script
always shows the PID, but it does not show live output; it shows the contents of a perf.data
file.
I don't need this to be a single command, like btrace
is for blktrace
. I am happy to use a pipeline, analogous to blktrace -d /dev/sda -o - | blkparse -i -
.
(Both of the above commands show PIDs :-). It is frustrating to see the blktrace
family of commands, which also use trace events, can print live output in the same format as they can print recorded traces. I can't find such power in the general-purpose tracing tools!)
linux linux-kernel perf tracing
I have tried looking at the documentation for perf script
, perf trace
, and trace-cmd
, including the list of commands in "SEE ALSO".
I can trace e.g. sched:sched_process_exec
"live" using perf trace -a --no-syscalls -e sched:sched_process_exec
. However, it only shows the process name (e.g. ls
). It does not show the PID, unless the tracepoint has a specific parameter for it. perf script
always shows the PID, but it does not show live output; it shows the contents of a perf.data
file.
I don't need this to be a single command, like btrace
is for blktrace
. I am happy to use a pipeline, analogous to blktrace -d /dev/sda -o - | blkparse -i -
.
(Both of the above commands show PIDs :-). It is frustrating to see the blktrace
family of commands, which also use trace events, can print live output in the same format as they can print recorded traces. I can't find such power in the general-purpose tracing tools!)
linux linux-kernel perf tracing
linux linux-kernel perf tracing
edited Nov 21 at 12:10
asked Nov 21 at 11:46
sourcejedi
22k43396
22k43396
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
perf record -a --no-syscalls -e sched:sched_process_exec sh -c read | perf script
(sh -c read
provides a way to stop this trace, just hit Enter. If I omit this command and try to interrupt the pipeline with ctrl+C, my output is lost, probably because it also interrupts perf script
).
However this output is not "live", due to buffering. E.g. running the above command shows nothing, but hitting enter causes it to stop and show a line for the exec() of sh
. blktrace
has special-case code to handle output to a pipe, including disabling the default C stdio buffering. Attempting to run perf record
under the unbuffer
command gives the error "incompatible file format"; I presume the error comes from perf script
.
man perf-report
...
OPTIONS
-i, --input=
Input file name. (default: perf.data unless stdin is a fifo)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
perf record -a --no-syscalls -e sched:sched_process_exec sh -c read | perf script
(sh -c read
provides a way to stop this trace, just hit Enter. If I omit this command and try to interrupt the pipeline with ctrl+C, my output is lost, probably because it also interrupts perf script
).
However this output is not "live", due to buffering. E.g. running the above command shows nothing, but hitting enter causes it to stop and show a line for the exec() of sh
. blktrace
has special-case code to handle output to a pipe, including disabling the default C stdio buffering. Attempting to run perf record
under the unbuffer
command gives the error "incompatible file format"; I presume the error comes from perf script
.
man perf-report
...
OPTIONS
-i, --input=
Input file name. (default: perf.data unless stdin is a fifo)
add a comment |
up vote
0
down vote
perf record -a --no-syscalls -e sched:sched_process_exec sh -c read | perf script
(sh -c read
provides a way to stop this trace, just hit Enter. If I omit this command and try to interrupt the pipeline with ctrl+C, my output is lost, probably because it also interrupts perf script
).
However this output is not "live", due to buffering. E.g. running the above command shows nothing, but hitting enter causes it to stop and show a line for the exec() of sh
. blktrace
has special-case code to handle output to a pipe, including disabling the default C stdio buffering. Attempting to run perf record
under the unbuffer
command gives the error "incompatible file format"; I presume the error comes from perf script
.
man perf-report
...
OPTIONS
-i, --input=
Input file name. (default: perf.data unless stdin is a fifo)
add a comment |
up vote
0
down vote
up vote
0
down vote
perf record -a --no-syscalls -e sched:sched_process_exec sh -c read | perf script
(sh -c read
provides a way to stop this trace, just hit Enter. If I omit this command and try to interrupt the pipeline with ctrl+C, my output is lost, probably because it also interrupts perf script
).
However this output is not "live", due to buffering. E.g. running the above command shows nothing, but hitting enter causes it to stop and show a line for the exec() of sh
. blktrace
has special-case code to handle output to a pipe, including disabling the default C stdio buffering. Attempting to run perf record
under the unbuffer
command gives the error "incompatible file format"; I presume the error comes from perf script
.
man perf-report
...
OPTIONS
-i, --input=
Input file name. (default: perf.data unless stdin is a fifo)
perf record -a --no-syscalls -e sched:sched_process_exec sh -c read | perf script
(sh -c read
provides a way to stop this trace, just hit Enter. If I omit this command and try to interrupt the pipeline with ctrl+C, my output is lost, probably because it also interrupts perf script
).
However this output is not "live", due to buffering. E.g. running the above command shows nothing, but hitting enter causes it to stop and show a line for the exec() of sh
. blktrace
has special-case code to handle output to a pipe, including disabling the default C stdio buffering. Attempting to run perf record
under the unbuffer
command gives the error "incompatible file format"; I presume the error comes from perf script
.
man perf-report
...
OPTIONS
-i, --input=
Input file name. (default: perf.data unless stdin is a fifo)
answered Nov 21 at 12:37
sourcejedi
22k43396
22k43396
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483189%2fis-there-a-command-to-show-tracepoints-live-which-includes-the-pid%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown