01 Apr, 2013

1 commit

  • perf record has a new option -W that enables weightened sampling.

    Add sorting support in top/report for the average weight per sample and the
    total weight sum. This allows to both compare relative cost per event
    and the total cost over the measurement period.

    Add the necessary glue to perf report, record and the library.

    v2: Merge with new hist refactoring.
    v3: Fix manpage. Remove value check.
    Rename global_weight to weight and weight to local_weight.
    v4: Readd sort keys to manpage
    v5: Move weight to end
    v6: Move weight to template
    v7: Rename weight key.

    Original patch from Andi modified by Stephane Eranian
    to include ONLY the weight supporting code and apply to pristine 3.8.0-rc4.

    Signed-off-by: Andi Kleen
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1359040242-8269-6-git-send-email-eranian@google.com
    [ committer note: changed to cope with fc5871ed and the hists_link perf test entry ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Andi Kleen
     

12 Dec, 2012

1 commit

  • Using struct perf_record_opts to specify how to configure the evsel
    perf_event_attrs.

    This gets top closer to record in the way it sets up evsels, with the
    aim of sharing more and more to the point that both will be a single
    utility.

    In this direction top now uses the same callchain option parsing as
    record and that brings DWARF callchains to top, something that was
    already available for record.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-u03o0bsrqcjgskciso3pvsjr@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

20 Jun, 2012

1 commit

  • Using addr2line for now, requires debuginfo, needs more work to support
    detached debuginfo, aka foo-debuginfo packages.

    Example:

    [root@sandy ~]# perf record -a sleep 3
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.555 MB perf.data (~24236 samples) ]
    [root@sandy ~]# perf report -s dso,srcline 2>&1 | grep -v ^# | head -5
    22.41% [kernel.kallsyms] /home/git/linux/drivers/idle/intel_idle.c:280
    4.79% [kernel.kallsyms] /home/git/linux/drivers/cpuidle/cpuidle.c:148
    4.78% [kernel.kallsyms] /home/git/linux/arch/x86/include/asm/atomic64_64.h:121
    4.49% [kernel.kallsyms] /home/git/linux/kernel/sched/core.c:1690
    4.30% [kernel.kallsyms] /home/git/linux/include/linux/seqlock.h:90
    [root@sandy ~]#

    [root@sandy ~]# perf top -U -s dso,symbol,srcline
    Samples: 1K of event 'cycles', Event count (approx.): 589617389
    18.66% [kernel] [k] copy_user_generic_unrolled /home/git/linux/arch/x86/lib/copy_user_64.S:143
    7.83% [kernel] [k] clear_page /home/git/linux/arch/x86/lib/clear_page_64.S:39
    6.59% [kernel] [k] clear_page /home/git/linux/arch/x86/lib/clear_page_64.S:38
    3.66% [kernel] [k] page_fault /home/git/linux/arch/x86/kernel/entry_64.S:1379
    3.25% [kernel] [k] clear_page /home/git/linux/arch/x86/lib/clear_page_64.S:40
    3.12% [kernel] [k] clear_page /home/git/linux/arch/x86/lib/clear_page_64.S:37
    2.74% [kernel] [k] clear_page /home/git/linux/arch/x86/lib/clear_page_64.S:36
    2.39% [kernel] [k] clear_page /home/git/linux/arch/x86/lib/clear_page_64.S:43
    2.12% [kernel] [k] ioread32 /home/git/linux/lib/iomap.c:90
    1.51% [kernel] [k] copy_user_generic_unrolled /home/git/linux/arch/x86/lib/copy_user_64.S:144
    1.19% [kernel] [k] copy_user_generic_unrolled /home/git/linux/arch/x86/lib/copy_user_64.S:154

    Suggested-by: Andi Kleen
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-pdmqbng9twz06jzkbgtuwbp8@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

14 Feb, 2012

1 commit

  • Allow a user to collect events for multiple threads or processes
    using a comma separated list.

    e.g., collect data on a VM and its vhost thread:
    perf top -p 21483,21485
    perf stat -p 21483,21485 -ddd
    perf record -p 21483,21485

    or monitoring vcpu threads
    perf top -t 21488,21489
    perf stat -t 21488,21489 -ddd
    perf record -t 21488,21489

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1328718772-16688-1-git-send-email-dsahern@gmail.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

