1. 09 3月, 2012 1 次提交
  2. 03 3月, 2012 2 次提交
  3. 01 3月, 2012 4 次提交
  4. 22 2月, 2012 1 次提交
    • S
      perf tools: fix broken perf record -a mode · 6b1bee90
      Stephane Eranian 提交于
      The following commit:
      b52956c9 perf tools: Allow multiple threads or processes in record, stat, top
      
      introduced a bug in the thread_map code which caused perf record -a to
      not setup system-wide monitoring properly.
      
      $ taskset -c 1 noploop 1000 &
      $ perf record -a -C 1 sleep 10
      $ perf report -D | tail -20
      cycles stats:
                 TOTAL events:       4413
                  MMAP events:       4025
                  COMM events:        340
                SAMPLE events:         48
      
      Here I was expecting about 10,000 samples and not 48.
      
      In system-wide mode, the PID passed to perf_event_open() must be -1 and
      it was 0. That caused the kernel to setup a per-process event on PID:0.
      Consequently, the number of samples captured does not correspond to the
      requested measurement.
      
      The following one-liner fixes the problem for me with or without -C.
      
      I would also suggest to change the malloc() to something that matches
      the struct definition. thread_map->map[] is declared as int map[] and
      not pid_t map[]. If map[] can only contain pids, then change the struct
      definition.
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20120221145424.GA6757@quadSigned-off-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6b1bee90
  5. 18 2月, 2012 2 次提交
  6. 15 2月, 2012 2 次提交
  7. 14 2月, 2012 13 次提交
  8. 09 2月, 2012 1 次提交
    • S
      perf tools: fix endianness detection in perf.data · 73323f54
      Stephane Eranian 提交于
      The current version of perf detects whether or not the perf.data file is
      written in a different endianness using the attr_size field in the
      header of the file. This field represents sizeof(struct perf_event_attr)
      as known to perf record. If the sizes do not match, then perf tries the
      byte-swapped version. If they match, then the tool assumes a different
      endianness.
      
      The issue with the approach is that it assumes the size of
      perf_event_attr always has to match between perf record and perf report.
      However, the kernel perf_event ABI is extensible.  New fields can be
      added to struct perf_event_attr. Consequently, it is not possible to use
      attr_size to detect endianness.
      
      This patch takes another approach by using the magic number written at
      the beginning of the perf.data file to detect endianness. The magic
      number is an eight-byte signature.  It's primary purpose is to identify
      (signature) a perf.data file. But it could also be used to encode the
      endianness.
      
      The patch introduces a new value for this signature. The key difference
      is that the signature is written differently in the file depending on
      the endianness. Thus, by comparing the signature from the file with the
      tool's own signature it is possible to detect endianness. The new
      signature is "PERFILE2".
      
      Backward compatiblity with existing perf.data file is ensured.
      Tested-by: NDavid Ahern <dsahern@gmail.com>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Roberto Agostino Vitillo <ravitillo@lbl.gov>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Vince Weaver <vweaver1@eecs.utk.edu>
      Link: http://lkml.kernel.org/r/1328187288-24395-15-git-send-email-eranian@google.comSigned-off-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      73323f54
  9. 07 2月, 2012 2 次提交
    • N
      perf evsel: Fix an issue where perf report fails to show the proper percentage · a4a03fc7
      Naveen N. Rao 提交于
      This patch fixes an issue where perf report shows nan% for certain
      perf.data files. The below is from a report for a do_fork probe:
      
         -nan%           sshd  [kernel.kallsyms]  [k] do_fork
         -nan%    packagekitd  [kernel.kallsyms]  [k] do_fork
         -nan%    dbus-daemon  [kernel.kallsyms]  [k] do_fork
         -nan%           bash  [kernel.kallsyms]  [k] do_fork
      
      A git bisect shows commit f3bda2c9 as the cause. However, looking back
      through the git history, I saw commit 640c03ce which seems to have
      removed the required initialization for perf_sample->period. The problem
      only started showing after commit f3bda2c9. The below patch re-introduces
      the initialization and it fixes the problem for me.
      
      With the below patch, for the same perf.data:
      
        73.08%             bash  [kernel.kallsyms]  [k] do_fork
         8.97%      11-dhclient  [kernel.kallsyms]  [k] do_fork
         6.41%             sshd  [kernel.kallsyms]  [k] do_fork
         3.85%        20-chrony  [kernel.kallsyms]  [k] do_fork
         2.56%         sendmail  [kernel.kallsyms]  [k] do_fork
      
      This patch applies over current linux-tip commit 9949284.
      
      Problem introduced in:
      
      $ git describe 640c03ce
      v2.6.37-rc3-83-g640c03ce
      
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: stable@kernel.org
      Link: http://lkml.kernel.org/r/20120203170113.5190.25558.stgit@localhost6.localdomain6Signed-off-by: NNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a4a03fc7
    • J
      perf tools: Fix prefix matching for kernel maps · bf32c9eb
      Jiri Olsa 提交于
      In some perf ancient versions we used '[kernel.kallsyms._text]' as the
      name for the kernel map.
      
      This got changed with commit:
        perf: 'perf kvm' tool for monitoring guest performance from host
        commit a1645ce1
        Author: Zhang, Yanmin <yanmin_zhang@linux.intel.com>
      
      and we started to use following name '[kernel.kallsyms]_text'.
      
      This name change is important for the report code dealing with ancient
      perf data. When processing the kernel map event, we need to recognize
      the old naming (dont match the last ']') and initialize the kernel map
      correctly.
      
      The subsequent call to maps__set_kallsyms_ref_reloc_sym deals with the
      superfluous ']' to get correct symbol name.
      
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1328461865-6127-1-git-send-email-jolsa@redhat.comSigned-off-by: NJiri Olsa <jolsa@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bf32c9eb
  10. 03 2月, 2012 2 次提交
  11. 02 2月, 2012 1 次提交
  12. 31 1月, 2012 7 次提交
  13. 25 1月, 2012 2 次提交