17 Dec, 2009

4 commits

  • Create events with a pid and cpu contraint for inherited events
    so that we get a stream per cpu, instead of all cpus contending
    on a single stream.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: fweisbec@gmail.com
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Remove that ugly usleep and provide proper serialization between
    parent and child just like perf-stat does.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: fweisbec@gmail.com
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Otherwise we do integer math and the delta values round up to
    multiples of 1.0%.

    Also, calculate absolute values. Things look precise now:

    $ perf report -i perf.data.old --sort dso,symbol | head -13
    9.02% libc-2.10.1.so [.] _IO_vfprintf_internal
    4.88% find [.] 0x00000000014af0
    2.91% [kernel] [k] __kmalloc
    2.85% [kernel] [k] ext4_htree_store_dirent
    2.50% libc-2.10.1.so [.] __GI_memmove
    2.44% [kernel] [k] half_md4_transform
    2.43% [kernel] [k] _spin_lock
    2.33% [kernel] [k] system_call
    $ perf report -i perf.data --sort dso,symbol | head -13
    8.55% libc-2.10.1.so [.] _IO_vfprintf_internal
    3.11% [kernel] [k] __kmalloc
    3.07% [kernel] [k] ext4_htree_store_dirent
    2.66% find [.] 0x00000000016bcf
    2.61% [kernel] [k] _atomic_dec_and_lock
    2.46% [kernel] [k] half_md4_transform
    2.41% libc-2.10.1.so [.] __GI_memmove
    2.30% find [.] 0x00000000009219
    $ perf diff | head -13
    9.02% -0.47% libc-2.10.1.so [.] _IO_vfprintf_internal
    2.91% +0.20% [kernel] [k] __kmalloc
    2.85% +0.23% [kernel] [k] ext4_htree_store_dirent
    1.99% +0.62% [kernel] [k] _atomic_dec_and_lock
    2.44% +0.02% [kernel] [k] half_md4_transform
    2.50% -0.09% libc-2.10.1.so [.] __GI_memmove
    1.88% +0.01% [kernel] [k] __d_lookup
    2.43% -0.75% [kernel] [k] _spin_lock
    0.97% +0.62% [kernel] [k] path_get
    1.99% -0.42% libc-2.10.1.so [.] _int_malloc
    $

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • This is a more intuitive / more meaningful default:

    $ perf diff | head -8
    9.02% +1.00% libc-2.10.1.so [.] _IO_vfprintf_internal
    2.91% -1.00% [kernel] [k] __kmalloc
    2.85% -1.00% [kernel] [k] ext4_htree_store_dirent
    1.99% -1.00% [kernel] [k] _atomic_dec_and_lock
    2.44% [kernel]
    $

    Suggested-by: Ingo Molnar
    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     

16 Dec, 2009

