1. 02 9月, 2015 2 次提交
  2. 01 9月, 2015 7 次提交
  3. 29 8月, 2015 8 次提交
  4. 28 8月, 2015 2 次提交
  5. 26 8月, 2015 6 次提交
  6. 25 8月, 2015 13 次提交
    • A
      perf tools: Update Intel PT documentation · 9d1bf02a
      Adrian Hunter 提交于
      Update Intel PT documentation to describe new features.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1437150840-31811-26-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9d1bf02a
    • A
      perf tools: Add Intel PT support for decoding TRACESTOP packets · 7eacca3e
      Adrian Hunter 提交于
      A TRACESTOP packet is produced when an Intel PT trace enters a defined
      region of the address space at which point the tracing stops.
      
      This patch just adds decoder support.
      
      Support for specifying TRACESTOP regions is left until later.
      
      For details refer to the June 2015 or later Intel 64 and IA-32
      Architectures SDM Chapter 36 Intel Processor Trace.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1437150840-31811-25-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7eacca3e
    • A
      perf tools: Add Intel PT support for using CYC packets · 0de802ab
      Adrian Hunter 提交于
      CYC packets are a new Intel PT feature.
      
      CYC packets provide even finer grain timestamp information than MTC and
      TSC packets.  A CYC packet contains the number of CPU cycles since the
      last CYC packet. Unlike MTC and TSC packets, CYC packets are only sent
      when another packet is also sent.
      
      Support for this feature is indicated by:
      
      /sys/bus/event_source/devices/intel_pt/caps/psb_cyc
      
      which contains "1" if the feature is supported and "0" otherwise.
      
      CYC packets can be requested using a PMU config term e.g. perf record -e
      intel_pt/cyc/u sleep 1
      
      The frequency of CYC packets can also be specified.  e.g. perf record -e
      intel_pt/cyc,cyc_thresh=2/u sleep 1
      
      CYC packets are not requested by default.
      
      Valid cyc_thresh values are given by:
      
      /sys/bus/event_source/devices/intel_pt/caps/cycle_thresholds
      
      which contains a hexadecimal value, the bits of which represent valid
      values e.g. bit 2 set means value 2 is valid.
      
      The value represents the minimum number of CPU cycles that must have
      passed before a CYC packet can be sent.  The number of CPU cycles is:
      
          2 ^ (value - 1)
      
      e.g. value 4 means 8 CPU cycles must pass before a CYC packet can be
      sent.  Note a CYC packet is still only sent when another packet is sent,
      not at, e.g. every 8 CPU cycles.
      
      If an invalid value is entered, the error message will give a list of
      valid values e.g.
      
          $ perf record -e intel_pt/cyc,cyc_thresh=15/u uname
          Invalid cyc_thresh for intel_pt. Valid values are: 0-12
      
      tools/perf/Documentation/intel-pt.txt is updated in a later patch as
      there are a number of new features being added.
      
      For more information refer to the June 2015 or later Intel 64 and IA-32
      Architectures SDM Chapter 36 Intel Processor Trace.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1437150840-31811-24-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0de802ab
    • A
      perf tools: Add Intel PT support for decoding CYC packets · cc336186
      Adrian Hunter 提交于
      CYC packets provide even finer grain timestamp information than MTC and
      TSC packets.  A CYC packet contains the number of CPU cycles since the
      last CYC packet.
      
      This patch just adds decoder support.  The CPU frequency can be related
      to TSC using the Maximum Non-Turbo Ratio in combination with the CBR
      (core-to-bus ratio) packet.  However more accuracy is achieved by simply
      interpolating the number of cycles between other timing packets like MTC
      or TSC.  This patch takes the latter approach.
      
      Support for a default value and validation of values is provided by a
      later patch. Also documentation is updated in a separate patch.
      
      For details refer to the June 2015 or later Intel 64 and IA-32
      Architectures SDM Chapter 36 Intel Processor Trace.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1437150840-31811-23-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cc336186
    • A
      perf tools: Add Intel PT support for using MTC packets · b45fc0bf
      Adrian Hunter 提交于
      MTC packets are a new Intel PT feature.
      
      MTC packets provide finer grain timestamp information than TSC packets.
      
      Support for this feature is indicated by:
      
        /sys/bus/event_source/devices/intel_pt/caps/mtc
      
      which contains "1" if the feature is supported and "0" otherwise.
      
      MTC packets can be requested using a PMU config term e.g. perf record -e
      intel_pt/mtc/u sleep 1
      
      The frequency of MTC packets can also be specified.  e.g. perf record -e
      intel_pt/mtc,mtc_period=2/u sleep 1
      
      The default value is 3 or the nearest lower value that is supported.  0
      is always supported.
      
      Valid values are given by:
      
      /sys/bus/event_source/devices/intel_pt/caps/mtc_periods
      
      which contains a hexadecimal value, the bits of which represent valid
      values e.g. bit 2 set means value 2 is valid.
      
      The value is converted to the MTC frequency as:
      
      	CTC-frequency / (2 ^ value)
      
      e.g. value 3 means one eighth of CTC-frequency
      
      Where CTC is the hardware crystal clock, the frequency of which can be
      related to TSC via values provided in cpuid leaf 0x15.
      
      If an invalid value is entered, the error message will give a list of
      valid values e.g.
      
      	$ perf record -e intel_pt/mtc_period=15/u uname
      	Invalid mtc_period for intel_pt. Valid values are: 0,3,6,9
      
      tools/perf/Documentation/intel-pt.txt is updated in a later patch as
      there are a number of new features being added.
      
      For more information refer to the June 2015 or later Intel 64 and IA-32
      Architectures SDM Chapter 36 Intel Processor Trace.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1437150840-31811-22-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b45fc0bf
    • A
      perf tools: Add Intel PT support for decoding MTC packets · 79b58424
      Adrian Hunter 提交于
      MTC packets provide finer grain timestamp information than TSC packets.
      MTC packets record time using the hardware crystal clock (CTC) which is
      related to TSC packets using a TMA packet.
      
      This patch just adds decoder support.
      
      Support for a default value and validation of values is provided by a
      later patch. Also documentation is updated in a separate patch.
      
      For details refer to the June 2015 or later Intel 64 and IA-32
      Architectures SDM Chapter 36 Intel Processor Trace.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1437150840-31811-21-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      79b58424
    • A
      perf tools: Pass Intel PT information for decoding MTC and CYC · 11fa7cb8
      Adrian Hunter 提交于
      Record additional information in the AUXTRACE_INFO event in preparation
      for decoding MTC and CYC packets.  Pass the information to the decoder.
      
      The AUXTRACE_INFO record can be extended by using the size to indicate
      the presence of new members.
      
      The additional information includes PMU config bit positions and the TSC
      to CTC (hardware crystal clock) ratio needed to decode MTC packets.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1437150840-31811-20-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      11fa7cb8
    • A
      perf tools: Add new Intel PT packet definitions · 3d498078
      Adrian Hunter 提交于
      New features have been added to Intel PT which include a number of new
      packet definitions.
      
      This patch adds packet definitions for new packets: TMA, MTC, CYC, VMCS,
      TRACESTOP and MNT.  Also another bit in PIP is defined.
      
      This patch only adds support for the definitions. Later patches add
      support for decoding TMA, MTC, CYC and TRACESTOP which is where those
      packets are explained.
      
      VMCS and the newly defined bit in PIP are used with virtualization which
      is not supported yet.  MNT is a maintenance packet which the decoder
      should ignore.
      
      For details, refer to the June 2015 or later Intel 64 and IA-32
      Architectures SDM Chapter 36 Intel Processor Trace.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1437150840-31811-19-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3d498078
    • A
      perf tools: Add Intel PT support for PSB periods · bc9b6bf0
      Adrian Hunter 提交于
      The PSB packet is a synchronization packet that provides a starting
      point for decoding or recovery from errors.
      
      This patch adds support for a new Intel PT feature that allows the
      frequency of PSB packets to be specified.
      
      Support for this feature is indicated by
      /sys/bus/event_source/devices/intel_pt/caps/psb_cyc which contains "1"
      if the feature is supported and "0" otherwise.
      
      The PSB period can be specified as a PMU config term e.g. perf record -e
      intel_pt/psb_period=2/u sleep 1
      
      The default value is 3 or the nearest lower value that is supported.  0
      is always supported.
      
      Valid values are given by:
      
      /sys/bus/event_source/devices/intel_pt/caps/psb_periods
      
      which contains a hexadecimal value, the bits of which represent valid
      values e.g. bit 2 set means value 2 is valid.
      
      The value is converted to the approximate number of trace bytes between
      PSB packets as:
      
      	2 ^ (value + 11)
      
      e.g. value 3 means 16KiB bytes between PSBs
      
      If an invalid value is entered, the error message will give a list of
      valid values e.g.
      
      	$ perf record -e intel_pt/psb_period=15/u uname
      	Invalid psb_period for intel_pt. Valid values are: 0-5
      
      tools/perf/Documentation/intel-pt.txt is updated in a later patch as
      there are a number of new features being added.
      
      For more information about PSB periods refer to the Intel 64 and IA-32
      Architectures SDM Chapter 36 Intel Processor Trace from June 2015 or
      later.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1437150840-31811-18-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bc9b6bf0
    • A
      perf tools: Fix Intel PT 'instructions' sample period · 2a21d036
      Adrian Hunter 提交于
      The period on synthesized 'instructions' samples was being set to a
      fixed value, whereas the correct value is the number of instructions
      since the last sample, which is a value that the decoder can provide.
      So do it that way.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1437150840-31811-14-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2a21d036
    • A
      perf ordered_events: Clear the progress bar at the end of a flush · 5c9ce1e6
      Arnaldo Carvalho de Melo 提交于
      We were depending on the next screen operation after a flush() being
      one that would redraw the whole screen so that the progress bar would
      be overwritten, when that didn't happen a screen artifact of, say, a
      error dialog window would be overlaid on top of the progress bar, fix
      it by calling ui_browser__finish(), that now has a TUI implementation.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-el0fyw6duemnx62lydjzhs8c@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5c9ce1e6
    • A
      perf ui tui progress: Implement the ui_progress_ops->finish() method · 1e259ad4
      Arnaldo Carvalho de Melo 提交于
      So that we can erase the progress bar after we're done with it, avoiding
      things like:
      
      -------------------------------------------------------------------
      
                ┌─Error:──────────────────────────────────────────────────────┐
                │Can't annotate unmapped_area_topdown:                        │
                │                                                             │
                │No vmlinux file with build id a826726b5ddacfab1f0bade868f1a79│
                │was found in the path.                                       │
                │                                                             │
                │Note that annotation using /proc/kcore requires CAP_SYS_RAWIO│
      ┌Processin│                                                             │──┐
      │         │Please use:                                                  │  │
      └─────────│                                                             │──┘
                │  perf buildid-cache -vu vmlinux                             │
                │                                                             │
                │or:                                                          │
                │                                                             │
                │  --vmlinux vmlinux                                          │
                │                                                             │
                │                                                             │
                │Press any key...                                             │
                └─────────────────────────────────────────────────────────────┘
      
      Can't annotate unmapped_area_topdown:
      -------------------------------------------------------------------
      
      I.e. that finished progress bar behind the error window. It is not a
      problem when we end up redrawing the whole screen, but its ugly when
      we present such error windows, provide a TUI method so that code like
      the above may avoid this situation, as will be done with the annotation
      code in the next cset.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-qvktnojzwwe37pweging058t@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1e259ad4
    • A
      perf annotate: Reset the dso find_symbol cache when removing symbols · c0b4dffb
      Arnaldo Carvalho de Melo 提交于
      The 'annotate' tool does some filtering in the entries in a DSO but
      forgot to reset the cache done in dso__find_symbol(), cauxing a SEGV:
      
        [root@zoo ~]# perf annotate netlink_poll
        perf: Segmentation fault
        -------- backtrace --------
        perf[0x526ceb]
        /lib64/libc.so.6(+0x34960)[0x7faedfbe0960]
        perf(rb_erase+0x223)[0x499d63]
        perf[0x4213e9]
        perf[0x4bc123]
        perf[0x4bc621]
        perf[0x4bf26b]
        perf[0x4bc855]
        perf(perf_session__process_events+0x340)[0x4bddc0]
        perf(cmd_annotate+0x6bb)[0x421b5b]
        perf[0x479063]
        perf(main+0x60a)[0x42098a]
        /lib64/libc.so.6(__libc_start_main+0xf0)[0x7faedfbcbfe0]
        perf[0x420aa9]
        [0x0]
        [root@zoo ~]#
      
      Fix it by reseting the find cache when removing symbols.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Fixes: b685ac22 ("perf symbols: Add front end cache for DSO symbol lookup")
      Link: http://lkml.kernel.org/n/tip-b2y9x46y0t8yem1ive41zqyp@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c0b4dffb
  7. 22 8月, 2015 1 次提交
  8. 21 8月, 2015 1 次提交
    • W
      perf probe: Try to use symbol table if searching debug info failed · 1c0bd0e8
      Wang Nan 提交于
      A problem can occur in a statically linked perf when vmlinux can be found:
      
       # perf probe --add sys_epoll_pwait
       probe-definition(0): sys_epoll_pwait
       symbol:sys_epoll_pwait file:(null) line:0 offset:0 return:0 lazy:(null)
       0 arguments
       Looking at the vmlinux_path (7 entries long)
       Using /lib/modules/4.2.0-rc1+/build/vmlinux for symbols
       Open Debuginfo file: /lib/modules/4.2.0-rc1+/build/vmlinux
       Try to find probe point from debuginfo.
       Symbol sys_epoll_pwait address found : ffffffff8122bd40
       Matched function: SyS_epoll_pwait
       Failed to get call frame on 0xffffffff8122bd40
       An error occurred in debuginfo analysis (-2).
         Error: Failed to add events. Reason: No such file or directory (Code: -2)
      
      The reason is caused by libdw that, if libdw is statically linked, it
      can't load libebl_{arch}.so reliable.
      
      In this case it is still possible to get the address from
      /proc/kalksyms.  However, perf tries that only when libdw returns
      -EBADF.
      
      This patch gives it another chance to utilize symbol table, even if
      libdw returns an error code other than -EBADF.
      
      After applying this patch:
      
       # perf probe -nv --add sys_epoll_pwait
       probe-definition(0): sys_epoll_pwait
       symbol:sys_epoll_pwait file:(null) line:0 offset:0 return:0 lazy:(null)
       0 arguments
       Looking at the vmlinux_path (7 entries long)
       Using /lib/modules/4.2.0-rc1+/build/vmlinux for symbols
       Open Debuginfo file: /lib/modules/4.2.0-rc1+/build/vmlinux
       Try to find probe point from debuginfo.
       Symbol sys_epoll_pwait address found : ffffffff8122bd40
       Matched function: SyS_epoll_pwait
       Failed to get call frame on 0xffffffff8122bd40
       An error occurred in debuginfo analysis (-2).
       Trying to use symbols.
       Opening /sys/kernel/debug/tracing/kprobe_events write=1
       Added new event:
       Writing event: p:probe/sys_epoll_pwait _text+2276672
         probe:sys_epoll_pwait (on sys_epoll_pwait)
      
       You can now use it in all perf tools, such as:
      
       	perf record -e probe:sys_epoll_pwait -aR sleep 1
      
      Although libdw returns an error (Failed to get call frame), perf tries
      symbol table and finally gets correct address.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1440151770-129878-2-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1c0bd0e8