10 Mar, 2010

2 commits

  • Now that report can store historgrams for multiple events we
    need to be able to do the post processing work for each
    histogram. This patch changes the post processing functions so
    that they can be called individually for each event's histogram.

    Signed-off-by: Eric B Munson
    [ Guarantee bisectabilty by fixing up builtin-report.c ]
    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Eric B Munson
     
  • In order to minimize the impact of storing multiple events in a
    report this function will now take the root of the histogram
    tree so that the logic for selecting the proper tree can be
    inserted before the call.

    Signed-off-by: Eric B Munson
    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Eric B Munson
     

16 Jan, 2010

1 commit

  • Since they can come from another architecture with bigger
    pointers, i.e. processing a 64-bit perf.data on a 32-bit arch.

    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
     

30 Dec, 2009

2 commits

  • When we finish creating the hist_entries we _already_ have them
    sorted "by name", in fact by what is in --sort, that is exactly
    how we can find the pairs in perf_session__match_hists as
    'comm', 'dso' & 'symbol' all are strings we need to find the
    matches in the baseline session.

    So only do the sort by hits followed by a resort by --sort if we
    need to find the position for shwowing the --displacement of
    hist entries.

    Now all these modes work correctly:

    Example is a simple 'perf record -f find / > /dev/null' ran
    twice then followed by the following commands:

    $ perf diff -f --sort comm
    # Baseline Delta Command
    # ........ .......... .......
    #
    0.00% +100.00% find
    $ perf diff -f --sort dso
    # Baseline Delta Shared Object
    # ........ .......... ..................
    #
    59.97% -0.44% [kernel]
    21.17% +0.28% libc-2.5.so
    18.49% +0.16% [ext3]
    0.37% find
    $ perf diff -f --sort symbol | head -8
    # Baseline Delta Symbol
    # ........ .......... ......
    #
    6.21% +0.36% [k] ext3fs_dirhash
    3.43% +0.41% [.] __GI_strlen
    3.53% +0.16% [k] __kmalloc
    3.17% +0.49% [k] system_call
    3.06% +0.37% [k] ext3_htree_store_dirent
    $ perf diff -f --sort dso,symbol | head -8
    # Baseline Delta Shared Object Symbol
    # ........ .......... .................. ......
    #
    6.21% +0.36% [ext3] [k] ext3fs_dirhash
    3.43% +0.41% libc-2.5.so [.] __GI_strlen
    3.53% +0.16% [kernel] [k] __kmalloc
    3.17% +0.49% [kernel] [k] system_call
    3.06% +0.37% [ext3] [k] ext3_htree_store_dirent
    $

    And we don't have to do two expensive resorts in the common, non
    --displacement case.

    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
     
  • Since we don't add histograms buckets for them, this way the sum
    of baselines should be 100%.

    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
     

28 Dec, 2009

2 commits


19 Dec, 2009

1 commit

  • Fixing this:

    [acme@doppio linux-2.6-tip]$ perf diff --hell
    Error: unknown option `hell'

    usage: perf diff [] [old_file] [new_file]
    Segmentation fault
    [acme@doppio linux-2.6-tip]$

    Also go over the other such arrays to check if they all were OK,
    they are, but there were some minor changes to do like making
    one static and renaming another to match the command it refers
    to.

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

    Arnaldo Carvalho de Melo
     

17 Dec, 2009

1 commit

  • 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

4 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
     
  • 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
     

15 Dec, 2009

1 commit

  • 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