21 Sep, 2012

1 commit

  • Add 'perf kvm stat' support to analyze kvm vmexit/mmio/ioport smartly

    Usage:
    - kvm stat
    run a command and gather performance counter statistics, it is the alias of
    perf stat

    - trace kvm events:
    perf kvm stat record, or, if other tracepoints are interesting as well, we
    can append the events like this:
    perf kvm stat record -e timer:* -a

    If many guests are running, we can track the specified guest by using -p or
    --pid, -a is used to track events generated by all guests.

    - show the result:
    perf kvm stat report

    The output example is following:
    13005
    13059

    total 2 guests are running on the host

    Then, track the guest whose pid is 13059:
    ^C[ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.253 MB perf.data.guest (~11065 samples) ]

    See the vmexit events:

    Analyze events for all VCPUs:

    VM-EXIT Samples Samples% Time% Avg time

    APIC_ACCESS 460 70.55% 0.01% 22.44us ( +- 1.75% )
    HLT 93 14.26% 99.98% 832077.26us ( +- 10.42% )
    EXTERNAL_INTERRUPT 64 9.82% 0.00% 35.35us ( +- 14.21% )
    PENDING_INTERRUPT 24 3.68% 0.00% 9.29us ( +- 31.39% )
    CR_ACCESS 7 1.07% 0.00% 8.12us ( +- 5.76% )
    IO_INSTRUCTION 3 0.46% 0.00% 18.00us ( +- 11.79% )
    EXCEPTION_NMI 1 0.15% 0.00% 5.83us ( +- -nan% )

    Total Samples:652, Total events handled time:77396109.80us.

    See the mmio events:

    Analyze events for all VCPUs:

    MMIO Access Samples Samples% Time% Avg time

    0xfee00380:W 387 84.31% 79.28% 8.29us ( +- 3.32% )
    0xfee00300:W 24 5.23% 9.96% 16.79us ( +- 1.97% )
    0xfee00300:R 24 5.23% 7.83% 13.20us ( +- 3.00% )
    0xfee00310:W 24 5.23% 2.93% 4.94us ( +- 3.84% )

    Total Samples:459, Total events handled time:4044.59us.

    See the ioport event:

    Analyze events for all VCPUs:

    IO Port Access Samples Samples% Time% Avg time

    0xc050:POUT 3 100.00% 100.00% 13.75us ( +- 10.83% )

    Total Samples:3, Total events handled time:41.26us.

    And, --vcpu is used to track the specified vcpu and --key is used to sort the
    result:

    Analyze events for VCPU 0:

    VM-EXIT Samples Samples% Time% Avg time

    HLT 27 13.85% 99.97% 405790.24us ( +- 12.70% )
    EXTERNAL_INTERRUPT 13 6.67% 0.00% 27.94us ( +- 22.26% )
    APIC_ACCESS 146 74.87% 0.03% 21.69us ( +- 2.91% )
    IO_INSTRUCTION 2 1.03% 0.00% 17.77us ( +- 20.56% )
    CR_ACCESS 2 1.03% 0.00% 8.55us ( +- 6.47% )
    PENDING_INTERRUPT 5 2.56% 0.00% 6.27us ( +- 3.94% )

    Total Samples:195, Total events handled time:10959950.90us.

    Signed-off-by: Dong Hao
    Signed-off-by: Runzhen Wang
    [ Dong Hao
    Runzhen Wang :
    - rebase it on current acme's tree
    - fix the compiling-error on i386 ]
    Signed-off-by: Xiao Guangrong
    Acked-by: David Ahern
    Cc: Avi Kivity
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Marcelo Tosatti
    Cc: kvm@vger.kernel.org
    Cc: Runzhen Wang
    Link: http://lkml.kernel.org/r/1347870675-31495-4-git-send-email-haodong@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Xiao Guangrong
     

11 Sep, 2012

1 commit


31 May, 2012

1 commit

  • The patch series that introduced the top level tools/ makefile and the
    libtraceevent broke this feature where files needed to build in a
    detached tarball were not included in the MANIFEST file and thus not
    included in the tarball.

    Fix it by adding the relevant files to the MANIFEST.

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

    Arnaldo Carvalho de Melo
     

14 Feb, 2012

1 commit

  • For latest tip/perf/core tree Compiles are failing on:

    GEN common-cmds.h
    make: *** No rule to make target `../../arch/x86/lib/memset_64.S', needed by `builtin-annotate.o'. Stop.

    Resolve by adding memset.* to the tar file.

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

    David Ahern
     

07 Jan, 2012

1 commit


01 Dec, 2010

1 commit

  • There seems to be a new dependency on arch/*/lib/memcpy*.S when compiling
    the perf tool. Make sure that file is included in the MANIFEST when
    creating the tarball.

    Cc: Ingo Molnar
    LKML-Reference:
    Signed-off-by: Don Zickus
    Signed-off-by: Arnaldo Carvalho de Melo

    Don Zickus
     

05 Jun, 2010

1 commit

  • Useful for when people want to try some version of the perf tools and don't
    wants to download the kernel tarball.

    Here is a session using this new target:

    [root@emilia linux-2.6-tip]# make help | grep -i perf
    perf-tar-src-pkg - Build perf-2.6.35-rc1.tar source tarball
    perf-targz-src-pkg - Build perf-2.6.35-rc1.tar.gz source tarball
    perf-tarbz2-src-pkg - Build perf-2.6.35-rc1.tar.bz2 source tarball
    [root@emilia linux-2.6-tip]# make perf-tarbz2-src-pkg
    TAR
    [root@emilia linux-2.6-tip]# ls -la perf-2.6.35-rc1.tar.bz2
    -rw-r--r-- 1 root root 295731 May 31 11:18 perf-2.6.35-rc1.tar.bz2
    [root@emilia linux-2.6-tip]# tar xf perf-2.6.35-rc1.tar.bz2
    [root@emilia linux-2.6-tip]# cd perf-2.6.35-rc1
    [root@emilia perf-2.6.35-rc1]# ls
    arch HEAD include lib tools
    [root@emilia perf-2.6.35-rc1]# cd tools/perf
    [root@emilia perf]# make -j9 2>&1 | tail
    CC arch/x86/util/dwarf-regs.o
    CC util/probe-finder.o
    CC util/newt.o
    CC util/scripting-engines/trace-event-perl.o
    CC scripts/perl/Perf-Trace-Util/Context.o
    CC perf.o
    CC builtin-help.o
    AR libperf.a
    LINK perf
    rm .perf.dev.null
    [root@emilia perf]# ./perf record -a sleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.262 MB perf.data (~11457 samples) ]
    [root@emilia perf]# ./perf report | head -12
    # Events: 6K cycles
    #
    # Overhead Command Shared Object Symbol
    # ........ ............... .................. ......
    #
    4.73% perf [kernel.kallsyms] [k] format_decode
    4.49% perf libc-2.12.so [.] _IO_file_underflow_internal
    4.38% init [kernel.kallsyms] [k] mwait_idle
    3.29% perf [kernel.kallsyms] [k] vsnprintf
    2.38% init [kernel.kallsyms] [k] sched_clock_local
    2.35% init [kernel.kallsyms] [k] apic_timer_interrupt
    1.86% sirq-timer/5 [kernel.kallsyms] [k] find_busiest_group
    [root@emilia perf]#

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

    Arnaldo Carvalho de Melo