17 Mar, 2010
13 commits
-
Improve --list to show current exist probes with line number and
file name. This enables user easily to check which line is
already probed.for example:
./perf probe --list
probe:vfs_read (on vfs_read:8@linux-2.6-tip/fs/read_write.c)Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Mike Galbraith
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Introduce kprobe_trace_event and perf_probe_event and replace
old probe_point structure with it. probe_point structure is
not enough flexible nor extensible. New data structures
will help implementing further features.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Mike Galbraith
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Add --dry-run option for debugging and testing.
Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Mike Galbraith
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Introduce die_find_child() function to integrate DIE-tree
searching functions.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Mike Galbraith
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Rename die_get_real_subprogram and die_get_inlinefunc to
die_find_real_subprogram and die_find_inlinefunc respectively,
because these functions search its children. After that,
'die_get_' means getting a property of that die, and
'die_find_' means searching DIE-tree to get an appropriate
child die.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Mike Galbraith
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Since this name 'session' conflicts with 'perf_session', and
this structure just holds parameters anymore.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Mike Galbraith
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Move add-probe routine to util/probe_event.c. This simplifies
main routine for reducing maintenance cost.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Mike Galbraith
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Use wrapped functions as much as possible, to check out of
memory conditions in perf probe.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Mike Galbraith
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Introducing xzalloc() which wrapping zalloc() for detecting out
of memory conditions.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Mike Galbraith
Cc: Peter Zijlstra
LKML-Reference:
[ -v2: small cleanups in surrounding code ]
Signed-off-by: Ingo Molnar -
Merge reason: We'll be queueing dependent changes.
Signed-off-by: Ingo Molnar
-
perf_arch_fetch_caller_regs() is exported for the overriden x86
version, but not for the generic weak version.As a general rule, weak functions should not have their symbol
exported in the same file they are defined.So let's export it on trace_event_perf.c as it is used by trace
events only.This fixes:
ERROR: ".perf_arch_fetch_caller_regs" [fs/xfs/xfs.ko] undefined!
ERROR: ".perf_arch_fetch_caller_regs" [arch/powerpc/platforms/cell/spufs/spufs.ko] undefined!-v2: And also only build it if trace events are enabled.
-v3: Fix changelog mistakeReported-by: Stephen Rothwell
Signed-off-by: Frederic Weisbecker
Cc: Peter Zijlstra
Cc: Xiao Guangrong
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
If x86_pmu.hw_config() fails a fixed error code (-EOPNOTSUPP) is
returned even if a different error was reported. This patch fixes
this.Signed-off-by: Robert Richter
Acked-by: Cyrill Gorcunov
Acked-by: Lin Ming
Cc: acme@redhat.com
Cc: eranian@google.com
Cc: gorcunov@openvz.org
Cc: peterz@infradead.org
Cc: fweisbec@gmail.com
LKML-Reference:
Signed-off-by: Ingo Molnar -
The dso_short_width has to start as zero, as we're calculating
the maximum short DSO name length, somehow I missed this one.Reported-by: Frédéric Weisbecker
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar
16 Mar, 2010
7 commits
-
Hide CONFIG_OPTPROBES and set if the arch supports optimized
kprobes (IOW, HAVE_OPTPROBES=y), since this option doesn't
change the major behavior of kprobes, and workarounds for minor
changes are documented.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Dieter Ries
Cc: Ananth N Mavinakayanahalli
Cc: OGAWA Hirofumi
Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Use original address for looking up the location of variables
for dwarf_getlocation_addr() instead of CU-based address.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
LKML-Reference:
Signed-off-by: Ingo Molnar -
Fix dereference offset to intmax_t from uintmax_t, because
it can have negative values (for example local variable's offset
from frame pointer).Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
LKML-Reference:
Signed-off-by: Ingo Molnar -
When profiling C++ workloads the symbol name length can be
really big, so cap it before it garbles the result.This builds upon the autosizing already present where we choose
to use the short, basename of DSOs instead of its long, full
pathname.Reported-by: Pavel Krauz
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
Reported-by: Cyrill Gorcunov
Signed-off-by: Lin Ming
Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
perf_arch_fetch_caller_regs() is exported for the overriden x86
version, but not for the generic weak version.As a general rule, weak functions should not have their symbol
exported in the same file they are defined.So let's export it on trace_event_perf.c as it is used by trace
events only.This fixes:
ERROR: ".perf_arch_fetch_caller_regs" [fs/xfs/xfs.ko] undefined!
ERROR: ".perf_arch_fetch_caller_regs" [arch/powerpc/platforms/cell/spufs/spufs.ko] undefined!-v2: And also only build it if trace events are enabled.
-v3: Fix changelog mistakeReported-by: Stephen Rothwell
Signed-off-by: Frederic Weisbecker
Cc: Peter Zijlstra
Cc: Xiao Guangrong
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
Before this patch we would not find a vmlinux, then try to pass
objdump "[kernel.kallsyms]" as the filename, it would get
confused and produce no output:[root@doppio ~]# perf annotate n_tty_write
------------------------------------------------
Percent | Source code & Disassembly of [kernel.kallsyms]
------------------------------------------------Now we check that and emit meaningful warning:
[root@doppio ~]# perf annotate n_tty_write
Can't annotate n_tty_write: No vmlinux file was found in the
path: [0] vmlinux
[1] /boot/vmlinux
[2] /boot/vmlinux-2.6.34-rc1-tip+
[3] /lib/modules/2.6.34-rc1-tip+/build/vmlinux
[4] /usr/lib/debug/lib/modules/2.6.34-rc1-tip+/vmlinux
[root@doppio ~]#This bug was introduced when we added automatic search for
vmlinux, before that time the user had to specify a vmlinux
file.v2: Print the warning just for the first symbol found when no
symbol name is specified, otherwise it will spam the screen
repeating the warning for each symbol.Reported-by: Ingo Molnar
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc:
LKML-Reference:
Signed-off-by: Ingo Molnar
15 Mar, 2010
3 commits
-
Before this patch this message would very briefly appear on the
screen and then the screen would get updates only on the top,
for number of interrupts received, etc, but no annotation would
be performed:[root@doppio linux-2.6-tip]# perf top -s n_tty_write > /tmp/bla
objdump: '[kernel.kallsyms]': No such fileNow this is what the user gets:
[root@doppio linux-2.6-tip]# perf top -s n_tty_write
Can't annotate n_tty_write: No vmlinux file was found in the
path: [0] vmlinux
[1] /boot/vmlinux
[2] /boot/vmlinux-2.6.33-rc5
[3] /lib/modules/2.6.33-rc5/build/vmlinux
[4] /usr/lib/debug/lib/modules/2.6.33-rc5/vmlinux
[root@doppio linux-2.6-tip]#This bug was introduced when we added automatic search for
vmlinux, before that time the user had to specify a vmlinux
file.Reported-by: David S. Miller
Reported-by: Ingo Molnar
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc:
LKML-Reference:
Signed-off-by: Ingo Molnar -
When forking its target, perf record can capture data from
before the target application is started. Perf stat uses the
enable_on_exec flag in the event attributes to keep from
displaying events from before the target program starts, this
patch adds the same functionality to perf record when it is will
fork the target process.Signed-off-by: Eric B Munson
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
This should turn on instruction counting on P4s, which was missing in
the first version of the new PMU driver.It's inaccurate for now, we still need dependant event to tag mops
before we can count them precisely. The result is that the number of
instruction may be lifted up.Signed-off-by: Cyrill Gorcunov
Signed-off-by: Lin Ming
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar
13 Mar, 2010
8 commits
-
Ingo reported:
|
| There's a build failure on -tip with the P4 driver, on UP 32-bit, if
| PERF_EVENTS is enabled but UP_APIC is disabled:
|
| arch/x86/built-in.o: In function `p4_pmu_handle_irq':
| perf_event.c:(.text+0xa756): undefined reference to `apic'
| perf_event.c:(.text+0xa76e): undefined reference to `apic'
|So we have to unmask LVTPC only if we're configured to have one.
Reported-by: Ingo Molnar
Signed-off-by: Cyrill Gorcunov
CC: Lin Ming
CC: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Set need_dwarf if lazy matching pattern is specified, because
lazy matching requires real source path for which we must use
debuginfo.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
LKML-Reference:
Signed-off-by: Ingo Molnar -
Fix probe_point array-size overrun problem. In some cases (e.g.
inline function), one user-specified probe-point can be
translated to many probe address, and it overruns pre-defined
array-size. This also removes redundant MAX_PROBES macro
definition.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc:
LKML-Reference:
[ Note that only root can create new probes. Eventually we should remove
the MAX_PROBES limit, but that is a larger patch not eligible to
perf/urgent treatment. ]
Signed-off-by: Ingo Molnar -
The use_browser needs to be in a file that is always built and
also we need a browser__show_help stub in that case.Reported-by: Anton Blanchard
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
Merge reason: The new P4 driver is stable and ready now for more
testing.Signed-off-by: Ingo Molnar
-
[root@doppio ~]# perf report -i newt.data | head -10
# Samples: 11999679868
#
# Overhead Command Shared Object Symbol
# ........ ....... ............................. ......
#
63.61% perf libslang.so.2.1.4 [.] SLsmg_write_chars
6.30% perf perf [.] symbols__find
2.19% perf libnewt.so.0.52.10 [.] newtListboxAppendEntry
2.08% perf libslang.so.2.1.4 [.] SLsmg_write_chars@plt
1.99% perf libc-2.10.2.so [.] _IO_vfprintf_internal
[root@doppio ~]#Not good, the newt form for report works, but slang has to eat
the cost of the additional callgraph lines everytime it prints a
line, and the callgraph doesn't appear on the screen, so move
the callgraph printing to a separate function and don't use it
in newt.c.Newt tree widgets are being investigated to properly support
callgraphs, but till that gets merged, lets remove this huge
overhead and show at least the symbol overheads for a callgraph
rich perf.data with good performance.Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
For consistency, use the newt API more fully.
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
These are keys people expect when pressed to exit the current
widget, so have associate all of them to this semantic.Suggested-by: Ingo Molnar
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar
12 Mar, 2010
9 commits
-
Newt has widespread availability and provides a rather simple
API as can be seen by the size of this patch.The work needed to support it will benefit other frontends too.
In this initial patch it just checks if the output is a tty, if
not it falls back to the previous behaviour, also if
newt-devel/libnewt-dev is not installed the previous behaviour
is maintaned.Pressing enter on a symbol will annotate it, ESC in the
annotation window will return to the report symbol list.More work will be done to remove the special casing in
color_fprintf, stop using fmemopen/FILE in the printing of
hist_entries, etc.Also the annotation doesn't need to be done via spawning "perf
annotate" and then browsing its output, we can do better by
calling directly the builtin-annotate.c functions, that would
then be moved to tools/perf/util/annotate.c and shared with perf
top, etcBut lets go by baby steps, this patch already improves perf
usability by allowing to quickly do annotations on symbols from
the report screen and provides a first experimentation with
libnewt/TUI integration of tools.Tested on RHEL5 and Fedora12 X86_64 and on Debian PARISC64 to
browse a perf.data file collected on a Fedora12 x86_64 box.Signed-off-by: Arnaldo Carvalho de Melo
Cc: Avi Kivity
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
We need those to properly size the browser widht in the newt
TUI.Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
Just like we do for pr_debug, so that we can have a single point
where to redirect to the currently used output system, be it
stdio or newt.Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
Will be used by the newt code too.
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
Merge reason: We want to queue up a dependent patch.
Signed-off-by: Ingo Molnar
-
In case of not assigned x86_pmu and software events NULL dereference may
being hit via x86_pmu::schedule_events method.Fix it by checking if x86_pmu is initialized at all.
Signed-off-by: Cyrill Gorcunov
Cc: Lin Ming
Cc: Arnaldo Carvalho de Melo
Cc: Stephane Eranian
Cc: Robert Richter
Cc: Frederic Weisbecker
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
[acme@mica linux-2.6-tip]$ perf record -a -f
Fatal: Permission error - are you root?
Consider tweaking /proc/sys/kernel/perf_event_paranoid.[acme@mica linux-2.6-tip]$
Suggested-by: Ingo Molnar
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
Fixing this symptom:
[acme@mica linux-2.6-tip]$ perf record -a -f
Fatal: Permission error - are you root?Bus error
[acme@mica linux-2.6-tip]$I.e. if for some reason no data is collected, in this case a non
root user trying to do systemwide profiling, no data will be
collected, and then we end up trying to mmap a zero sized file
and access the file header, b00m.Reported-by: Ingo Molnar
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc:
LKML-Reference:
Signed-off-by: Ingo Molnar