linux/tools/perf
Arnaldo Carvalho de Melo 439d473b47 perf tools: Rewrite and improve support for kernel modules
Representing modules as struct map entries, backed by a DSO, etc,
using /proc/modules to find where the module is loaded.

DSOs now can have a short and long name, so that in verbose mode we
can show exactly which .ko or vmlinux image was used.

As kernel modules now are a DSO separate from the kernel, we can
ask for just the hits for a particular set of kernel modules, just
like we can do with shared libraries:

[root@doppio linux-2.6-tip]# perf report -n --vmlinux
/home/acme/git/build/tip-recvmmsg/vmlinux --modules --dsos \[drm\] | head -15
    84.58%      13266             Xorg  [k] drm_clflush_pages
     4.02%        630             Xorg  [k] trace_kmalloc.clone.0
     3.95%        619             Xorg  [k] drm_ioctl
     2.07%        324             Xorg  [k] drm_addbufs
     1.68%        263             Xorg  [k] drm_gem_close_ioctl
     0.77%        120             Xorg  [k] drm_setmaster_ioctl
     0.70%        110             Xorg  [k] drm_lastclose
     0.68%        106             Xorg  [k] drm_open
     0.54%         85             Xorg  [k] drm_mm_search_free
[root@doppio linux-2.6-tip]#

Specifying --dsos /lib/modules/2.6.31-tip/kernel/drivers/gpu/drm/drm.ko
would have the same effect. Allowing specifying just 'drm.ko' is left
for another patch.

Processing kallsyms so that per kernel module struct map are
instantiated was also left for another patch. That will allow
removing the module name from each of its symbols.

struct symbol was reduced by removing the ->module backpointer and
moving it (well now the map) to struct symbol_entry in perf top,
that is its only user right now.

The total linecount went down by ~500 lines.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Avi Kivity <avi@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-10-02 10:48:42 +02:00
..
Documentation perf util: Make the timechart SVG width dynamic 2009-09-20 19:37:35 +02:00
util perf tools: Rewrite and improve support for kernel modules 2009-10-02 10:48:42 +02:00
.gitignore perf tools: .gitignore += perf*.html 2009-09-24 14:01:22 +02:00
CREDITS perf_counter tools: Add CREDITS file for Git contributors 2009-06-24 19:54:29 +02:00
Makefile perf tools: Rewrite and improve support for kernel modules 2009-10-02 10:48:42 +02:00
builtin-annotate.c perf tools: Rewrite and improve support for kernel modules 2009-10-02 10:48:42 +02:00
builtin-help.c perf: Enable more compiler warnings 2009-08-16 10:47:47 +02:00
builtin-list.c perf list: Fix large list output by using the pager 2009-08-13 09:05:48 +02:00
builtin-record.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
builtin-report.c perf tools: Rewrite and improve support for kernel modules 2009-10-02 10:48:42 +02:00
builtin-sched.c perf sched: Remove dead code 2009-09-30 13:57:57 +02:00
builtin-stat.c perf stat: Fix zero total printouts 2009-09-22 15:01:47 +02:00
builtin-timechart.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
builtin-top.c perf tools: Rewrite and improve support for kernel modules 2009-10-02 10:48:42 +02:00
builtin-trace.c perf trace: Remove dead code 2009-09-30 13:57:57 +02:00
builtin.h perf: Add the timechart tool 2009-09-19 11:42:13 +02:00
command-list.txt perf: Add timechart help text and add timechart to "perf help" 2009-09-19 18:57:53 +02:00
design.txt perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
perf.c perf: Add the timechart tool 2009-09-19 11:42:13 +02:00
perf.h perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00