22 commits

  • That means that almost everything you can do with 'perf report'
    can be done with 'perf diff', for instance:

    $ perf record -f find / > /dev/null
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.062 MB perf.data (~2699
    samples) ] $ perf record -f find / > /dev/null
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.062 MB perf.data (~2687
    samples) ] perf diff | head -8
    9.02% +1.00% find libc-2.10.1.so [.] _IO_vfprintf_internal
    2.91% -1.00% find [kernel] [k] __kmalloc
    2.85% -1.00% find [kernel] [k] ext4_htree_store_dirent
    1.99% -1.00% find [kernel] [k] _atomic_dec_and_lock
    2.44% find [kernel] [k] half_md4_transform
    $

    So if you want to zoom into libc:

    $ perf diff --dsos libc-2.10.1.so | head -8
    37.34% find [.] _IO_vfprintf_internal
    10.34% find [.] __GI_memmove
    8.25% +2.00% find [.] _int_malloc
    5.07% -1.00% find [.] __GI_mempcpy
    7.62% +2.00% find [.] _int_free
    $

    And if there were multiple commands using libc, it is also
    possible to aggregate them all by using --sort symbol:

    $ perf diff --dsos libc-2.10.1.so --sort symbol | head -8
    37.34% [.] _IO_vfprintf_internal
    10.34% [.] __GI_memmove
    8.25% +2.00% [.] _int_malloc
    5.07% -1.00% [.] __GI_mempcpy
    7.62% +2.00% [.] _int_free
    $

    The displacement column now is off by default, to use it:

    perf diff -m --dsos libc-2.10.1.so --sort symbol | head -8
    37.34% [.] _IO_vfprintf_internal
    10.34% [.] __GI_memmove
    8.25% +2.00% [.] _int_malloc
    5.07% -1.00% +2 [.] __GI_mempcpy
    7.62% +2.00% -1 [.] _int_free
    $

    Using -t/--field-separator can be used for scripting:

    $ perf diff -t, -m --dsos libc-2.10.1.so --sort symbol | head -8
    37.34, , ,[.] _IO_vfprintf_internal
    10.34, , ,[.] __GI_memmove
    8.25,+2.00%, ,[.] _int_malloc
    5.07,-1.00%, +2,[.] __GI_mempcpy
    7.62,+2.00%, -1,[.] _int_free
    6.99,+1.00%, -1,[.] _IO_new_file_xsputn
    1.89,-2.00%, +4,[.] __readdir64
    $

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • Introduced in:

    d599db3fc5dd4f1e8432fdbc6d899584b25f4dff
    "perf report: Generalize perf_session__fprintf_hists()"

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • Those don't make sense for tools such as 'perf diff'.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • Will be used in other tools such as 'perf diff'.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • Pull it out of builtin-report - further changes will be made and it
    will then be reusable in 'perf diff' as well.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • So that --dsos, --comm, --symbols can bem used in more tools,
    like in perf diff:

    $ perf record -f find / > /dev/null
    $ perf record -f find / > /dev/null
    $ perf diff --dsos /lib64/libc-2.10.1.so | head -5
    1 +22392124 /lib64/libc-2.10.1.so _IO_vfprintf_internal
    2 +6410655 /lib64/libc-2.10.1.so __GI_memmove
    3 +1 +9192692 /lib64/libc-2.10.1.so _int_malloc
    4 -1 -15158605 /lib64/libc-2.10.1.so _int_free
    5 +45669 /lib64/libc-2.10.1.so _IO_new_file_xsputn
    $

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • Will be used in perf diff too.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • This simplifies a lot of functions, less stuff to be done by
    tool writers.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • Fix perf probe to show which probe point is not found.
    With out this patch, it shows just "No probe point found."
    This doesn't help users if they specify several probes.
    e.g.

    # perf probe -f --add schedule --add test
    Fatal: No probe point found.

    This patch makes error message more helpful as below.

    # perf probe --add schedule --add test
    Fatal: Probe point 'test' not found. - probe not added.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Check symbols in symtab/kallsyms when no debuginfo
    is available.

    e.g.

    # perf probe test
    Fatal: Kernel symbol 'test' not found - probe not added.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Check build-id of vmlinux by using functions in symbol.c.
    This also exposes map__load() for getting vmlinux path,
    and removes vmlinux path list in builtin-probe.c,
    because symbol.c already has that. Checking build-id
    prevents users to open old or different debuginfo from
    current running kernel.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Reject second attempt of adding same-name event. This patch
    also provides --force option which allows user to add additional
    probe events on the same-name event.

    e.g.
    (the first attempt : success)
    ./perf probe schedule
    Added new event:
    probe:schedule (on schedule+0)

    (the second attempt : failure)
    ./perf probe schedule:11
    Error: event "schedule" already exists. (Use -f to force duplicates.)
    Fatal: Can't add new event.

    (the second attempt with -f : successfully added)
    ./perf probe -f schedule:11
    Added new event:
    probe:schedule_1 (on schedule+45)

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Support event name syntax for --add option. This allows
    users to specify event name for each new event.

    The --add syntax is:
    perf probe --add '[EVENT=]SRC:LINE ARGS'
    or
    perf probe --add '[EVENT=]FUNC[+OFFS|%return|:RLN][@SRC] ARGS'

    e.g.

    ./perf probe --add myprobe1=schedule

    Note: currently group name is not supported yet, because it
    can cause name-space confliction with other tracepoint/
    hw-breakpoint events.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Add glob-expression matching support on --del option.
    You can use wildcards for specifying deleting events.
    e.g.

    Clear all probe events:

    # perf probe --del '*'

    Clear probes on schedule():

    # perf probe --del 'schedule*'

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Use strlist__for_each macros instead of using strlist__entry()
    and index variable.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Add for_each iteration macros for strlist. This patch
    introduces strlist__for_each() and strlist__for_each_safe(),
    both are similar to list_for_each() and list_for_each_safe().

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Fix --del option to update current existing event list
    after perf probe deleted an event.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Fix --del option to show info message instead of warning
    if failing to find specified event.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Show need-dwarf message only if the probe is really requires
    debuginfo analysis. This also use pr_debug for debugging message
    instead of pr_warning.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Check hyphen only command argument, because perf-probe doesn't
    support event recording feature yet.

    e.g.

    # perf probe -
    Error: '-' is not supported.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Fix show_perf_probe_event() to check the result of e_snprintf().

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Clean up struct session in builtin-probe.c, including
    change need_dwarf to bool and move listing flag into
    struct session as list_events flag.

    This also changes parse_perf_probe_event() interface
    due to code readability.

    Signed-off-by: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Frank Ch. Eigler
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

