1. 08 Feb, 2013 29 commits
  2. 06 Feb, 2013 11 commits
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 661e5915
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      . Check for flex and bison before continuing building, from Borislav Petkov.
      
      . Make event_copy local to mmaps, fixing buffer wrap around problems, from
        David Ahern.
      
      . Add option for runtime switching perf data file in perf report, just press
        's' and a menu with the valid files found in the current directory will be
        presented, from Feng Tang.
      
      . Add support to display whole group data for raw columns, from Jiri Olsa.
      
      . Fix SIGALRM and pipe read race for the rwtop perl script. from Jiri Olsa.
      
      . Fix perf_evsel::exclude_GH handling and add a test to catch regressions, from
        Jiri Olsa.
      
      . Error checking fixes, from Namhyung Kim.
      
      . Fix calloc argument ordering, from Paul Gortmaker.
      
      . Fix set event list leader, from Stephane Eranian.
      
      . Add per processor socket count aggregation in perf stat, from Stephane Eranian.
      
      . Fix perf python binding breakage.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      661e5915
    • Arnaldo Carvalho de Melo's avatar
      perf python: Link with sysfs.o · 88fd2b6a
      Arnaldo Carvalho de Melo authored
      So that we fix this regression:
      
      [root@sandy linux]# perf test -v 15
      15: Try 'use perf' in python, checking link problems       :
      --- start ---
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      ImportError: /home/acme/git/build/perf/python/perf.so: undefined symbol: sysfs_find_mountpoint
      ---- end ----
      Try 'use perf' in python, checking link problems: FAILED!
      [root@sandy linux]#
      
      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-8pf64bsdywg1gl9m55ul77hg@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      88fd2b6a
    • Arnaldo Carvalho de Melo's avatar
      perf evlist: Pass the event_group info via perf_attr_details · e35ef355
      Arnaldo Carvalho de Melo authored
      So that we avoid dragging symbol.o into the python binding.
      
      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-izjubje7ltd1srji5wb0ygwi@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e35ef355
    • Paul Gortmaker's avatar
      perf tools: Fix calloc argument ordering · 91b98804
      Paul Gortmaker authored
      A sweep of the kernel for regex "kcalloc(sizeof" turned up 2 reversed
      args, fixed in commit d3d09e18 ("EDAC:
      Fix kcalloc argument order") and also fixed in the networking commit
      a1b1add0 ("gro: Fix kcalloc argument
      order").
      
      I know that was the regex used, because on seeing the 1st of these
      changes, I wondered "how many other instances of this are there" and I
      happened to just use "calloc(sizeof" as a regex and it in turn found
      these additional reversed args instances in the perf code.
      
      In the kcalloc cases, the changes are cosmetic, since the numbers are
      simply multiplied.  I had no desire to go data mining in userspace to
      see if the same thing held true there, however.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1359594349-25912-1-git-send-email-paul.gortmaker@windriver.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      91b98804
    • Jiri Olsa's avatar
      perf tests: Adding automated parsing tests for group :GH modifiers · 5a30a99f
      Jiri Olsa authored
      The ':GH' group modifier handling was just recently fixed, adding some
      autommated tests to keep it that way. Adding tests for following events:
      
        "{cycles,cache-misses:G}:H"
        "{cycles,cache-misses:H}:G"
        "{cycles:G,cache-misses:H}:u"
        "{cycles:G,cache-misses:H}:uG"
      
      Plus fixing test__group2 test.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1359971803-2343-3-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5a30a99f
    • Jiri Olsa's avatar
      perf tools: Fix perf_evsel::exclude_GH handling · 89bb67ff
      Jiri Olsa authored
      Let the perf_evsel::exclude_GH only prevent the reset of exclude_host
      and exclude_guest attributes in case they were already set.
      
      We cannot reset their values to 0, because they might have other
      defaults set by event_attr_init.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1359971803-2343-2-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      89bb67ff
    • Jiri Olsa's avatar
      perf perl scripts: Fix SIGALRM and pipe read race for rwtop · b22e7939
      Jiri Olsa authored
      Fixing rwtop script race. The issue is caused by rwtop script triggering
      SIGALRM and underneath pipe reading layer reporting error when
      interrupted.
      
      Fixing this by setting SA_RESTART for rwtop SIGALRM handler, which
      avoids interruption of the pipe reading layer.
      
      The discussion for this issue & fix is here:
      https://lkml.org/lkml/2012/9/18/123Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Original-patch-by: default avatarAndrew Jones <drjones@redhat.com>
      Cc: Andrew Jones <drjones@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1360080351-3246-2-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b22e7939
    • Jiri Olsa's avatar
      perf hists browser: Add support to display whole group data for raw columns · 0c5268bf
      Jiri Olsa authored
      Currently we don't display group members' values for raw columns like
      'Samples' and 'Period' when in group report mode.
      
      Uniting '__hpp__percent_fmt' and '__hpp__raw_fmt' function under new
      function __hpp__fmt. It's basically '__hpp__percent_fmt' code with new
      'fmt_percent' bool parameter added saying whether raw number or
      percentage should be printed.
      
      This way raw columns print out all the group members when
      in group report mode, like:
      
        $ perf record -e '{cycles,cache-misses}' ls
        ...
        $ perf report --group --show-total-period --stdio
        ...
        #         Overhead                    Period  Command      Shared Object                             Symbol
        # ................  ........................  .......  .................  .................................
        #
            23.63%  11.24%       3331335         317       ls  [kernel.kallsyms]  [k] __lock_acquire
            12.72%   0.00%       1793100           0       ls  [kernel.kallsyms]  [k] native_sched_clock
             9.72%   0.00%       1369920           0       ls  libc-2.14.90.so    [.] _nl_find_locale
             0.03%   0.07%          4476           2       ls  [kernel.kallsyms]  [k] intel_pmu_enable_all
             0.00%  11.73%             0         331       ls  ld-2.14.90.so      [.] _dl_cache_libcmp
             0.00%  11.06%             0         312       ls  [kernel.kallsyms]  [k] vma_interval_tree_insert
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1359981185-16819-2-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0c5268bf
    • Stephane Eranian's avatar
      perf stat: Add per processor socket count aggregation · d7e7a451
      Stephane Eranian authored
      This patch adds per-processor socket count aggregation for system-wide
      mode measurements. This is a useful mode to detect imbalance between
      sockets.
      
      To enable this mode, use --aggr-socket in addition
      to -a. (system-wide).
      
      The output includes the socket number and the number of online
      processors on that socket. This is useful to gauge the amount of
      aggregation.
      
       # ./perf stat -I 1000 -a --aggr-socket -e cycles sleep 2
       #           time socket cpus             counts events
            1.000097680 S0        4          5,788,785 cycles
            2.000379943 S0        4         27,361,546 cycles
            2.001167808 S0        4            818,275 cycles
      Signed-off-by: default avatarStephane 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/1360161962-9675-3-git-send-email-eranian@google.com
      [ committer note: Added missing man page entry based on above comments ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d7e7a451
    • Stephane Eranian's avatar
      perf tools: Add cpu_map processor socket level functions · 5ac59a8a
      Stephane Eranian authored
      This patch adds:
      - cpu_map__get_socket: get socked id from cpu
      - cpu_map__build_socket_map: build socket map
      - cpu_map__socket: gets acutal socket from logical socket
      
      Those functions are used by uncore and processor socket-level
      aggregation modes.
      Signed-off-by: default avatarStephane 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/1360161962-9675-2-git-send-email-eranian@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5ac59a8a
    • David Ahern's avatar
      perf evlist: Make event_copy local to mmaps · 0479b8b9
      David Ahern authored
      I am getting segfaults *after* the time sorting of perf samples where
      the event type is off the charts:
      
      (gdb) bt
      \#0  0x0807b1b2 in hists__inc_nr_events (hists=0x80a99c4, type=1163281902) at util/hist.c:1225
      \#1  0x08070795 in perf_session_deliver_event (session=0x80a9b90, event=0xf7a6aff8, sample=0xffffc318, tool=0xffffc520,
          file_offset=0) at util/session.c:884
      \#2  0x0806f9b9 in flush_sample_queue (s=0x80a9b90, tool=0xffffc520) at util/session.c:555
      \#3  0x0806fc53 in process_finished_round (tool=0xffffc520, event=0x0, session=0x80a9b90) at util/session.c:645
      
      This is bizarre because the event has already been processed once --
      before it was added to the samples queue -- and the event was found to
      be sane at that time.
      
      There seem to be 2 causes:
      
      1. perf_evlist__mmap_read updates the read location even though there
      are outstanding references to events sitting in the mmap buffers via the
      ordered samples queue.
      
      2. There is a single evlist->event_copy for all evlist entries.
      event_copy is used to handle an event wrapping at the mmap buffer
      boundary.
      
      This patch addresses the second problem - making event_copy local to
      each perf_mmap. With this change my highly repeatable use case no longer
      fails.
      
      The first problem is much more complicated and will be the subject of a
      future patch.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1360098762-61827-1-git-send-email-dsahern@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0479b8b9