Content-Length: 14140 | pFad | http://lwn.net/Articles/382554/

A "live mode" for perf [LWN.net]
|
|
Subscribe / Log in / New account

A "live mode" for perf

By Jake Edge
April 7, 2010

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-counts
will 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
KernelPerformance monitoring


to post comments

A "live mode" for perf

Posted Apr 9, 2010 9:41 UTC (Fri) by jengelh (subscriber, #33263) [Link] (3 responses)

socat >>> netcat

A "live mode" for perf: socat

Posted Apr 9, 2010 18:57 UTC (Fri) by giraffedata (guest, #1954) [Link]

My thoughts exactly.

A "live mode" for perf

Posted Apr 12, 2010 17:31 UTC (Mon) by intgr (subscriber, #39733) [Link] (1 responses)

Socat is great and all, but for simple stuff, netcat stdin-to-TCP or TCP-to-stdout pipe, netcat is still much easier to use.

A "live mode" for perf

Posted Apr 12, 2010 19:02 UTC (Mon) by jengelh (subscriber, #33263) [Link]

>for simple stuff, netcat stdin-to-TCP or TCP-to-stdout pipe, netcat is still much easier to use.

Not really.

socat - tcp:google.com:80
socat tcp-l:8000 -


Copyright © 2010, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://lwn.net/Articles/382554/

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy