1. 14 Oct, 2014 7 commits
    • Arnaldo Carvalho de Melo's avatar
      perf evlist: Default to syswide target when no thread/cpu maps set · 4112eb18
      Arnaldo Carvalho de Melo authored
      If all a tool wants is to do system wide event monitoring, there is no
      more the need to setup thread_map and cpu_map objects, just call
      perf_evlist__open() and it will do create one fd per CPU monitoring all
      threads.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-poovolkigu72brx4783uq4cf@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4112eb18
    • Arnaldo Carvalho de Melo's avatar
      perf evlist: Check that there is a thread_map when preparing a workload · 1aaf63b1
      Arnaldo Carvalho de Melo authored
      The perf_evlist__prepare_workload expects a thread map to be in place
      so that it can store the pid of the workload being started, so check it
      and tell the developer about it instead of segfaulting.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-jvlz2f264e7kpmhjmwltikqw@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1aaf63b1
    • Arnaldo Carvalho de Melo's avatar
      perf thread_map: Create dummy constructor out of open coded equivalent · 641556c9
      Arnaldo Carvalho de Melo authored
      Create a dummy thread_map, one that has just one entry and it is -1,
      meaning 'all threads', as this ends up going down to perf_event_open().
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-8av26cz8uxmbnihl5mmrygp9@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      641556c9
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Remove hists from evsel · a635fc51
      Arnaldo Carvalho de Melo authored
      Now tools that deals want to have an hists per evsel need to call
      hists__init() before creating any evsels, which can be as early as when
      parsing the command line, so do it before calling parse_options().
      
      The current tools using hists/hist_entries are report, top and annotate,
      change them to request per evsel hists.
      
      This is in preparation for making evsels usable by 3rd party tools, that
      not necessarily live in perf's source code repository.
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-usjx2la743f10ippj7p1b20x@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a635fc51
    • Arnaldo Carvalho de Melo's avatar
      perf callchain: Move the callchain_param extern to callchain.h · 8f651eae
      Arnaldo Carvalho de Melo authored
      It was lost in hist.h, move it to where it belongs, callchain.h, as
      there are places that gets hist.h by means of evsel.h, and since evsel.h
      is being untangled from hist.h...
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-0rg7ji1jnbm6q6gj35j37jby@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8f651eae
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Subclassing · ce8ccff5
      Arnaldo Carvalho de Melo authored
      Provide a method to be called at tool start to config the perf_evsel
      instance size, together with optional constructor and destructor.
      
      This will be used so that perf_evsel doesn't always include a struct
      hists, tools that works with hists/hist_entries, like report, top and
      annotate, will, at start, tell the evsel class the size they need per
      instance.
      
      v2: Don't use exit as a name of a member of function parameter, as this
          breaks the build on at least fedora14 and rhel6.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-7t8cay0ieryox4gqosie85ek@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ce8ccff5
    • Arnaldo Carvalho de Melo's avatar
      perf session: Remove last reference to hists struct · 2a1731fb
      Arnaldo Carvalho de Melo authored
      Now perf_session doesn't require that the evsels in its evlist are hists
      containing ones.
      
      Tools that are hists based and want to do per evsel events_stats
      updates, if at some point this turns into a necessity, should do it in
      the tool specific code, keeping the session class hists agnostic.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-cli1bgwpo82mdikuhy3djsuy@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2a1731fb
  2. 10 Oct, 2014 3 commits
    • Arnaldo Carvalho de Melo's avatar
      perf ui browsers: Add missing include · 95e8d97e
      Arnaldo Carvalho de Melo authored
      This file needs the K_{RIGHT,etc} definitions but isn't including the
      file where they are defined, ui/keysyms.h, fix it.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-jlpybqegpdauzx64l9r1jgm3@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      95e8d97e
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Move events_stats struct to event.h · 4318bcb7
      Arnaldo Carvalho de Melo authored
      This is the only bit of hist.h that session.[ch] will end up using, so
      move it out of hist.h to make that abundantly clear.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-l9ftsl21ggw0c1g2ig87otmd@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4318bcb7
    • Arnaldo Carvalho de Melo's avatar
      perf session: Don't count per evsel events · c2329ade
      Arnaldo Carvalho de Melo authored
      PERF_RECORD_SAMPLE was not being counted here and is the only per-evsel
      thing anyway, the other events were not mapping to a evsel.
      
      With this we don't require that evsels used with a perf_session need to
      have space for hists, like the ones in annotate, report, top.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-kzchpz0l1mhrsfpkirz086m2@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c2329ade
  3. 09 Oct, 2014 3 commits
  4. 03 Oct, 2014 7 commits
  5. 01 Oct, 2014 3 commits
    • Arnaldo Carvalho de Melo's avatar
      perf record: Fix error message for --filter option not coming after tracepoint · 281f92f2
      Arnaldo Carvalho de Melo authored
        [root@zoo ~]# perf record --filter "common_pid != PERF_PID" -a
        -F option should follow a -e tracepoint option.
      
      The -F option is for --freq, not --filter. Fix it up to show:
      
        [root@zoo ~]# perf record --filter "common_pid != PERF_PID" -a
        --filter option should follow a -e tracepoint option
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-z0yrm8stn9w3423nkov3eksg@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      281f92f2
    • Will Deacon's avatar
      perf tools: Fix build breakage on arm64 targets · 660d1329
      Will Deacon authored
      Attempting to build the perf tool for an arm64 target results in the
      following failure:
      
        arch/arm64/util/unwind-libunwind.c: In function 'libunwind__arch_reg_id':
        arch/arm64/util/unwind-libunwind.c:77:3: error: implicit declaration of function 'pr_err'
           pr_err("unwind: invalid reg id %d\n", regnum);
           ^
        arch/arm64/util/unwind-libunwind.c:77:3: error: nested extern declaration of 'pr_err'
      
      This is due to commit 84f5d36f ("perf tools: Move pr_* debug macros
      into debug object") moving the pr_* macros into a new header file, but
      failing to update architectures other than x86.
      
      This patch adds the missing include, and fixes the build again.
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1412076432-22045-1-git-send-email-will.deacon@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      660d1329
    • Waiman Long's avatar
      perf symbols: Improve DSO long names lookup speed with rbtree · 4598a0a6
      Waiman Long authored
      With workload that spawns and destroys many threads and processes, it
      was found that perf-mem could took a long time to post-process the perf
      data after the target workload had completed its operation.
      
      The performance bottleneck was found to be the lookup and insertion of
      the new DSO structures (thousands of them in this case).
      
      In a dual-socket Ivy-Bridge E7-4890 v2 machine (30-core, 60-thread), the
      perf profile below shows what perf was doing after the profiled AIM7
      shared workload completed:
      
      -     83.94%  perf  libc-2.11.3.so     [.] __strcmp_sse42
         - __strcmp_sse42
            - 99.82% map__new
                 machine__process_mmap_event
                 perf_session_deliver_event
                 perf_session__process_event
                 __perf_session__process_events
                 cmd_record
                 cmd_mem
                 run_builtin
                 main
                 __libc_start_main
      -     13.17%  perf  perf               [.] __dsos__findnew
           __dsos__findnew
           map__new
           machine__process_mmap_event
           perf_session_deliver_event
           perf_session__process_event
           __perf_session__process_events
           cmd_record
           cmd_mem
           run_builtin
           main
           __libc_start_main
      
      So about 97% of CPU times were spent in the map__new() function trying
      to insert new DSO entry into the DSO linked list. The whole
      post-processing step took about 9 minutes.
      
      The DSO structures are currently searched linearly. So the total
      processing time will be proportional to n^2.
      
      To overcome this performance problem, the DSO code is modified to also
      put the DSO structures in a RB tree sorted by its long name in
      additional to being in a simple linked list. With this change, the
      processing time will become proportional to n*log(n) which will be much
      quicker for large n. However, the short name will still be searched
      using the old linear searching method.  With that patch in place, the
      same perf-mem post-processing step took less than 30 seconds to
      complete.
      Signed-off-by: default avatarWaiman Long <Waiman.Long@hp.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Douglas Hatch <doug.hatch@hp.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Link: http://lkml.kernel.org/r/1412098575-27863-3-git-send-email-Waiman.Long@hp.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4598a0a6
  6. 30 Sep, 2014 1 commit
    • Waiman Long's avatar
      perf symbols: Encapsulate dsos list head into struct dsos · 8fa7d87f
      Waiman Long authored
      This is a precursor patch to enable long name searching of DSOs using
      a rbtree.
      
      In this patch, a new dsos structure is created which contains only a
      list head structure for the moment.
      
      The new dsos structure is used, in turn, in the machine structure for
      the user_dsos and kernel_dsos fields.
      
      Only the following 3 dsos functions are modified to accept the new dsos
      structure parameter instead of list_head:
      
       - dsos__add()
       - dsos__find()
       - __dsos__findnew()
      Signed-off-by: default avatarWaiman Long <Waiman.Long@hp.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Douglas Hatch <doug.hatch@hp.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Link: http://lkml.kernel.org/r/1412021249-19201-2-git-send-email-Waiman.Long@hp.com
      [ Move struct dsos to dso.h to reduce the dso methods depends on machine.h ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8fa7d87f
  7. 29 Sep, 2014 4 commits
  8. 27 Sep, 2014 1 commit
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 07394b5f
      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:
      
      User visible changes:
      
        o Restore "--callchain graph" output, broken in recent cset to end
          up being the same as "fractal" (Namhyung Kim)
      
        o Allow profiling when kptr_restrict == 1 for non root users,
          kernel samples will just remain unresolved (Andi Kleen)
      
        o Allow configuring default options for callchains in config file (Namhyung Kim)
      
        o Fix line number in the config file error message (Jiri Olsa)
      
        o Fix --per-core on multi socket systems (Andi Kleen)
      
      Cleanups:
      
        o Use ACCESS_ONCE() instead of volatile cast. (Pranith Kumar)
      
        o Modify error code for when perf_session__new() fails (Taeung Song)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      07394b5f
  9. 26 Sep, 2014 11 commits