1. 19 2月, 2015 1 次提交
    • K
      perf tools: Enable LBR call stack support · aad2b21c
      Kan Liang 提交于
      Currently, there are two call chain recording options, fp and dwarf.
      
      Haswell has a new feature that utilizes the existing LBR facility to
      record call chains. Kernel side LBR support code provides this as a
      third option to record call chains. This patch enables the lbr call
      stack support on the tooling side.
      
      LBR call stack has some limitations:
      
       - It reuses current LBR facility, so LBR call stack and branch record
         can not be enabled at the same time.
      
       - It is only available for user-space callchains.
      
      However, it also offers some advantages:
      
       - LBR call stack can work on user apps which don't have frame-pointers
         or dwarf debug info compiled. It is a good alternative when nothing
         else works.
      Tested-by: NJiri Olsa <jolsa@kernel.org>
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Jacob Shin <jacob.w.shin@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Masanari Iida <standby24x7@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Rodrigo Campos <rodrigo@sdfg.com.ar>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/1420482185-29830-2-git-send-email-kan.liang@intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      aad2b21c
  2. 30 1月, 2015 1 次提交
    • N
      perf evsel: Set attr.task bit for a tracking event · 62e503b7
      Namhyung Kim 提交于
      The perf_event_attr.task bit is to track task (fork and exit) events but
      it missed to be set by perf_evsel__config().  While it was not a problem
      in practice since setting other bits (comm/mmap) ended up being in same
      result, it'd be good to set it explicitly anyway.
      
      The attr->task is to track task related events (fork/exit) only but
      other meta events like comm and mmap[2] also needs the task events.  So
      setting attr->comm and/or attr->mmap causes the kernel emits the task
      events anyway.  So the attr->task is only meaningful when other bits are
      off but I'd like to set it for completeness.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1422518843-25818-6-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      62e503b7
  3. 28 1月, 2015 1 次提交
    • V
      perf evsel: Don't rely on malloc working for sz 0 · 8d9cbd8f
      Vineet Gupta 提交于
      When running perf on ARC (uClibc based userspace), ran into this issue
         ------------->8----------------
      	[ARCLinux]$ ./perf record ls
      	bin             etc             perf            sys
      	debug           init            perf.data       tmp
      	[ perf record: Woken up 1 times to write data ]
      	[ perf record: Captured and wrote 0.001 MB perf.data (~24 samples) ]
      
      	[ARCLinux]$ ./perf report
      	incompatible file format (rerun with -v to learn more)
         ------------->8----------------
      
      The problem happens in the following call stack when zalloc is called
      with size zero
      
      glibc default / uClibc with MALLOC_GLIBC_COMPAT are OK, but not if that
      config option is not enabled.
      
        cmd_report
           perf_session__new
      	perf_session__open
      	    perf_session__read_header
      		read_attr(fd, header, &f_attr)
      		nr_ids = f_attr.ids.size / sizeof(u64); <-- 0
      		perf_evsel__alloc_id(vsel, 1, nr_ids)
      			zalloc(ncpus * nthreads * sizeof(u64)) <-- 0
      
      header.c: read_attr()
      
      (gdb) p *f_attr
      $17 = {
        attr = {
          type = 0,
          size = 96,
          config = 0,
          {
            sample_period = 4000,
            sample_freq = 4000
          },
      ...
        ids = {
          offset = 104,
          size = 0      <------
        }
      }
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      Suggested-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1421156604-30603-5-git-send-email-vgupta@synopsys.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8d9cbd8f
  4. 02 12月, 2014 1 次提交
  5. 25 11月, 2014 3 次提交
  6. 19 11月, 2014 1 次提交
  7. 16 11月, 2014 1 次提交
  8. 07 11月, 2014 1 次提交
  9. 17 10月, 2014 2 次提交
  10. 15 10月, 2014 4 次提交
    • A
      perf evsel: Make some exit routines static · 8885846f
      Arnaldo Carvalho de Melo 提交于
      Since they are automatically called by other methods used by tools.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-ne3g4any7q6ty5d6yv8t1wws@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8885846f
    • A
      perf tools: Remove hists from evsel · a635fc51
      Arnaldo Carvalho de Melo 提交于
      Now tools that deals want to have an hists per evsel need to call
      hists__init() before creating any evsels, which can be as early as when
      parsing the command line, so do it before calling parse_options().
      
      The current tools using hists/hist_entries are report, top and annotate,
      change them to request per evsel hists.
      
      This is in preparation for making evsels usable by 3rd party tools, that
      not necessarily live in perf's source code repository.
      Acked-by: NBorislav Petkov <bp@suse.de>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-usjx2la743f10ippj7p1b20x@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a635fc51
    • A
      perf callchain: Move the callchain_param extern to callchain.h · 8f651eae
      Arnaldo Carvalho de Melo 提交于
      It was lost in hist.h, move it to where it belongs, callchain.h, as
      there are places that gets hist.h by means of evsel.h, and since evsel.h
      is being untangled from hist.h...
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-0rg7ji1jnbm6q6gj35j37jby@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8f651eae
    • A
      perf evsel: Subclassing · ce8ccff5
      Arnaldo Carvalho de Melo 提交于
      Provide a method to be called at tool start to config the perf_evsel
      instance size, together with optional constructor and destructor.
      
      This will be used so that perf_evsel doesn't always include a struct
      hists, tools that works with hists/hist_entries, like report, top and
      annotate, will, at start, tell the evsel class the size they need per
      instance.
      
      v2: Don't use exit as a name of a member of function parameter, as this
          breaks the build on at least fedora14 and rhel6.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-7t8cay0ieryox4gqosie85ek@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ce8ccff5
  11. 26 9月, 2014 1 次提交
  12. 15 8月, 2014 1 次提交
  13. 14 8月, 2014 2 次提交
  14. 12 8月, 2014 2 次提交
    • J
      perf tools: Show better error message in case we fail to open counters due to EBUSY error · 63914aca
      Jiri Olsa 提交于
      Showing better error message in case we fail to open counters due to the
      EBUSY error. If we detect oprofile daemon process running, we now
      display following message for EBUSY error:
      
        $ perf record ls
        Error:
        The PMU counters are busy/taken by another profiler.
        We found oprofile daemon running, please stop it and try again.
      
      In case oprofiled was not detected the current error message stays:
      
        $ perf record ls
        Error:
        The sys_perf_event_open() syscall returned with 16 (Device or resource busy) for event (cycles).
        /bin/dmesg may provide additional information.
        No CONFIG_PERF_EVENTS=y kernel support configured?
      
      Also changing PERF_FLAG_FD_CLOEXEC detection code not to display error
      in case of EBUSY error, as it currently does:
      
        $ perf record ls
        Error:
        perf_event_open(..., PERF_FLAG_FD_CLOEXEC) failed with unexpected error 16 (Device or resource busy)
        perf_event_open(..., 0) failed unexpectedly with error 16 (Device or resource busy)
        The PMU counters are busy/taken by another profiler.
        We found oprofile daemon running, please stop it and try again.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Yann Droneaud <ydroneaud@opteya.com>
      Link: http://lkml.kernel.org/r/1406908014-8312-1-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      63914aca
    • A
      perf record: Honour --no-time command line option · 8affc2b8
      Andi Kleen 提交于
      Time stamps are always implicitely enabled for record currently.  The
      old --time/-T option is a nop.
      
      Allow the user to disable timestamps by using --no-time, honouring the
      existing option.
      
      The defaults are unchanged.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1406789104-25863-10-git-send-email-zheng.z.yan@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8affc2b8
  15. 18 7月, 2014 1 次提交
  16. 17 7月, 2014 3 次提交
  17. 12 6月, 2014 1 次提交
    • N
      perf record: Fix to honor user freq/interval properly · 17314e23
      Namhyung Kim 提交于
      When configuring event perf checked a wrong condition that user
      specified both of freq (-F) and period (-c) or the event has no
      default value.  This worked because most of events don't have default
      value and only tracepoint events have default of 1 (and it's not
      desirable to change it for those events).
      
      However, Andi's downloadable event patch changes the situation so it
      cannot change the value for those events.  Fix it by allowing override
      the default value if user gives one of the options.
      
        $ perf record -a -e uops_retired.all -F 4000 sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.325 MB perf.data (~14185 samples) ]
      
        $ perf evlist -F
        cpu/uops_retired.all/: sample_freq=4000
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Link: http://lkml.kernel.org/r/1402292617-26278-1-git-send-email-namhyung@kernel.orgSigned-off-by: NJiri Olsa <jolsa@kernel.org>
      17314e23
  18. 09 6月, 2014 1 次提交
  19. 19 3月, 2014 1 次提交
  20. 11 3月, 2014 1 次提交
  21. 18 2月, 2014 3 次提交
  22. 21 1月, 2014 1 次提交
  23. 15 1月, 2014 1 次提交
  24. 13 1月, 2014 1 次提交
  25. 28 12月, 2013 2 次提交
  26. 20 12月, 2013 1 次提交
  27. 17 12月, 2013 1 次提交
    • B
      tools/: Convert to new topic libraries · 553873e1
      Borislav Petkov 提交于
      Move debugfs.* to api/fs/. We have a common tools/lib/api/ place where
      the Makefile lives and then we place the headers in subdirs.
      
      For example, all the fs-related stuff goes to tools/lib/api/fs/ from
      which we get libapikfs.a (acme got almost the naming he wanted :-)) and
      we link it into the tools which need it - in this case perf and
      tools/vm/page-types.
      
      acme:
      
      "Looking at the implementation, I think some tools can even link
      directly to the .o files, avoiding the .a file altogether.
      
      But that is just an optimization/finer granularity tools/lib/
      cherrypicking that toolers can make use of."
      
      Fixup documentation cleaning target while at it.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Stanislav Fomichev <stfomichev@yandex-team.ru>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386605664-24041-2-git-send-email-bp@alien8.deSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      553873e1