1. 02 2月, 2016 2 次提交
  2. 30 1月, 2016 6 次提交
    • H
      perf kvm/powerpc: Port perf kvm stat to powerpc · 066d3593
      Hemant Kumar 提交于
      perf kvm can be used to analyze guest exit reasons. This support already
      exists in x86. Hence, porting it to powerpc.
      
       - To trace KVM events :
        perf kvm stat record
        If many guests are running, we can track for a specific guest by using
        --pid as in : perf kvm stat record --pid <pid>
      
       - To see the results :
        perf kvm stat report
      
      The result shows the number of exits (from the guest context to
      host/hypervisor context) grouped by their respective exit reasons with
      their frequency.
      
      Since, different powerpc machines have different KVM tracepoints, this
      patch discovers the available tracepoints dynamically and accordingly
      looks for them. If any single tracepoint is not present, this support
      won't be enabled for reporting. To record, this will fail if any of the
      events we are looking to record isn't available.  Right now, its only
      supported on PowerPC Book3S_HV architectures.
      
      To analyze the different exits, group them and present them (in a slight
      descriptive way) to the user, we need a mapping between the "exit code"
      (dumped in the kvm_guest_exit tracepoint data) and to its related
      Interrupt vector description (exit reason). This patch adds this mapping
      in book3s_hv_exits.h.
      
      It records on two available KVM tracepoints for book3s_hv:
      
      "kvm_hv:kvm_guest_exit" and "kvm_hv:kvm_guest_enter".
      
      Here is a sample o/p:
       # pgrep qemu
      19378
      60515
      
      2 Guests are running on the host.
      
       # perf kvm stat record -a
      ^C[ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 4.153 MB perf.data.guest (39624
      samples) ]
      
       # perf kvm stat report -p 60515
      
      Analyze events for pid(s) 60515, all VCPUs:
      
           VM-EXIT Samples Samples% Time% MinTime    MaxTime  Avg time
      
             SYSCALL  9141  63.67%  7.49% 1.26us   5782.39us    9.87us (+- 6.46%)
      H_DATA_STORAGE  4114  28.66%  5.07% 1.72us   4597.68us   14.84us (+-20.06%)
      HV_DECREMENTER   418   2.91%  4.26% 0.70us  30002.22us  122.58us (+-70.29%)
            EXTERNAL   392   2.73%  0.06% 0.64us    104.10us    1.94us (+-18.83%)
      RETURN_TO_HOST   287   2.00% 83.11% 1.53us 124240.15us 3486.52us (+-16.81%)
      H_INST_STORAGE     5   0.03%  0.00% 1.88us      3.73us    2.39us (+-14.20%)
      
      Total Samples:14357, Total events handled time:1203918.42us.
      Signed-off-by: NHemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Scott  Wood <scottwood@freescale.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: http://lkml.kernel.org/r/1453962787-15376-3-git-send-email-hemant@linux.vnet.ibm.comSigned-off-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      066d3593
    • H
      perf kvm/{x86,s390}: Remove const from kvm_events_tp · 48deaa74
      Hemant Kumar 提交于
      This patch removes the "const" qualifier from kvm_events_tp declaration
      to account for the fact that some architectures may need to update this
      variable dynamically. For instance, powerpc will need to update this
      variable dynamically depending on the machine type.
      Signed-off-by: NHemant Kumar <hemant@linux.vnet.ibm.com>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Scott  Wood <scottwood@freescale.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: http://lkml.kernel.org/r/1453962787-15376-2-git-send-email-hemant@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      48deaa74
    • H
      perf kvm/{x86,s390}: Remove dependency on uapi/kvm_perf.h · 162607ea
      Hemant Kumar 提交于
      Its better to remove the dependency on uapi/kvm_perf.h to allow dynamic
      discovery of kvm events (if its needed). To do this, some extern
      variables have been introduced with which we can keep the generic
      functions generic.
      Signed-off-by: NHemant Kumar <hemant@linux.vnet.ibm.com>
      Acked-by: NAlexander Yarygin <yarygin@linux.vnet.ibm.com>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Scott  Wood <scottwood@freescale.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: http://lkml.kernel.org/r/1453962787-15376-1-git-send-email-hemant@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      162607ea
    • W
      perf tools: Move timestamp creation to util · 37b20151
      Wang Nan 提交于
      Timestamp generation becomes a public available helper. Which will
      be used by 'perf record', help it output to split output file based
      on time.
      
      For example:
      
       perf.data.2015122620363710
       perf.data.2015122620364092
       perf.data.2015122620365423
       ...
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1453715801-7732-27-git-send-email-wangnan0@huawei.comSigned-off-by: NHe Kuang <hekuang@huawei.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      37b20151
    • W
      perf buildid: Fix cpumode of buildid event · fd786fac
      Wang Nan 提交于
      There is a nasty confusion that, for kernel module, dso->kernel is not
      necessary to be DSO_TYPE_KERNEL or DSO_TYPE_GUEST_KERNEL.  These two
      enums are for vmlinux. See thread [1]. We tried to fix this part but it
      is costy.
      
      Code machine__write_buildid_table() is another unfortunate function fall
      into this trap that, when issuing buildid event for a kernel module,
      cpumode it gives to the event is PERF_RECORD_MISC_USER, not
      PERF_RECORD_MISC_KERNEL.
      
      However, even with this bug, most of the time it doesn't causes real
      problem. I find this issue when trying to use a perf before commit
      3d39ac53 ("perf machine: No need to have two DSOs lists") to parse a
      perf.data generated by newest perf.
      
      [1] https://lkml.org/lkml/2015/9/21/908Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1454089251-203152-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fd786fac
    • M
      perf auxtrace: Add perf_evlist pointer to *info_priv_size() · 14a05e13
      Mathieu Poirier 提交于
      On some architecture the size of the private header may be dependent on
      the number of tracers used in the session.  As such adding a "struct
      perf_evlist *" parameter, which should contain all the required
      information.
      
      Also adjusting the existing client of the interface to take the new
      parameter into account.
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Al Grant <al.grant@arm.com>
      Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-doc@vger.kernel.org
      Cc: Mike Leach <mike.leach@arm.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Rabin Vincent <rabin@rab.in>
      Cc: Tor Jeremiassen <tor@ti.com>
      Link: http://lkml.kernel.org/r/1452807977-8069-22-git-send-email-mathieu.poirier@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      14a05e13
  3. 27 1月, 2016 1 次提交
  4. 26 1月, 2016 11 次提交
  5. 16 1月, 2016 2 次提交
    • B
      perf symbols: Fix reading of build-id from vDSO · 40c4a0f9
      Ben Hutchings 提交于
      We need to use the long name (the filename) when reading the build-id
      from a DSO.  Using the short name doesn't work for (at least) vDSOs.
      Signed-off-by: NBen Hutchings <ben@decadent.org.uk>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20160113172301.GT28542@decadent.org.ukSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      40c4a0f9
    • R
      perf kvm record/report: 'unprocessable sample' error while recording/reporting guest data · 3caeaa56
      Ravi Bangoria 提交于
      While recording guest samples in host using perf kvm record, it will
      populate unprocessable sample error, though samples will be recorded
      properly. While generating report using perf kvm report, no samples will
      be processed and same error will populate. We have seen this behaviour
      with upstream perf(4.4-rc3) on x86 and ppc64 hardware.
      
      Reason behind this failure is, when it tries to fetch machine from
      rb_tree of machines, it fails. As a part of tracing a bug, we figured
      out that this code was incorrectly refactored in commit 54245fdc
      ("perf session: Remove wrappers to machines__find").
      
      This patch will change the functionality such that if it can't fetch
      machine in first trial, it will create one node of machine and add that to
      rb_tree. So next time when it tries to fetch same machine from rb_tree,
      it won't fail. Actually it was the case before refactoring of code in
      aforementioned commit.
      
      This patch is generated from acme perf/core branch.
      
      Below I've mention an example that demonstrate the behaviour before and
      after applying patch.
      
      Before applying patch:
      [Note: One needs to run guest before recording data in host]
      
        ravi@ravi-bangoria:~$ ./perf kvm record -a
        Warning:
        5903 unprocessable samples recorded.
        Do you have a KVM guest running and not using 'perf kvm'?
        [ perf record: Captured and wrote 1.409 MB perf.data.guest (285 samples) ]
      
        ravi@ravi-bangoria:~$ ./perf kvm report --stdio
        Warning:
        5903 unprocessable samples recorded.
        Do you have a KVM guest running and not using 'perf kvm'?
        # To display the perf.data header info, please use --header/--header-only options.
        #
        # Total Lost Samples: 0
        #
        # Samples: 285  of event 'cycles'
        # Event count (approx.): 88715406
        #
        # Overhead  Command  Shared Object  Symbol
        # ........  .......  .............  ......
        #
      
        # (For a higher level overview, try: perf report --sort comm,dso)
        #
      
      After applying patch:
      
        ravi@ravi-bangoria:~$ ./perf kvm record -a
        [ perf record: Captured and wrote 1.188 MB perf.data.guest (17 samples) ]
      
        ravi@ravi-bangoria:~$ ./perf kvm report --stdio
        # To display the perf.data header info, please use --header/--header-only options.
        #
        # Total Lost Samples: 0
        #
        # Samples: 17  of event 'cycles'
        # Event count (approx.): 700746
        #
        # Overhead  Command  Shared Object     Symbol
        # ........  .......  ................  ......................
        #
            34.19%  :5758    [unknown]         [g] 0xffffffff818682ab
            22.79%  :5758    [unknown]         [g] 0xffffffff812dc7f8
            22.79%  :5758    [unknown]         [g] 0xffffffff818650d0
            14.83%  :5758    [unknown]         [g] 0xffffffff8161a1b6
             2.49%  :5758    [unknown]         [g] 0xffffffff818692bf
             0.48%  :5758    [unknown]         [g] 0xffffffff81869253
             0.05%  :5758    [unknown]         [g] 0xffffffff81869250
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org # v3.19+
      Fixes: 54245fdc ("perf session: Remove wrappers to machines__find")
      Link: http://lkml.kernel.org/r/1449471302-11283-1-git-send-email-ravi.bangoria@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3caeaa56
  6. 12 1月, 2016 3 次提交
  7. 09 1月, 2016 7 次提交
  8. 08 1月, 2016 8 次提交