25 Jan, 2012

1 commit

  • The new --uid command line option will show only the tasks for a given
    user, using the proc interface to figure out the existing tasks.

    Kernel work is needed to close races at startup, but this should already
    be useful in many use cases.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-bdnspm000gw2l984a2t53o8z@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

08 Oct, 2011

3 commits

  • And add the annotation output knobs to all the tools that have
    integrated annotation (top, report).

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-gnlob67mke6sji2kf4nstp7m@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Just like in 'perf report', but live.

    Still needs to decay the callchains, but already somewhat useful as-is.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-cj3rmaf5jpsvi3v0tf7t4uvp@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • This actually fixes several problems we had in the old 'perf top':

    1. Unresolved symbols not show, limitation that came from the old
    "KernelTop" codebase, to solve it we would need to do changes
    that would make sym_entry have most of the hist_entry fields.
    2. It was using the number of samples, not the sum of sample->period.

    And brings the --sort code that allows us to have all the views in
    'perf report', for instance:

    [root@emilia ~]# perf top --sort dso
    PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
    ------------------------------------------------------------------------------

    31.59% libcrypto.so.1.0.0
    21.55% [kernel]
    18.57% libpython2.6.so.1.0
    7.04% libc-2.12.so
    6.99% _backend_agg.so
    4.72% sshd
    1.48% multiarray.so
    1.39% libfreetype.so.6.3.22
    1.37% perf
    0.71% libgobject-2.0.so.0.2200.5
    0.53% [tg3]
    0.48% libglib-2.0.so.0.2200.5
    0.44% libstdc++.so.6.0.13
    0.40% libcairo.so.2.10800.8
    0.38% libm-2.12.so
    0.34% umath.so
    0.30% libgdk-x11-2.0.so.0.1800.9
    0.22% libpthread-2.12.so
    0.20% libgtk-x11-2.0.so.0.1800.9
    0.20% librt-2.12.so
    0.15% _path.so
    0.13% libpango-1.0.so.0.2800.1
    0.11% libatlas.so.3.0
    0.09% ft2font.so
    0.09% libpangoft2-1.0.so.0.2800.1
    0.08% libX11.so.6.3.0
    0.07% [vdso]
    0.06% cyclictest
    ^C

    All the filter lists can be used as well: --dsos, --comms, --symbols,
    etc.

    The 'perf report' TUI is also reused, being possible to apply all the
    zoom operations, do annotation, etc.

    This change will allow multiple simplifications in the symbol system as
    well, that will be detailed in upcoming changesets.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

02 Dec, 2010

1 commit


05 Jun, 2010

1 commit

  • This patch adds a -C option to stat, record, top to designate a list of CPUs to
    monitor. CPUs can be specified as a comma-separated list or ranges, no space
    allowed.

    Examples:
    $ perf record -a -C0-1,4-7 sleep 1
    $ perf top -C0-4
    $ perf stat -a -C1,2,3,4 sleep 1

    With perf record in per-thread mode with inherit mode on, samples are collected
    only when the thread runs on the designated CPUs.

    The -C option does not turn on system-wide mode automatically.

    Cc: David S. Miller
    Cc: Frédéric Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Stephane Eranian
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     

04 Feb, 2010

1 commit

  • By relying on logic in dso__load_kernel_sym(), we can
    automatically load vmlinux.

    The only thing which needs to be adjusted, is how --sym-annotate
    option is handled - now we can't rely on vmlinux been loaded
    until full successful pass of dso__load_vmlinux(), but that's
    not the case if we'll do sym_filter_entry setup in
    symbol_filter().

    So move this step right after event__process_sample() where we
    know the whole dso__load_kernel_sym() pass is done.

    By the way, though conceptually similar `perf top` still can't
    annotate userspace - see next patches with fixes.

    Signed-off-by: Kirill Smelkov
    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Mike Galbraith
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Kirill Smelkov
     

09 Aug, 2009

1 commit


07 Jun, 2009

1 commit