15 Dec, 2009

14 commits

  • Add a newline do fix this problem:

    ERROR: perf-diff.txt: line 31: closing [blockdef-listing]
    delimiter expected

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • Fix the short line displayed by 'perf' and also fix some other
    details in the longer text.

    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Update the perf-trace page with new and missing options and
    remove some unused ones.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • Allow scripts to be recorded/executed by simply specifying the
    script root name (the script name minus extension) along with
    'record' or 'report' to 'perf trace'.

    The script names shown by 'perf trace -l' can be directly used
    to run the command-line contained within the corresponding
    '-record' and '-report' versions of scripts in the scripts/*/bin
    directories.

    For example, to record the trace data needed to run the
    wakeup-latency.pl script, the user can easily find the name of
    the corresponding script from the script list and invoke it
    using 'perf trace record', without having to remember the
    details of how to do the same thing using the lower-level perf
    trace command-line options:

    root@tropicana:~# perf trace -l
    List of available trace scripts:
    workqueue-stats workqueue stats (ins/exe/create/destroy)
    wakeup-latency system-wide min/max/avg wakeup latency
    rw-by-file r/w activity for a program, by file
    check-perf-trace useless but exhaustive test script
    rw-by-pid system-wide r/w activity

    root@tropicana:~# perf trace record wakeup-latency
    ^C[ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.296 MB perf.data (~12931
    samples) ]

    To run the wakeup-latency.pl script using the captured data,
    change 'record' to 'report' in the command-line:

    root@tropicana:~# perf trace report wakeup-latency

    wakeup_latency stats:

    total_wakeups: 65
    avg_wakeup_latency (ns): 22417
    min_wakeup_latency (ns): 3470
    max_wakeup_latency (ns): 223311

    perf trace Perl script stopped

    If the script takes options, thay can be simply added to the end
    of the 'report' invocation:

    root@tropicana:~# perf trace record rw-by-file
    ^C[ perf record: Woken up 2 times to write data ]
    [ perf record: Captured and wrote 0.782 MB perf.data (~34171
    samples) ]

    root@tropicana:~# perf trace report rw-by-file perf

    file read counts for perf:

    fd # reads bytes_requested
    ------ ---------- -----------
    122 1934 1980416
    120 1 32

    file write counts for perf:

    fd # writes bytes_written
    ------ ---------- -----------
    3 4006 280568

    perf trace Perl script stopped

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • Lists the available perf trace scripts, one per line e.g.:

    root@tropicana:~# perf trace -l
    List of available trace scripts:
    workqueue-stats workqueue stats (ins/exe/create/destroy)
    wakeup-latency system-wide min/max/avg wakeup latency
    rw-by-file r/w activity for a program, by file
    check-perf-trace useless but exhaustive test script
    rw-by-pid system-wide r/w activity

    To be consistent with the other listing options in perf, the
    current latency trace option was changed to '-L', and '-l' is
    now used to access the script listing as:

    To create the list, it searches each scripts/*/bin directory for
    files ending with "-report" and reads information found in
    certain comment lines contained in those shell scripts:

    - if the comment line starts with "description:", the rest of the
    line is used as a 'half-line' description. To keep each line in
    the list to a single line, the description should be limited to 40
    characters (the rest of the line contains the script name and
    args)

    - if the comment line starts with "args:", the rest of the line
    names the args the script supports. Required args should be
    surrounded by <> brackets, optional args by [] brackets.

    The current scripts in scripts/perl/bin have also been updated
    with description: and args: comments.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • The return value from perl_run() is currently ignored, but it
    should be checked and used to exit perf if there are problems
    loading the script.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • README and Makefile.PL don't need to be installed for Perl
    run-time support.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • One oversight of the original scripting_ops patch was a lack of
    support for passing args to handler scripts. This adds
    argc/argv to the start_script() scripting_op, and changes the
    rw-by-file script to take 'comm' arg rather than the 'perf'
    value currently hard-coded. It also takes the opportunity to do
    some related minor cleanup.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • perf top, report and annotate all define their own symbol_conf,
    it should be static.

    Signed-off-by: Frederic Weisbecker
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     
  • I guess it is enough to show some examples:

    [root@doppio linux-2.6-tip]# rm -f perf.data*
    [root@doppio linux-2.6-tip]# ls -la perf.data*
    ls: cannot access perf.data*: No such file or directory
    [root@doppio linux-2.6-tip]# perf record -f find / > /dev/null
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.062 MB perf.data (~2699 samples) ]
    [root@doppio linux-2.6-tip]# ls -la perf.data*
    -rw------- 1 root root 74440 2009-12-14 20:03 perf.data
    [root@doppio linux-2.6-tip]# perf record -f find / > /dev/null
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.062 MB perf.data (~2692 samples) ]
    [root@doppio linux-2.6-tip]# ls -la perf.data*
    -rw------- 1 root root 74280 2009-12-14 20:03 perf.data
    -rw------- 1 root root 74440 2009-12-14 20:03 perf.data.old
    [root@doppio linux-2.6-tip]# perf diff | head -5
    1 -34994580 /lib64/libc-2.10.1.so _IO_vfprintf_internal
    2 -15307806 [kernel.kallsyms] __kmalloc
    3 +1 +3665941 /lib64/libc-2.10.1.so __GI_memmove
    4 +4 +23508995 /lib64/libc-2.10.1.so _int_malloc
    5 +7 +38538813 [kernel.kallsyms] __d_lookup
    [root@doppio linux-2.6-tip]# perf diff -p | head -5
    1 +1.00% /lib64/libc-2.10.1.so _IO_vfprintf_internal
    2 [kernel.kallsyms] __kmalloc
    3 +1 /lib64/libc-2.10.1.so __GI_memmove
    4 +4 /lib64/libc-2.10.1.so _int_malloc
    5 +7 -1.00% [kernel.kallsyms] __d_lookup
    [root@doppio linux-2.6-tip]# perf diff -v | head -5
    1 361449551 326454971 -34994580 /lib64/libc-2.10.1.so _IO_vfprintf_internal
    2 151009241 135701435 -15307806 [kernel.kallsyms] __kmalloc
    3 +1 101805328 105471269 +3665941 /lib64/libc-2.10.1.so __GI_memmove
    4 +4 78041440 101550435 +23508995 /lib64/libc-2.10.1.so _int_malloc
    5 +7 59536172 98074985 +38538813 [kernel.kallsyms] __d_lookup
    [root@doppio linux-2.6-tip]# perf diff -vp | head -5
    1 9.00% 8.00% +1.00% /lib64/libc-2.10.1.so _IO_vfprintf_internal
    2 3.00% 3.00% [kernel.kallsyms] __kmalloc
    3 +1 2.00% 2.00% /lib64/libc-2.10.1.so __GI_memmove
    4 +4 2.00% 2.00% /lib64/libc-2.10.1.so _int_malloc
    5 +7 1.00% 2.00% -1.00% [kernel.kallsyms] __d_lookup
    [root@doppio linux-2.6-tip]#

    This should be enough for diffs where the system is non
    volatile, i.e. when one doesn't updates binaries.

    For volatile environments, stay tuned for the next perf tool
    feature: a buildid cache populated by 'perf record', managed by
    'perf buildid-cache' a-la ccache, and used by all the report
    tools.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: "Paul E. McKenney"
    Cc: Stephen Hemminger
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Paul E. McKenney
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • Suggested-by: Steven Rostedt
    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • And it is also needed by 'perf diff'.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • All tools had copies, and perf diff would have to specify a
    sample_type_check method just for copying it.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo