1. 09 3月, 2012 9 次提交
    • S
      perf record: Add HEADER_BRANCH_STACK tag · 330aa675
      Stephane Eranian 提交于
      This patch adds a new feature bit, namely,
      HEADER_BRANCH_STACK.  When present, it indicates
      that sample records may contain branch stack.
      
      This could be useful to a viewer to switch to
      branch mode without having to parse all the
      samples or without a specific cmdline option.
      
      This will be used in a subsequent patch to
      enhance perf report with branch stacks.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: asharma@fb.com
      Cc: ravitillo@lbl.gov
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1331246868-19905-3-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      330aa675
    • S
      perf record: Provide default branch stack sampling mode option · a5aabdac
      Stephane Eranian 提交于
      This patch chanegs the logic of the -b, --branch-stack options
      of perf record.
      
      Based on users' request, the patch provides a default filter
      mode with the -b (or --branch-any) option.  With the option,
      any type of taken branches is sampled.
      
      With -j (or --branch-filter), the user can specify any
      valid combination of branch types and privilege levels
      if supported by the underlying hardware.
      
      The -b (--branch any) is a shortcut for: --branch-filter any.
      
       $ perf record -b foo
      
      or:
      
       $ perf record --branch-filter any foo
      
      For more specific filtering:
      
       $ perf record --branch-filter ind_call,u foo
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: asharma@fb.com
      Cc: ravitillo@lbl.gov
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1331246868-19905-2-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      a5aabdac
    • S
      perf tools: Make perf able to read files from older ABIs · 114382a0
      Stephane Eranian 提交于
      This patches provides a way to handle legacy perf.data
      files.  Legacy files are those using the older PERFFILE
      signature.
      
      For those, it is still necessary to detect endianness but
      without comparing their header->attr_size with the
      tool's own version as it may be different. Instead, we use
      a reference table for all known sizes from the legacy era.
      
      We try all the combinations for sizes and endianness. If we find
      a match, we proceed, otherwise we return: "incompatible file
      format".
      
      This is also done for the pipe-mode file format.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: robert.richter@amd.com
      Cc: ming.m.lin@intel.com
      Cc: andi@firstfloor.org
      Cc: asharma@fb.com
      Cc: ravitillo@lbl.gov
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1328826068-11713-19-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      114382a0
    • S
      perf tools: Fix ABI compatibility bug in print_event_desc() · 62db9068
      Stephane Eranian 提交于
      This patches cleans up local variable types for msz and ret.
      They need to be size_t and ssize_t respectively.
      
      It also fixes a bug whereby perf would not read attr struct
      with a different size than what it knows about.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: robert.richter@amd.com
      Cc: ming.m.lin@intel.com
      Cc: andi@firstfloor.org
      Cc: asharma@fb.com
      Cc: ravitillo@lbl.gov
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1328826068-11713-18-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      62db9068
    • S
      perf tools: Enable reading of perf.data files from different ABI rev · 69996df4
      Stephane Eranian 提交于
      This patch allows perf to process perf.data files generated
      using an ABI that has a different perf_event_attr struct size,
      i.e., a different ABI version.
      
      The perf_event_attr can be extended, yet perf needs to cope with
      older perf.data files. Similarly, perf must be able to cope with
      a perf.data file which is using a newer version of the ABI than
      what it knows about.
      
      This patch adds read_attr(), a routine that reads a
      perf_event_attr struct from a file incrementally based on its
      advertised size. If the on-file struct is smaller than what perf
      knows, then the extra fields are zeroed. If the on-file struct
      is bigger, then perf only uses what it knows about, the rest is
      skipped.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: robert.richter@amd.com
      Cc: ming.m.lin@intel.com
      Cc: andi@firstfloor.org
      Cc: asharma@fb.com
      Cc: ravitillo@lbl.gov
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1328826068-11713-17-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      69996df4
    • S
      perf: Add ABI reference sizes · cb5d7699
      Stephane Eranian 提交于
      This patch adds reference sizes for revision 1
      and 2 of the perf_event ABI, i.e., the size of
      the perf_event_attr struct.
      
      With Rev1: config2 was added = +8 bytes
      With Rev2: branch_sample_type was added = +8 bytes
      
      Adds the definition for Rev1, Rev2.
      
      This is useful for tools trying to decode the revision
      numbers based on the size of the struct.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: robert.richter@amd.com
      Cc: ming.m.lin@intel.com
      Cc: andi@firstfloor.org
      Cc: asharma@fb.com
      Cc: ravitillo@lbl.gov
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1328826068-11713-16-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      cb5d7699
    • R
      perf report: Add support for taken branch sampling · b50311dc
      Roberto Agostino Vitillo 提交于
      This patch adds support for taken branch sampling, i.e, the
      PERF_SAMPLE_BRANCH_STACK feature to perf report. In other
      words, to display histograms based on taken branches rather
      than executed instructions addresses.
      
      The new option is called -b and it takes no argument. To
      generate meaningful output, the perf.data must have been
      obtained using perf record -b xxx ... where xxx is a branch
      filter option.
      
      The output shows symbols, modules, sorted by 'who branches
      where' the most often. The percentages reported in the first
      column refer to the total number of branches captured and
      not the usual number of samples.
      
      Here is a quick example.
      Here branchy is simple test program which looks as follows:
      
      void f2(void)
      {}
      void f3(void)
      {}
      void f1(unsigned long n)
      {
        if (n & 1UL)
          f2();
        else
          f3();
      }
      int main(void)
      {
        unsigned long i;
      
        for (i=0; i < N; i++)
         f1(i);
        return 0;
      }
      
      Here is the output captured on Nehalem, if we are
      only interested in user level function calls.
      
      $ perf record -b any_call,u -e cycles:u branchy
      
      $ perf report -b --sort=symbol
          52.34%  [.] main                   [.] f1
          24.04%  [.] f1                     [.] f3
          23.60%  [.] f1                     [.] f2
           0.01%  [k] _IO_new_file_xsputn    [k] _IO_file_overflow
           0.01%  [k] _IO_vfprintf_internal  [k] _IO_new_file_xsputn
           0.01%  [k] _IO_vfprintf_internal  [k] strchrnul
           0.01%  [k] __printf               [k] _IO_vfprintf_internal
           0.01%  [k] main                   [k] __printf
      
      About half (52%) of the call branches captured are from main()
      -> f1(). The second half (24%+23%) is split in two equal shares
      between f1() -> f2(), f1() ->f3(). The output is as expected
      given the code.
      
      It should be noted, that using -b in perf record does not
      eliminate information in the perf.data file. Consequently, a
      typical profile can also be obtained by perf report by simply
      not using its -b option.
      
      It is possible to sort on branch related columns:
      
         - dso_from, symbol_from
         - dso_to, symbol_to
         - mispredict
      Signed-off-by: NRoberto Agostino Vitillo <ravitillo@lbl.gov>
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: robert.richter@amd.com
      Cc: ming.m.lin@intel.com
      Cc: andi@firstfloor.org
      Cc: asharma@fb.com
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1328826068-11713-14-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      b50311dc
    • R
      perf record: Add support for sampling taken branch · bdfebd84
      Roberto Agostino Vitillo 提交于
      This patch adds a new option to enable taken branch stack
      sampling, i.e., leverage the PERF_SAMPLE_BRANCH_STACK feature
      of perf_events.
      
      There is a new option to active this mode: -b.
      It is possible to pass a set of filters to select the type of
      branches to sample.
      
      The following filters are available:
      
       - any : any type of branches
       - any_call : any function call or system call
       - any_ret : any function return or system call return
       - any_ind : any indirect branch
       - u:  only when the branch target is at the user level
       - k: only when the branch target is in the kernel
       - hv: only when the branch target is in the hypervisor
      
      Filters can be combined by passing a comma separated list
      to the option:
      
      $ perf record -b any_call,u -e cycles:u branchy
      Signed-off-by: NRoberto Agostino Vitillo <ravitillo@lbl.gov>
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: robert.richter@amd.com
      Cc: ming.m.lin@intel.com
      Cc: andi@firstfloor.org
      Cc: asharma@fb.com
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1328826068-11713-13-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      bdfebd84
    • R
      perf tools: Add code to support PERF_SAMPLE_BRANCH_STACK · b5387528
      Roberto Agostino Vitillo 提交于
      This patch adds:
      
       - ability to parse samples with PERF_SAMPLE_BRANCH_STACK
       - sort on branches (dso_from, symbol_from, dso_to, symbol_to, mispredict)
       - build histograms on branches
      Signed-off-by: NRoberto Agostino Vitillo <ravitillo@lbl.gov>
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: robert.richter@amd.com
      Cc: ming.m.lin@intel.com
      Cc: andi@firstfloor.org
      Cc: asharma@fb.com
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1328826068-11713-12-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      b5387528
  2. 05 3月, 2012 12 次提交
  3. 03 3月, 2012 3 次提交
  4. 02 3月, 2012 2 次提交
  5. 01 3月, 2012 4 次提交
  6. 29 2月, 2012 2 次提交
  7. 28 2月, 2012 1 次提交
  8. 27 2月, 2012 7 次提交