1. 14 8月, 2012 13 次提交
  2. 13 8月, 2012 3 次提交
  3. 12 8月, 2012 2 次提交
    • J
      perf tools: Support for DWARF mode callchain · 26d33022
      Jiri Olsa 提交于
      This patch enables perf to use the DWARF unwind code.
      
      It extends the perf record '-g' option with following arguments:
        'fp'           - provides framepointer based user
                         stack backtrace
        'dwarf[,size]' - provides DWARF (libunwind) based user stack
                         backtrace. The size specifies the size of the
                         user stack dump. If omitted it is 8192 by default.
      
      If libunwind is found during the perf build, then the 'dwarf' argument
      becomes available for record command. The 'fp' stays as default option
      in any case.
      
      Examples: (perf compiled with libunwind)
      
         perf record -g dwarf ls
            - provides dwarf unwind with 8192 as stack dump size
      
         perf record -g dwarf,4096 ls
            - provides dwarf unwind with 4096 as stack dump size
      
         perf record -g -- ls
         perf record -g fp ls
            - provides frame pointer unwind
      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-13-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      26d33022
    • 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
  4. 11 8月, 2012 4 次提交
    • J
      perf tools: Support user regs and stack in sample parsing · 0f6a3015
      Jiri Olsa 提交于
      Adding following info to be parsed out of the event sample:
       - user register set
       - user stack dump
      
      Both are global and specific to all events within the session.
      This info will be used in the unwind patches coming in shortly.
      
      Adding simple output printout (report -D) for both register and
      stack dumps.
      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-11-git-send-email-jolsa@redhat.com
      [ Use evsel->attr.sample_regs_user ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0f6a3015
    • J
      perf tools: Add libunwind dependency for DWARF CFI unwinding · 6a40cd90
      Jiri Olsa 提交于
      Adding libunwind to be linked with perf if available. It's required
      for the to get dwarf cfi unwinding support.
      
      Also building perf with the dwarf call frame informations by default,
      so that we can unwind callchains in perf itself.
      
      Adding LIBUNWIND_DIR Makefile variable allowing user to specify
      the directory with libunwind to be linked. This is used for
      debug purposes.
      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-10-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6a40cd90
    • J
      perf tools: Add interface to arch registers sets · 2bcd355b
      Jiri Olsa 提交于
      Adding header files to access unified API for arch registers.
      
        util/perf_regs.h - global perf_reg declarations
        arch/x86/include/perf_regs.h - x86 arch specific
      
      Adding perf_reg_name function to obtain register name based on the reg
      ID value, and PERF_REGS_MASK macro with mask definition of all current
      arch registers (will be used in unwind patches).
      Signed-off-by: NJiri Olsa <jolsa@redhat.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-9-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2bcd355b
    • J
      perf tools: Adding PERF_ATTR_SIZE_VER2 to the header swap check · 239cc478
      Jiri Olsa 提交于
      Updating attr_file_abi_sizes array with PERF_ATTR_SIZE_VER2 version, so
      we have the swap check complete.
      Signed-off-by: NJiri Olsa <jolsa@redhat.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-8-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      239cc478
  5. 10 8月, 2012 15 次提交
  6. 08 8月, 2012 3 次提交
    • F
      perf scripts python: Add event_analyzing_sample.py as a sample for general event handling · 0076d546
      Feng Tang 提交于
      Currently only trace point events are supported in perf/python script,
      the first 3 patches of this serie add the support for all types of
      events. This script is just a simple sample to show how to gather the
      basic information of the events and analyze them.
      
      This script will create one object for each event sample and insert them
      into a table in a database, then leverage the simple SQL commands to
      sort/group them. User can modify or write their brand new functions
      according to their specific requirment.
      
      Here is the sample of how to use the script:
      
       $ perf record -a tree
       $ perf script -s process_event.py
      
      There is 100 records in gen_events table
      Statistics about the general events grouped by thread/symbol/dso:
      
                  comm   number         histgram
      ==========================================
               swapper       56     ######
                  tree       20     #####
                  perf       10     ####
                  sshd        8     ####
           kworker/7:2        4     ###
           ksoftirqd/7        1     #
       plugin-containe        1     #
      
                                symbol   number         histgram
      ==========================================================
                 native_write_msr_safe       40     ######
                        __lock_acquire        8     ####
                   ftrace_graph_caller        4     ###
                 prepare_ftrace_return        4     ###
                            intel_idle        3     ##
                    native_sched_clock        3     ##
                        Unknown_symbol        2     ##
                            do_softirq        2     ##
                          lock_release        2     ##
                 lock_release_holdtime        2     ##
                     trace_graph_entry        2     ##
                              _IO_putc        1     #
                        __d_lookup_rcu        1     #
                            __do_fault        1     #
                            __schedule        1     #
                        _raw_spin_lock        1     #
                             delay_tsc        1     #
                   generic_exec_single        1     #
                      generic_fillattr        1     #
      
                                           dso   number         histgram
      ==================================================================
                             [kernel.kallsyms]       95     #######
                           /lib/libc-2.12.1.so        5     ###
      Signed-off-by: NFeng Tang <feng.tang@intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1344419875-21665-6-git-send-email-feng.tang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0076d546
    • F
      perf scripts python: Add a python library EventClass.py · 02f1c33f
      Feng Tang 提交于
      This library defines several class types for perf events which could
      help to better analyze the event samples. Currently there are just a few
      classes, PerfEvent is the base class for all perf events,  PebsEvent is
      a HW base Intel x86 PEBS event, and user could add more SW/HW event
      classes based on requriements.
      Signed-off-by: NFeng Tang <feng.tang@intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1344419875-21665-5-git-send-email-feng.tang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      02f1c33f
    • F
      perf scripts python: Pass event/thread/dso name and symbol info to event handler in python · fd6b858a
      Feng Tang 提交于
      Also as suggested by Arnaldo, pack all these parameters to a dictionary,
      which is more expandable for adding new parameters while keeping the
      compatibility for old scripts.
      Signed-off-by: NFeng Tang <feng.tang@intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1344419875-21665-4-git-send-email-feng.tang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fd6b858a