1. 05 12月, 2013 1 次提交
  2. 28 11月, 2013 4 次提交
  3. 04 11月, 2013 2 次提交
    • A
      perf script: Set up output options for in-stream attributes · 7ea95727
      Adrian Hunter 提交于
      Attributes (struct perf_event_attr) are recorded separately in the
      perf.data file.  perf script uses them to set up output options.
      However attributes can also be in the event stream, for example when the
      input is a pipe (i.e. live mode).  This patch makes perf script process
      in-stream attributes in the same way as on-file attributes.
      
      Here is an example:
      
      Before this patch:
      
      $ perf record uname | perf script
      Linux
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.015 MB (null) (~655 samples) ]
      :4220  4220 [-01] 2933367.838906: cycles:
      
      :4220  4220 [-01] 2933367.838910: cycles:
      
      :4220  4220 [-01] 2933367.838912: cycles:
      
      :4220  4220 [-01] 2933367.838914: cycles:
      
      :4220  4220 [-01] 2933367.838916: cycles:
      
      :4220  4220 [-01] 2933367.838918: cycles:
      
      uname  4220 [-01] 2933367.838938: cycles:
      
      uname  4220 [-01] 2933367.839207: cycles:
      
      After this patch:
      
      $ perf record uname | perf script
      Linux
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.015 MB (null) (~655 samples) ]
                 :4582  4582 2933425.707724: cycles:  ffffffff81043ffa native_write_msr_safe ([kernel.kallsyms])
                 :4582  4582 2933425.707728: cycles:  ffffffff81043ffa native_write_msr_safe ([kernel.kallsyms])
                 :4582  4582 2933425.707730: cycles:  ffffffff81043ffa native_write_msr_safe ([kernel.kallsyms])
                 :4582  4582 2933425.707732: cycles:  ffffffff81043ffa native_write_msr_safe ([kernel.kallsyms])
                 :4582  4582 2933425.707734: cycles:  ffffffff81043ffa native_write_msr_safe ([kernel.kallsyms])
                 :4582  4582 2933425.707736: cycles:  ffffffff81309a24 memcpy ([kernel.kallsyms])
                 uname  4582 2933425.707760: cycles:  ffffffff8109c1c7 enqueue_task_fair ([kernel.kallsyms])
                 uname  4582 2933425.707978: cycles:  ffffffff81308457 clear_page_c ([kernel.kallsyms])
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      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: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1383313899-15987-3-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7ea95727
    • F
      perf tools: Use an accessor to read thread comm · b9c5143a
      Frederic Weisbecker 提交于
      As the thread comm is going to be implemented by way of a more
      complicated data structure than just a pointer to a string from the
      thread struct, convert the readers of comm to use an accessor instead of
      accessing it directly.
      
      The accessor will be later overriden to support an enhanced comm
      implementation.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Tested-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-wr683zwy94hmj4ibogmnv9ce@git.kernel.org
      [ Rename thread__comm_curr() to thread__comm_str() ]
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      [ Fixed up some minor const pointer issues ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b9c5143a
  4. 23 10月, 2013 1 次提交
  5. 22 10月, 2013 3 次提交
  6. 19 9月, 2013 1 次提交
  7. 11 9月, 2013 1 次提交
    • S
      perf tools: Add attr->mmap2 support · 5c5e854b
      Stephane Eranian 提交于
      This patch adds support for the new PERF_RECORD_MMAP2 record type
      exposed by the kernel. This is an extended PERF_RECORD_MMAP record.
      
      It adds for each file-backed mapping the device major, minor number and
      the inode number and generation.
      
      This triplet uniquely identifies the source of a file-backed mapping. It
      can be used to detect identical virtual mappings between processes, for
      instance.
      
      The patch will prefer MMAP2 over MMAP.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1377079825-19057-3-git-send-email-eranian@google.com
      [ Cope with 314add6b "Change machine__findnew_thread() to set thread pid",
        fix 'perf test' regression test entry affected,
        use perf_missing_features.mmap2 to fallback to not using .mmap2 in older kernels,
        so that new tools can work with kernels where this feature is not present ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5c5e854b
  8. 30 8月, 2013 1 次提交
  9. 29 8月, 2013 1 次提交
  10. 12 8月, 2013 4 次提交
  11. 08 8月, 2013 1 次提交
  12. 22 7月, 2013 1 次提交
  13. 16 7月, 2013 1 次提交
  14. 13 7月, 2013 1 次提交
  15. 25 1月, 2013 3 次提交
  16. 29 10月, 2012 2 次提交
  17. 07 10月, 2012 1 次提交
    • A
      perf event: No need to create a thread when handling PERF_RECORD_EXIT · f62d3f0f
      Arnaldo Carvalho de Melo 提交于
      When we were processing a PERF_RECORD_EXIT event we first used
      machine__findnew_thread for both the thread exiting and for its parent,
      only to use just the thread struct associated with the one exiting, and
      to just delete it.
      
      If it existed, i.e. not created at this very moment in
      machine__findnew_thread, it will be moved to the machine->dead_threads
      linked list, because we may have hist_entries pointing to it, but if it
      was created just do be deleted, it will just sit there with no
      references at all.
      
      Use the new machine__find_thread() method so that if it is not there, we
      don't create it.
      
      As a bonus the parent thread will also not be created at this point.
      
      Create process_fork() and process_exit() helpers to use this and make
      the builtins use it instead of the generic process_task(), ditched by
      this patch.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      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: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-z7n2y98ebjyrvmytaope4vdl@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f62d3f0f
  18. 03 10月, 2012 1 次提交
  19. 18 9月, 2012 2 次提交
  20. 11 9月, 2012 1 次提交
    • I
      perf tools: Use __maybe_used for unused variables · 1d037ca1
      Irina Tirdea 提交于
      perf defines both __used and __unused variables to use for marking
      unused variables. The variable __used is defined to
      __attribute__((__unused__)), which contradicts the kernel definition to
      __attribute__((__used__)) for new gcc versions. On Android, __used is
      also defined in system headers and this leads to warnings like: warning:
      '__used__' attribute ignored
      
      __unused is not defined in the kernel and is not a standard definition.
      If __unused is included everywhere instead of __used, this leads to
      conflicts with glibc headers, since glibc has a variables with this name
      in its headers.
      
      The best approach is to use __maybe_unused, the definition used in the
      kernel for __attribute__((unused)). In this way there is only one
      definition in perf sources (instead of 2 definitions that point to the
      same thing: __used and __unused) and it works on both Linux and Android.
      This patch simply replaces all instances of __used and __unused with
      __maybe_unused.
      Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: NPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
      [ committer note: fixed up conflict with a116e05d in builtin-sched.c ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d037ca1
  21. 06 9月, 2012 1 次提交
  22. 12 8月, 2012 1 次提交
    • J
      perf tools: Support for DWARF CFI unwinding on post processing · 71ad0f5e
      Jiri Olsa 提交于
      This brings the support for DWARF cfi unwinding on perf post
      processing. Call frame informations are retrieved and then passed
      to libunwind that requests memory and register content from the
      applications.
      
      Adding unwind object to handle the user stack backtrace based
      on the user register values and user stack dump.
      
      The unwind object access the libunwind via remote interface
      and provides to it all the necessary data to unwind the stack.
      
      The unwind interface provides following function:
      	unwind__get_entries
      
      And callback (specified in above function) to retrieve
      the backtrace entries:
      	typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry,
      					 void *arg);
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Original-patch-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: "Frank Ch. Eigler" <fche@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Benjamin Redelings <benjamin.redelings@nescent.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/r/1344345647-11536-12-git-send-email-jolsa@redhat.com
      [ Replaced use of perf_session by usage of perf_evsel ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      71ad0f5e
  23. 08 8月, 2012 3 次提交
  24. 28 6月, 2012 1 次提交
    • A
      perf tools: Stop using a global trace events description list · da378962
      Arnaldo Carvalho de Melo 提交于
      The pevent thing is per perf.data file, so I made it stop being static
      and become a perf_session member, so tools processing perf.data files
      use perf_session and _there_ we read the trace events description into
      session->pevent and then change everywhere to stop using that single
      global pevent variable and use the per session one.
      
      Note that it _doesn't_ fall backs to trace__event_id, as we're not
      interested at all in what is present in the
      /sys/kernel/debug/tracing/events in the workstation doing the analysis,
      just in what is in the perf.data file.
      
      This patch also introduces perf_session__set_tracepoints_handlers that
      is the perf perf.data/session way to associate handlers to tracepoint
      events by resolving their IDs using the events descriptions stored in a
      perf.data file. Make 'perf sched' use it.
      Reported-by: NDmitry Antipov <dmitry.antipov@linaro.org>
      Tested-by: NDmitry Antipov <dmitry.antipov@linaro.org>
      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: linaro-dev@lists.linaro.org
      Cc: patches@linaro.org
      Link: http://lkml.kernel.org/r/20120625232016.GA28525@infradead.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      da378962
  25. 20 6月, 2012 1 次提交
    • J
      perf tools: Remove unused evsel parameter from machine__resolve_callchain · a9c34a9f
      Jiri Olsa 提交于
      Removing unused evsel parameter from machine__resolve_callchain
      function. Plus related header file and callers changes.
      
      The evsel parameter is unused since following commit:
        perf callchain: Make callchain cursors TLS
        commit 47260645
        Author: Namhyung Kim <namhyung.kim@lge.com>
        Date:   Thu May 31 14:43:26 2012 +0900
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Benjamin Redelings <benjamin.redelings@nescent.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/r/1339420814-7379-9-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a9c34a9f