1. 28 10月, 2015 1 次提交
  2. 21 10月, 2015 1 次提交
    • K
      perf cpu_map: Fix core dump caused by per-socket/core system-wide stat · bc1d0368
      Kan Liang 提交于
      Perf will core dump if --per-socket/core -a are applied for perf stat.
      
      The root cause is that cpu_map__build_map set refcnt of evlist's cpu_map
      to 1.  It should set refcnt for the newly created cpu_map, not evlist's
      cpu_map.
      
      Here is the example:
      
        # perf stat -e cycles --per-socket -a sleep 1
      
         Performance counter stats for 'system wide':
      
        S0       36         30,196,257      cycles
        S1       28         15,823,536      cycles
      
             1.001126828 seconds time elapsed
      
        *** Error in `./perf': corrupted double-linked list: 0x00000000021f9090 ***
        ======= Backtrace: =========
        /lib64/libc.so.6[0x3002e7bbe7]
        /lib64/libc.so.6[0x3002e7d2b5]
        ./perf(perf_evsel__delete+0x28)[0x485bdd]
        ./perf[0x4800e8]
        ./perf(perf_evlist__delete+0x5e)[0x482cd5]
        ./perf(cmd_stat+0xf25)[0x432328]
        ./perf[0x4768e0]
        ./perf[0x476ad6]
        ./perf[0x476b41]
        ./perf(main+0x1d0)[0x476db2]
        /lib64/libc.so.6(__libc_start_main+0xf5)[0x3002e21b45]
        ./perf[0x4202c5]
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Link: http://lkml.kernel.org/r/1444388363-35936-1-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bc1d0368
  3. 20 10月, 2015 2 次提交
  4. 14 9月, 2015 1 次提交
  5. 03 9月, 2015 1 次提交
  6. 26 6月, 2015 1 次提交
  7. 22 4月, 2014 2 次提交
  8. 18 2月, 2014 1 次提交
    • B
      perf tools: Move fs.* to lib/api/fs/ · cd0cfad7
      Borislav Petkov 提交于
      Move to generic library and kill magic.h as it is needed only in fs.h.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      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: 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-3-git-send-email-bp@alien8.deSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cd0cfad7
  9. 06 11月, 2013 2 次提交
  10. 26 3月, 2013 2 次提交
    • S
      perf stat: Add per-core aggregation · 12c08a9f
      Stephane Eranian 提交于
      This patch adds the --per-core option to perf stat.
      
      This option is used to aggregate system-wide counts
      on a per physical core basis. On processors with
      hyperthreading, this means counts of all HT threads
      running on a physical core are aggregated.
      
      This mode is useful to find imblance between physical
      cores running an uniform workload. Cores are identified
      by socket: S0-C1, means physical core 1 on socket 0. Note
      that cores are identified using their physical core id,
      thus their numbering may not be continuous.
      
      Per core aggregation can be combined with interval printing:
      
       # perf stat -a --per-core -I 1000 -e cycles sleep 1000
       #           time core         cpus             counts events
            1.000090030 S0-C0           1          4,765,747 cycles
            1.000090030 S0-C1           1          5,580,647 cycles
            1.000090030 S0-C2           1            221,181 cycles
            1.000090030 S0-C3           1            266,092 cycles
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: Andi Kleen <ak@linux.intel.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/1360846649-6411-4-git-send-email-eranian@google.com
      [ committer note: Remove parts already applied on 86ee6e18 to keep bisectability ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      12c08a9f
    • S
      perf stat: Refactor aggregation code · 86ee6e18
      Stephane Eranian 提交于
      Refactor aggregation code by introducing a single aggr_mode variable and an
      enum for aggregation.
      
      Also refactor cpumap code having to do with cpu to socket mappings. All in
      preparation for extended modes, such as cpu -> core.
      
      Also fix socket aggregation and ensure that sockets are printed in increasing
      order.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: Andi Kleen <ak@linux.intel.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/1360846649-6411-2-git-send-email-eranian@google.com
      [ committer note: Fixup conflicts with a7e191c3 "--repeat forever" and
        acf28922 "Use perf_evlist__prepare/start_workload()" ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      86ee6e18
  11. 07 2月, 2013 1 次提交
  12. 18 9月, 2012 1 次提交
  13. 25 1月, 2012 1 次提交
  14. 23 1月, 2011 1 次提交
  15. 04 1月, 2011 1 次提交
    • A
      perf tools: Refactor cpumap to hold nr and the map · 60d567e2
      Arnaldo Carvalho de Melo 提交于
      So that later, we can pass the cpu_map instance instead of (nr_cpus, cpu_map)
      for things like perf_evsel__open and friends.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      60d567e2
  16. 05 6月, 2010 1 次提交
    • S
      perf tools: Add the ability to specify list of cpus to monitor · c45c6ea2
      Stephane Eranian 提交于
      This patch adds a -C option to stat, record, top to designate a list of CPUs to
      monitor. CPUs can be specified as a comma-separated list or ranges, no space
      allowed.
      
      Examples:
      $ perf record -a -C0-1,4-7 sleep 1
      $ perf top -C0-4
      $ perf stat -a -C1,2,3,4 sleep 1
      
      With perf record in per-thread mode with inherit mode on, samples are collected
      only when the thread runs on the designated CPUs.
      
      The -C option does not turn on system-wide mode automatically.
      
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <4bff9496.d345d80a.41fe.7b00@mx.google.com>
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c45c6ea2
  17. 11 3月, 2010 1 次提交
    • P
      perf tools: Fix sparse CPU numbering related bugs · a12b51c4
      Paul Mackerras 提交于
      At present, the perf subcommands that do system-wide monitoring
      (perf stat, perf record and perf top) don't work properly unless
      the online cpus are numbered 0, 1, ..., N-1.  These tools ask
      for the number of online cpus with sysconf(_SC_NPROCESSORS_ONLN)
      and then try to create events for cpus 0, 1, ..., N-1.
      
      This creates problems for systems where the online cpus are
      numbered sparsely.  For example, a POWER6 system in
      single-threaded mode (i.e. only running 1 hardware thread per
      core) will have only even-numbered cpus online.
      
      This fixes the problem by reading the /sys/devices/system/cpu/online
      file to find out which cpus are online.  The code that does that is in
      tools/perf/util/cpumap.[ch], and consists of a read_cpu_map()
      function that sets up a cpumap[] array and returns the number of
      online cpus.  If /sys/devices/system/cpu/online can't be read or
      can't be parsed successfully, it falls back to using sysconf to
      ask how many cpus are online and sets up an identity map in cpumap[].
      
      The perf record, perf stat and perf top code then calls
      read_cpu_map() in the system-wide monitoring case (instead of
      sysconf) and uses cpumap[] to get the cpu numbers to pass to
      perf_event_open.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      LKML-Reference: <20100310093609.GA3959@brick.ozlabs.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a12b51c4