1. 29 4月, 2015 1 次提交
  2. 24 3月, 2015 1 次提交
    • A
      perf symbols: Save DSO loading errno to better report errors · 18425f13
      Arnaldo Carvalho de Melo 提交于
      Before, when some problem happened while trying to load the kernel
      symtab, 'perf top' would show:
      
            ┌─Warning:───────────────────────────┐
            │The vmlinux file can't be used.     │
            │Kernel samples will not be resolved.│
            │                                    │
            │                                    │
            │Press any key...                    │
            └────────────────────────────────────┘
      
      Now, it reports:
      
        # perf top --vmlinux /dev/null
      
            ┌─Warning:───────────────────────────────────────────┐
            │The /tmp/passwd file can't be used: Invalid ELF file│
            │Kernel samples will not be resolved.                │
            │                                                    │
            │                                                    │
            │Press any key...                                    │
            └────────────────────────────────────────────────────┘
      
      This is possible because we now register the reason for not being able
      to load the symtab in the dso->load_errno member, and provide a
      dso__strerror_load() routine to format this error into a strerror like
      string with a short reason for the error while loading.
      
      That can be just forwarding the dso__strerror_load() call to
      strerror_r(), or, for a separate errno range providing a custom message.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      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: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-u5rb5uq63xqhkfb8uv2lxd5u@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      18425f13
  3. 23 3月, 2015 2 次提交
  4. 22 3月, 2015 2 次提交
    • J
      perf tools: Add dsos__addnew function · 701d8d7f
      Jiri Olsa 提交于
      Separate the creation of new dso object and its addition to the dsos
      list. It will be used in following patch.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-8j43jod97fdt5dwdsushwwae@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      701d8d7f
    • J
      perf tools: Add kmod_path__parse function · 3c8a67f5
      Jiri Olsa 提交于
      Provides united way of parsing kernel module path
      into several components.
      
      The new kmod_path__parse function and few defines:
      
        int __kmod_path__parse(struct kmod_path *m, const char *path,
                               bool alloc_name, bool alloc_ext);
      
        #define kmod_path__parse(__m, __p)      __kmod_path__parse(__m, __p, false, false)
        #define kmod_path__parse_name(__m, __p) __kmod_path__parse(__m, __p, true , false)
        #define kmod_path__parse_ext(__m, __p)  __kmod_path__parse(__m, __p, false, true)
      
      parse kernel module @path and updates @m argument like:
      
        @comp - true if @path contains supported compression suffix,
                false otherwise
        @kmod - true if @path contains '.ko' suffix in right position,
                false otherwise
        @name - if (@alloc_name && @kmod) is true, it contains strdup-ed base name
                of the kernel module without suffixes, otherwise strudup-ed
                base name of @path
        @ext  - if (@alloc_ext && @comp) is true, it contains strdup-ed string
                the compression suffix
      
      It returns 0 if there's no strdup error, -ENOMEM otherwise.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-9t6eqg8j610r94l743hkntiv@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3c8a67f5
  5. 20 3月, 2015 1 次提交
  6. 30 1月, 2015 1 次提交
  7. 04 11月, 2014 1 次提交
  8. 29 10月, 2014 2 次提交
    • A
      perf tools: Add facility to export data in database-friendly way · 0db15b1e
      Adrian Hunter 提交于
      This patch introduces an abstraction for exporting sample data in a
      database-friendly way.  The abstraction does not implement the actual
      output.  A subsequent patch takes this facility into use for extending
      the script interface.
      
      The abstraction is needed because static data like symbols, dsos, comms
      etc need to be exported only once.  That means allocating them a unique
      identifier and recording it on each structure.  The member 'db_id' is
      used for that.  'db_id' is just a 64-bit sequence number.
      
      Exporting centres around the db_export__sample() function which exports
      the associated data structures if they have not yet been allocated a
      db_id.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      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/r/1414061124-26830-6-git-send-email-adrian.hunter@intel.com
      [ committer note: Stash db_id using symbol_conf.priv_size + symbol__priv() and foo->priv areas ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0db15b1e
    • S
      perf tools powerpc: Cache the DWARF debug info · 7d073b33
      Sukadev Bhattiprolu 提交于
      Cache the DWARF debug info for DSO so we don't have to rebuild it for each
      address in the DSO.
      
      Note that dso__new() uses calloc() so don't need to set dso->dwfl to NULL.
      
      	$ /tmp/perf.orig --version
      	perf version 3.18.rc1.gc2661b80
      	$ /tmp/perf.new --version
      	perf version 3.18.rc1.g402d62
      	$ perf stat -e cycles,instructions /tmp/perf.orig report -g > orig
      
      	 Performance counter stats for '/tmp/perf.orig report -g':
      
      	     6,428,177,183 cycles                    #    0.000 GHz
      	     4,176,288,391 instructions              #    0.65  insns per cycle
      
      	       1.840666132 seconds time elapsed
      
      	$ perf stat -e cycles,instructions /tmp/perf.new report -g > new
      
      	 Performance counter stats for '/tmp/perf.new report -g':
      
      	       305,773,142 cycles                    #    0.000 GHz
      	       276,048,272 instructions              #    0.90  insns per cycle
      
      	       0.087693543 seconds time elapsed
      	$ diff orig new
      	$
      
      Changelog[v2]:
      
      [Arnaldo Carvalho] Cache in existing global objects rather than create
                         new static/globals in functions.
      Reported-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Anton Blanchard <anton@au1.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20141022000958.GB2228@us.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7d073b33
  9. 02 10月, 2014 1 次提交
    • W
      perf symbols: Improve DSO long names lookup speed with rbtree · 4598a0a6
      Waiman Long 提交于
      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: NWaiman 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: NArnaldo Carvalho de Melo <acme@redhat.com>
      4598a0a6
  10. 30 9月, 2014 1 次提交
    • W
      perf symbols: Encapsulate dsos list head into struct dsos · 8fa7d87f
      Waiman Long 提交于
      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: NWaiman 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: NArnaldo Carvalho de Melo <acme@redhat.com>
      8fa7d87f
  11. 24 7月, 2014 1 次提交
  12. 23 7月, 2014 3 次提交
  13. 17 7月, 2014 1 次提交
  14. 12 6月, 2014 5 次提交
  15. 02 5月, 2014 1 次提交
  16. 18 2月, 2014 1 次提交
    • M
      perf probe: Allow to add events on the local functions · eb948e50
      Masami Hiramatsu 提交于
      Allow to add events on the local functions without debuginfo.
      (With the debuginfo, we can add events even on inlined functions)
      Currently, probing on local functions requires debuginfo to
      locate actual address. It is also possible without debuginfo since
      we have symbol maps.
      
      Without this change;
        ----
        # ./perf probe -a t_show
        Added new event:
          probe:t_show         (on t_show)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe:t_show -aR sleep 1
      
        # ./perf probe -x perf -a identity__map_ip
        no symbols found in /kbuild/ksrc/linux-3/tools/perf/perf, maybe install a debug package?
        Failed to load map.
          Error: Failed to add events. (-22)
        ----
      As the above results, perf probe just put one event
      on the first found symbol for kprobe event. Moreover,
      for uprobe event, perf probe failed to find local
      functions.
      
      With this change;
        ----
        # ./perf probe -a t_show
        Added new events:
          probe:t_show         (on t_show)
          probe:t_show_1       (on t_show)
          probe:t_show_2       (on t_show)
          probe:t_show_3       (on t_show)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe:t_show_3 -aR sleep 1
      
        # ./perf probe -x perf -a identity__map_ip
        Added new events:
          probe_perf:identity__map_ip (on identity__map_ip in /kbuild/ksrc/linux-3/tools/perf/perf)
          probe_perf:identity__map_ip_1 (on identity__map_ip in /kbuild/ksrc/linux-3/tools/perf/perf)
          probe_perf:identity__map_ip_2 (on identity__map_ip in /kbuild/ksrc/linux-3/tools/perf/perf)
          probe_perf:identity__map_ip_3 (on identity__map_ip in /kbuild/ksrc/linux-3/tools/perf/perf)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe_perf:identity__map_ip_3 -aR sleep 1
        ----
      Now we succeed to put events on every given local functions
      for both kprobes and uprobes. :)
      
      Note that this also introduces some symbol rbtree
      iteration macros; symbols__for_each, dso__for_each_symbol,
      and map__for_each_symbol. These are for walking through
      the symbol list in a map.
      
      Changes from v2:
        - Fix add_exec_to_probe_trace_events() not to convert address
          to tp->symbol any more.
        - Fix to set kernel probes based on ref_reloc_sym.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053225.29635.15026.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eb948e50
  17. 18 12月, 2013 1 次提交
    • A
      perf symbols: Use consistent name for the DSO binary type member · 5f70619d
      Arnaldo Carvalho de Melo 提交于
      It was called "data_type", but in this context "data" is way too vague,
      it could mean the "data" ELF segment, or something else.
      
      Since we have dso__read_binary_type_filename() and the values this field
      receives are all DSO__BINARY_TYPE_<FOO> we may as well call it
      "binary_type" for consistency sake.
      
      It also seems more appropriate since it determines if we can do
      operations like annotation and DWARF unwinding, that needs more than
      just the symtab, requiring access to ELF text segments, CFI ELF
      sections, etc.
      
      Cc: Adrian Hunter <adrian.hunter@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@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-2lkbqrn23uc2uvnn9w9in379@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5f70619d
  18. 17 12月, 2013 1 次提交
  19. 11 12月, 2013 6 次提交
  20. 05 12月, 2013 3 次提交
  21. 10 10月, 2013 2 次提交
  22. 09 10月, 2013 1 次提交
  23. 08 8月, 2013 1 次提交