A "live mode" for perf
The perf tracing tool has evolved quickly. When last we looked, Tom Zanussi had added Python and Perl scripting to perf. Next up would seem to be perf "live mode", where perf no longer requires two steps: record the data, then analyze. Live mode will allow perf trace record and perf trace report to operate via a pipe, which allows instantaneous, as well as continuously updating (a la top), output.
So that no existing perf users need to change their scripts, Zanussi only added the new capabilities when perf recognizes that its record output is going to stdout or report input is coming from stdin. In that case, perf handles the data through a pipe, and uses special synthesized events to provide header information. This will also allow perf to operate over the network by piping its record output to netcat, and then reading it via netcat on another system and piping it into report.
All of the scripts that are installed in the standard perf location (i.e. those which are listed in perf trace -l) are automatically able to be run in live mode:
$ perf trace syscall-countswill run both ends of the the syscall-counts script with a pipe in between, a more usable shorthand for:
$ perf trace record syscall-counts -o - | perf trace report syscall-counts -i -which itself is shorthand for:
perf record -c 1 -f -a -M -R -e raw_syscalls:sys_enter -o - | \ perf trace -i - -s ~/libexec/perf-core/scripts/python/syscall-counts.py
Zanussi also included several sample top-style scripts that can be used
to monitor read/write or system call activity updated every three seconds.
It looks to be a very useful addition to perf, which is rapidly becoming
the "swiss army knife" of kernel monitoring.
Index entries for this article | |
---|---|
Kernel | Performance monitoring |
Posted Apr 9, 2010 9:41 UTC (Fri)
by jengelh (subscriber, #33263)
[Link] (3 responses)
Posted Apr 9, 2010 18:57 UTC (Fri)
by giraffedata (guest, #1954)
[Link]
Posted Apr 12, 2010 17:31 UTC (Mon)
by intgr (subscriber, #39733)
[Link] (1 responses)
Posted Apr 12, 2010 19:02 UTC (Mon)
by jengelh (subscriber, #33263)
[Link]
Not really.
socat - tcp:google.com:80
A "live mode" for perf
My thoughts exactly.
A "live mode" for perf: socat
A "live mode" for perf
A "live mode" for perf
socat tcp-l:8000 -