10 Dec, 2009
7 commits
-
Fix:
builtin-kmem.c: In function 'parse_caller_opt':
builtin-kmem.c:690: error: unused parameter 'arg'
builtin-kmem.c: In function 'parse_alloc_opt':
builtin-kmem.c:697: error: unused parameter 'arg'Cc: Li Zefan
Cc: Pekka Enberg
LKML-Reference:
Signed-off-by: Ingo Molnar -
As off_t is a long, so breaking things on 32-bit land. Now
buildids work on 32-bit land.[root@ana ~]# uname -a
Linux ana.ghostprotocols.net 2.6.31.6-162.fc12.i686 #1 SMP Fri
Dec 4 01:09:09 EST 2009 i686 i686 i386 GNU/Linux [root@ana ~]#
perf buildid-list | tail -5
136ee6792ba2ae57870ecd87369f4ae3194d5b27 /lib/libreadline.so.6.0
d202dcb1ad48d140065783657d37ae3f2d9ab83f /usr/bin/gdb
0a56c0c00dcc2e9e581ae9997f31957c9c4671df
/usr/lib/libdwarf.so.0.0
5f9e6ac95241cbb3227608e0ff2a2e0cbbe72439 /home/acme/bin/perf
925d19eccc2ddb1c9d74dd178a011426f1b124a8 /bin/sleep [root@ana ~]#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 -
Before:
$ ./perf kmem
...
-l, --line show n lines
--raw-ip show raw ip instead of symbolAfter:
$ ./perf kmem
...
-l, --line show n lines
--raw-ip show raw ip instead of symbolSigned-off-by: Li Zefan
Cc: Pekka Enberg
LKML-Reference:
Signed-off-by: Ingo Molnar -
As Ingo suggested, make "perf kmem" show help information.
"perf kmem stat [--caller] [--alloc] .." will show memory
statistics.Signed-off-by: Li Zefan
Acked-by: Pekka Enberg
LKML-Reference:
Signed-off-by: Ingo Molnar -
When we have a maximum latency reported for a task, we need a
convenient way to find the matching location to the raw traces
or to perf sched map that shows where the task has been
eventually scheduled in. This gives a pointer to retrieve the
events that occured during this max latency.Signed-off-by: Frederic Weisbecker
Reviewed-by: Xiao Guangrong
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
Memset should be given the size of the structure, not the size
of the pointer.The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@@
type T;
T *x;
expression E;
@@memset(x, E, sizeof(
+ *
x))
//Signed-off-by: Julia Lawall
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar
09 Dec, 2009
8 commits
-
In current code, task's execute time is got by reading
'/proc//sched' file, it's wrong if the task is created
by pthread_create(), because every thread task has same pid.This way also has two demerits:
1: 'perf sched replay' can't work if the kernel is not
compiled with the 'CONFIG_SCHED_DEBUG' option2: perf tool should depend on proc file system
So, this patch uses PERF_COUNT_SW_TASK_CLOCK to get task's
execution time instead of reading /proc file.Changelog v2 -> v3:
use PERF_COUNT_SW_TASK_CLOCK instead of rusage() as Ingo's
suggestionReported-by: Torok Edwin
Signed-off-by: Xiao Guangrong
Cc: Xiao Guangrong
Cc: Peter Zijlstra
Cc: Frederic Weisbecker
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
Add --list and --del option descriptions to perf-probe.txt.
Signed-off-by: Masami Hiramatsu
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Support perf probe --del option. Currently,
perf probe can have only one event for each --del option.
If you'd like to delete several probe events, you need
to specify --del for each events.Signed-off-by: Masami Hiramatsu
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: systemtap
Cc: DLE
LKML-Reference:
Signed-off-by: Ingo Molnar -
Support vmlinux on current working direcotry by default and
also update file-open messages.
Now perf probe searches ./vmlinux too.Signed-off-by: Masami Hiramatsu
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: systemtap
Cc: DLE
LKML-Reference:
Signed-off-by: Ingo Molnar -
Remove event suffix number _0 if it is the first.
The first event has no suffix, and from the second,
each event has suffix number counted from _1. This
reduces typing cost :-).Signed-off-by: Masami Hiramatsu
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: systemtap
Cc: DLE
LKML-Reference:
Signed-off-by: Ingo Molnar -
Fix add-probe command syntax without --add option.
perf-probe supports add-probe command without --add
option. But it treats each argument as an event definition.
e.g.perf probe func arg1 arg2
is interpreted as
perf probe --add func --add arg1 --add arg2
But it may be useless in many cases.
This patch fixes this syntax to fold those arguments into
one event definition if there is no --add option. With this
change, above command is interpreted as below;perf probe --add "func arg1 arg2"
Signed-off-by: Masami Hiramatsu
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: systemtap
Cc: DLE
LKML-Reference:
Signed-off-by: Ingo Molnar -
Change probe-added message more user-friendly expression and
show usage of new events.Before:
Added new event: p:probe/schedule_0 schedule+10 prev=%ax cpu=%bxAfter:
Added new event:
probe:schedule_1 (on schedule+1 with prev cpu)You can now use it on all perf tools, such as:
perf record -e probe:schedule_1 -a sleep 1
Signed-off-by: Masami Hiramatsu
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: systemtap
Cc: DLE
LKML-Reference:
Signed-off-by: Ingo Molnar -
Change event list format for user readability. perf probe --list
shows event list in "[GROUP:EVENT] EVENT-DEFINITION" format, but
this format is different from the output of perf-list, and
EVENT-DEFINITION is a bit blunt. This patch changes the format to
more user friendly one.Before:
[probe:schedule_0] schedule+10 prev cpuAfter:
probe:schedule_0 (on schedule+10 with prev cpu)Signed-off-by: Masami Hiramatsu
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: systemtap
Cc: DLE
LKML-Reference:
Signed-off-by: Ingo Molnar
08 Dec, 2009
4 commits
-
Use pr_debug() for "missing vmlinux" debugging message.
Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Check e_snprintf() format string by gcc, and fix a bug of
e_snprintf() caller.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Fix event namelist to duplicate string. Without duplicating, adding
multiple probes causes stack overwrite bug, because it reuses a
buffer on stack while the buffer is already added in the namelist.
String duplication solves this bug because only contents of the
buffer is copied to the namelist.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Fix strtailcmp() to compare s1[0] and s2[0]. strtailcmp() returns 0
if "a" and "b" or "a" and "ab", it's a wrong behavior. This patch
fixes it.Signed-off-by: "Juha Leppanen"
Acked-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Juha Leppanen
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar
07 Dec, 2009
11 commits
-
Uses of strcat are almost always signs that someone is too lazy
to think about the code a bit more carefully. One always has to
know about the lengths of the strings involved to avoid buffer
overflows.This is one case where the size of the object code for me is
reduced by 38 bytes. The code should also be faster, especially
if flags is non-NULL.Signed-off-by: Ulrich Drepper
Cc: a.p.zijlstra@chello.nl
Cc: fweisbec@gmail.com
Cc: jaswinderrajput@gmail.com
Cc: paulus@samba.org
LKML-Reference:
Signed-off-by: Ingo Molnar -
The 'scripting unsupported' message should only be displayed
when the -s or -g options are used, and not when they aren't, as
the current code does.Signed-off-by: Tom Zanussi
Cc: rostedt@goodmis.org
Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
When I added the xs callbacks into perf, I forgot to re-check
the no-libperl case. This patch fixes the undefined reference
error for that.Reported-by: Arnaldo Carvalho de Melo
Signed-off-by: Tom Zanussi
Cc: Frederic Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
raw->size is not used, this patch just cleans it up.
Signed-off-by: Xiao Guangrong
Cc: Frederic Weisbecker
Cc: Paul Mackerras
Cc: OGAWA Hirofumi
Cc: Peter Zijlstra
Cc: Li Zefan
LKML-Reference:
Signed-off-by: Ingo Molnar -
The remain buff size is 'len - pos->long_name_len - 1', not
'len - pos->long_name_len + 1'This bug was introduced by commit 7691b1e ("perf tools: Misc small
fixes").Signed-off-by: Xiao Guangrong
Acked-by: OGAWA Hirofumi
Cc: Frederic Weisbecker
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Li Zefan
LKML-Reference:
Signed-off-by: Ingo Molnar -
We use 'data.raw_data' parameter to call process_raw_event(),
but data.raw_data buffer not include data size. it can make perf
tool crash.This bug was introduced by commit 180f95e29a ("perf: Make common
SAMPLE_EVENT parser").Signed-off-by: Xiao Guangrong
Cc: Pekka Enberg
Cc: Eduard - Gabriel Munteanu
Cc: Frederic Weisbecker
Cc: Paul Mackerras
Cc: OGAWA Hirofumi
Cc: Peter Zijlstra
Cc: Li Zefan
LKML-Reference:
Signed-off-by: Ingo Molnar -
If we use 'perf sched trace', it will call symbol__init() again,
and can lead to a perf tool crash:[root@localhost perf]# ./perf sched trace
*** glibc detected *** ./perf: free(): invalid next size (normal): 0x094c1898 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7602404]
/lib/libc.so.6(cfree+0x96)[0xb76043b6]
./perf[0x80730fe]
./perf[0x8074c97]
./perf[0x805eb59]
./perf[0x80536fd]
./perf[0x804b618]
./perf[0x804bdc3]
/lib/libc.so.6(__libc_start_main+0xe5)[0xb75a9735]
./perf[0x804af81]
======= Memory map: ========
08048000-08158000 r-xp 00000000 fe:00 556831 /home/eric/....
08158000-08168000 rw-p 0010f000 fe:00 556831 /home/eric/...
08168000-085fe000 rw-p 00000000 00:00 0
094ab000-094cc000 rw-p 00000000 00:00 0 [heap]Signed-off-by: Xiao Guangrong
LKML-Reference:
Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
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 -
- util/header.c
"len" is aligned to 64. So, it tries to write the out of
long_name buffer.So, this use "zero_buf" to write aligned area.
- util/trace-event-read.c
"size" is not including nul byte. So, this allocates it, and set '\0'.- util/trace-event-parse.c
It needs parens to calc correct size.Signed-off-by: OGAWA Hirofumi
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Currently, sample event data is parsed for each commands, and it
is assuming that the data is not including other data. (E.g.
timechart, trace, etc. can't parse the event if it has
PERF_SAMPLE_CALLCHAIN)So, even if we record the superset data for multiple commands at
a time, commands can't parse. etc.To fix it, this makes common sample event parser, and use it to
parse sample event correctly. (PERF_SAMPLE_READ is unsupported
for now though, it seems to be not using.)Signed-off-by: OGAWA Hirofumi
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Update "struct trace_entry" to match with current one. And
remove "size" field from it.If it has "size", it become cause of alignment mismatch of
structure with kernel.Signed-off-by: OGAWA Hirofumi
Acked-by: Arjan van de Ven
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar
06 Dec, 2009
1 commit
-
The size argument to zalloc should be the size of desired
structure, not the pointer to it.The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@expression@
expression *x;
@@x =
//Signed-off-by: Julia Lawall
Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar
04 Dec, 2009
1 commit
-
Merge reason: it's ready for v2.6.33.
Signed-off-by: Ingo Molnar
02 Dec, 2009
3 commits
-
Not all glibc support %m and it results in a compile error if
%m not supported. Replace it with %a and (float *) casts.Signed-off-by: Liming Wang
Acked-by: Frederic Weisbecker
Cc: peterz@infradead.org
Cc: mhiramat@redhat.com
LKML-Reference:
Signed-off-by: Ingo Molnar -
Fix:
cc1: warnings being treated as errors
builtin-probe.c: In function 'cmd_probe':
builtin-probe.c:163: error: unused variable 'fd'Signed-off-by: Xiao Guangrong
Cc: Masami Hiramatsu
Cc: Peter Zijlstra
LKML-Reference:
[ v2: use NO_LIBDWARF instead of __used ]
Signed-off-by: Ingo Molnar -
strndup is a GNU extension. So dont include string.h without
defining _GNU_SOURCE (it results in a compile error otherwise).Remove these includes as util.h does it already.
Signed-off-by: Liming Wang
Acked-by: Frederic Weisbecker
Acked-by: Xiao Guangrong
Cc: peterz@infradead.org
Cc: mhiramat@redhat.com
LKML-Reference:
Signed-off-by: Ingo Molnar
01 Dec, 2009
5 commits
-
Simplify event naming as _. Each event name is
globally unique (group name is not checked). So, if there is
schedule_0, next probe event on schedule() will be schedule_1.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Add --list option for listing currently defined probe events
in the kernel. This shows events in below format;[group:event]
for example:
[probe:schedule_0] schedule+30 cpu
Note that source file/line information is not supported yet.
So even if you added a probe by line, it will be shown in
.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Add argv_split() ported from lib/argv_split.c to string.c and
use it in util/probe-event.c.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Split probe event (kprobe-events and perf probe events) utility
functions from builtin-probe.c to probe-event.c.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Fix the index of formatted probe array for multiple probe
points, which should be probes[i] instead of probes[0].Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Steven Rostedt
Cc: Jim Keniston
Cc: Ananth N Mavinakayanahalli
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: Frederic Weisbecker
Cc: Jason Baron
Cc: K.Prasad
Cc: Peter Zijlstra
Cc: Srikar Dronamraju
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar