30 Sep, 2011
1 commit
-
A while back I created the dropmonitor protocol, which allowed users to get
reports of dropped frames communicated to them via a netlink socket.While useful, several people have now asked that I integrate the ability
to do drop monitoring with perf, so they don't have to run additional
tools.This patch adds a drop monitor script to the perf suite, and provides
the same output that the netlink socket does.Cc: Ingo Molnar
Cc: Paul Mackerras
Cc: Peter Zijlstra
Link: http://lkml.kernel.org/r/1309801217-22450-1-git-send-email-nhorman@tuxdriver.com
Signed-off-by: Neil Horman
Signed-off-by: Arnaldo Carvalho de Melo
25 Dec, 2010
1 commit
-
The scripts have calls to 'perf trace' that need to be converted to 'perf script', do it.
This problem was introduced in 133dc4c.
Reported-by: Torok Edwin
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
Cc: Torok Edwin
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo
17 Nov, 2010
1 commit
-
Free the perf trace name space and rename the trace to 'script' which is a
better match for the scripting engine.Signed-off-by: Ingo Molnar
Signed-off-by: Thomas Gleixner
10 Nov, 2010
1 commit
-
Including -a unconditionally when recording doesn't allow for the
option of running scripts without it. Future patches will add add it
back if needed at run-time.Signed-off-by: Tom Zanussi
Acked-by: Arnaldo Carvalho de Melo
27 Oct, 2010
2 commits
-
The equivalent to this SystemTAP script:
http://sourceware.org/systemtap/wiki/WSFutexContention
[root@doppio ~]# perf trace futex-contention
Press control+C to stop and show the summary
^Cnpviewer.bin[15242] lock 7f0a8be19104 contended 29 times, 72806 avg ns
npviewer.bin[15242] lock 7f0a8be19130 contended 2 times, 1355 avg ns
synergyc[17245] lock f127f4 contended 1 times, 1830569 avg ns
firefox[15116] lock 7f2b7238af0c contended 168 times, 1230390 avg ns
synergyc[17245] lock f2fc20 contended 1 times, 33149 avg ns
npviewer.bin[15255] lock 7f0a8be19074 contended 155 times, 73047 avg ns
npviewer.bin[15255] lock 7f0a8be190a0 contended 127 times, 7088 avg ns
synergyc[17247] lock f12854 contended 1 times, 46741 avg ns
synergyc[17245] lock f12610 contended 1 times, 7358 avg ns
[root@doppio ~]#Cc: Frederic Weisbecker
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo -
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo
26 Oct, 2010
5 commits
-
Where we don't have the audit.MACH_ARMEB constant.
Cc: David S. Miller
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo -
. Print message at script start telling how to get te summary
. Print the syscall names
. Accept both pid (if numeric) or COMM nameNow it looks like this:
[root@emilia tmp]# perf trace syscall-counts-by-pid
Press control+C to stop and show the summary
^C
syscall events by comm/pid:comm [pid]/syscalls count
---------------------------------------- ----------automount [1670]
futex 2sshd [2322]
rt_sigprocmask 4
select 2
write 1
read 1perf [15178]
read 2506
open 794
close 769
write 240
getdents 112
lseek 16
stat 9
perf_counter_open 5
fcntl 5
mmap 5
statfs 2perf [15179]
read 56701
open 499
stat 176
fstat 149
close 109
mmap 98
brk 75
rt_sigaction 66
munmap 42
mprotect 24
lstat 7
lseek 5
getdents 4
ioctl 3
readlink 2
futex 1
statfs 1
getegid 1
geteuid 1
getgid 1
getuid 1
getrlimit 1
fcntl 1
uname 1
write 1
[root@emilia tmp]# fg
-bash: fg: current: no such job
[root@emilia tmp]# perf trace syscall-counts-by-pid 2322
Press control+C to stop and show the summary
^C
syscall events by comm/pid:comm [pid]/syscalls count
---------------------------------------- ----------sshd [2322]
rt_sigprocmask 4
select 2
write 1
read 1
[root@emilia tmp]# perf trace syscall-counts-by-pid sshd
Press control+C to stop and show the summary
^C
syscall events for sshd:comm [pid]/syscalls count
---------------------------------------- ----------sshd [2322]
rt_sigprocmask 4
select 2
write 1
read 1
[root@emilia tmp]#Cc: David S. Miller
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo -
[root@emilia tmp]# perf trace sctop 1
syscall events:event count
---------------------------------------- ----------
read 215400
futex 4029
write 376
brk 33
rt_sigprocmask 24
select 17
lseek 2
fsync 1
^C[root@emilia tmp]#Cc: David S. Miller
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo -
. Print message at script start telling how to get te summary
. Print the syscall nameNow it looks like this:
[root@emilia ~]# perf trace syscall-counts
Press control+C to stop and show the summary
^C
syscall events:event count
---------------------------------------- -----------
read 102752
open 1293
close 878
write 319
stat 185
fstat 149
getdents 116
mmap 98
brk 80
rt_sigaction 66
munmap 42
mprotect 24
lseek 21
lstat 7
rt_sigprocmask 4
futex 3
statfs 3
ioctl 3
readlink 2
select 2
getegid 1
geteuid 1
getgid 1
getuid 1
getrlimit 1
fcntl 1
uname 1
[root@emilia ~]#Cc: David S. Miller
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo -
. Print message at script start telling how to get te summary
. Print the syscall name using the audit-lib-python package, if
installed
. Print the errno string
. Accept both pid (if numeric) or COMM nameNow it looks like this:
[root@emilia ~]# perf trace failed-syscalls-by-pid
Press control+C to stop and show the summary
^C
syscall errors:comm [pid] count
------------------------------ ----------automount [1670]
syscall: futex
err = ETIMEDOUT 39irqbalance [1462]
syscall: openat
err = ENOENT 4perf [7888]
syscall: lseek
err = ESPIPE 1
syscall: open
err = ENOENT 24perf [7889]
syscall: ioctl
err = EINVAL 1
syscall: readlink
err = EINVAL 2
syscall: open
err = ENOENT 389
syscall: stat
err = ENOENT 141
syscall: lseek
err = ESPIPE 3
[root@emilia ~]#[root@emilia ~]# perf trace failed-syscalls-by-pid 1670
Press control+C to stop and show the summary
^C
syscall errors:comm [pid] count
------------------------------ ----------automount [1670]
syscall: futex
err = ETIMEDOUT 2
[root@emilia ~]#
[root@emilia ~]#
[root@emilia ~]#
[root@emilia ~]# perf trace failed-syscalls-by-pid automount
Press control+C to stop and show the summary
^C
syscall errors for automount:comm [pid] count
------------------------------ ----------automount [1669]
syscall: futex
err = ETIMEDOUT 1automount [1670]
syscall: futex
err = ETIMEDOUT 5
[root@emilia ~]#Cc: David S. Miller
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo
24 Oct, 2010
1 commit
-
Set $PERF_EXEC_PATH before starting the record and report scripts, and
make them use it where necessary.Cc: Ingo Molnar
Cc: Paul Mackerras
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ben Hutchings
Signed-off-by: Arnaldo Carvalho de Melo
08 Sep, 2010
1 commit
-
Add a perf script which shows packets processing and processed
time. It helps us to investigate networking or network devices.If you want to use it, install perf and record perf.data like
following.If you set script, perf gathers records until it ends.
If not, you must Ctrl-C to stop recording.And if you want a report from record,
If you use some options, you can limit the output.
Option is below.tx: show only tx packets processing
rx: show only rx packets processing
dev=: show processing on this device
debug: work with debug mode. It shows buffer status.For example, if you want to show received packets processing
associated with eth4,106133.171439sec cpu=0
irq_entry(+0.000msec irq=24:eth4)
|
softirq_entry(+0.006msec)
|
|---netif_receive_skb(+0.010msec skb=f2d15900 len=100)
| |
| skb_copy_datagram_iovec(+0.039msec 10291::10291)
|
napi_poll_exit(+0.022msec eth4)This perf script helps us to analyze the processing time of a
transmit/receive sequence.Signed-off-by: Koki Sanagi
Acked-by: David S. Miller
Cc: Neil Horman
Cc: Mathieu Desnoyers
Cc: Kaneshige Kenji
Cc: Izumo Taku
Cc: Kosaki Motohiro
Cc: Lai Jiangshan
Cc: Scott Mcmillan
Cc: Steven Rostedt
Cc: Eric Dumazet
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Frederic Weisbecker
02 Aug, 2010
9 commits
-
Librarize the task state and event headers helpers as they can
be generally useful.Signed-off-by: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Nikhil Rao
Cc: Tom Zanussi -
Export the GUI facility in the common library path. It is
going to be useful for other scheduler views.Signed-off-by: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Nikhil Rao
Cc: Tom Zanussi -
Make the perf migration GUI generic so that it can be reused for
other kinds of trace painting. No more notion of CPUs or runqueue
from the GUI class, it's now used as a library by the trace parser.Signed-off-by: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Nikhil Rao
Cc: Tom Zanussi -
With scheduler traces covering more than two cpus, rectangles
of the CPUs 3 and more are not visibles.This makes the vertical navigation scrollable so that all of the
CPUs rectangles are available.We also want to be able to zoom vertically, so that we can fit at
best the screen with CPU rectangles, but that's for later.Signed-off-by: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Nikhil Rao
Cc: Tom Zanussi -
Without vertical zoom, it is not possible to see all CPUs in a trace
taken on a larger machine. This patch parameterizes the height and
spacing of CPUs so that you can fit more cpus into the screen.Ideally we should dynamically size/space the CPU rectangles with some
minimum threshold. Until then, this patch is a stop-gap.Signed-off-by: Nikhil Rao
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Tom Zanussi
Signed-off-by: Frederic Weisbecker -
EVT_KEY_DOWN and EVT_LEFT_DOWN events are not bound to the RootFrame
event handler. As a result, zoom/scroll via keyboard events do not
work. This patch adds the missing bindings.Signed-off-by: Nikhil Rao
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Tom Zanussi
Signed-off-by: Frederic Weisbecker -
Stop printing an error message when we don't have the letter
for a given task state. All we need to know is if the task is
in the TASK_RUNNING state.Signed-off-by: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Nikhil Rao
Cc: Tom Zanussi -
Migrate out events may happen on tasks that are not in the
runqueue, for example this is the case for tasks that are
sleeping. In this case, we don't want to log the migrate out
event in the source runqueue because the task is not eventually
in the runqueue and we have already logged its sleep event.This fixes timeslices that spuriously propagate a sleep event
from the previous timeslice.Signed-off-by: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Nikhil Rao
Cc: Tom Zanussi -
This brings a GUI tool that displays an overview of the load
of tasks proportion in each CPUs.The CPUs forward progress is cut in timeslices. A new timeslice
is created for every runqueue event: a task gets pushed out or
pulled in the runqueue.For each timeslice, every CPUs rectangle is colored with a red
power that describes the local load against the total load.
This more red is the rectangle, the higher is the given CPU load.
This load is the number of tasks running on the CPU, without
any distinction against the scheduler policy of the tasks, for
now.Also for each timeslice, the event origin is depicted on the
CPUs that triggered it using a thin colored line on top of the
rectangle timeslice.These events are:
* sleep: a task went to sleep and has then been pulled out the
runqueue. The origin color in the thin line is dark blue.* wake up: a task woke up and has then been pushed in the
runqueue. The origin color is yellow.* wake up new: a new task woke up and has then been pushed in the
runqueue. The origin color is green.* migrate in: a task migrated in the runqueue due to a load
balancing operation. The origin color is violet.* migrate out: reverse of the previous one. Migrate in events
usually have paired migrate out events in another runqueue.
The origin color is light blue.Clicking on a timeslice provides the runqueue event details
and the runqueue state.The CPU rectangles can be navigated using the usual arrow
controls. Horizontal zooming in/out is possible with the
"+" and "-" buttons.Signed-off-by: Frederic Weisbecker
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Li Zefan
Cc: Steven Rostedt
Cc: Tom Zanussi
Cc: Mike Galbraith
Cc: Venkatesh Pallipadi
Cc: Pierre Tardy
Cc: Nikhil Rao
Cc: Li Zefan
01 Jun, 2010
1 commit
-
trace_unhandled() callback does not allow to access event fields, this patch
resolves the problem.It can also been used as a more pythonic and flexible way for script writters
to demux event typesThis will for example greatly simplify pytimechart event demux.
Acked-by: Frederic Weisbecker
Acked-by: Tom Zanussi
Cc: Ingo Molnar ,
Cc: Frederic Weisbecker
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Pierre Tardy
Signed-off-by: Arnaldo Carvalho de Melo
11 May, 2010
8 commits
-
A small fix for the syscall counts script:
- silence the match output in the shell script
Cc: Frédéric Weisbecker
Cc: Ingo Molnar
LKML-Reference:
Signed-off-by: Tom Zanussi
Signed-off-by: Arnaldo Carvalho de Melo -
A small fix for the syscall counts by pid script:
- silence the match output in the shell script
Cc: Frédéric Weisbecker
Cc: Ingo Molnar
LKML-Reference:
Signed-off-by: Tom Zanussi
Signed-off-by: Arnaldo Carvalho de Melo -
A small fixe for the failed syscalls by pid script:
- silence the match output in the shell script
Cc: Frédéric Weisbecker
Cc: Ingo Molnar
LKML-Reference:
Signed-off-by: Tom Zanussi
Signed-off-by: Arnaldo Carvalho de Melo -
Some minor fixes for the workqueue-stats script:
- Fix nuisance 'use of uninitialized value' warnings
Cc: Frédéric Weisbecker
Cc: Ingo Molnar
LKML-Reference:
Signed-off-by: Tom Zanussi
Signed-off-by: Arnaldo Carvalho de Melo -
Some minor fixes for the wakeup-latency script:
- Fix nuisance 'use of uninitialized value' warnings
- Avoid divide-by-zero error
Cc: Frédéric Weisbecker
Cc: Ingo Molnar
LKML-Reference:
Signed-off-by: Tom Zanussi
Signed-off-by: Arnaldo Carvalho de Melo -
A couple of fixes for the rwtop script:
- printing the totals and clearing the hashes in the signal handler
eventually leads to various random and serious problems when running
the rwtop script continuously. Moving the print_totals() calls to
the event handlers solves that problem, and the event handlers are
invoked frequently enough that it doesn't affect the timeliness of
the output.- Fix nuisance 'use of uninitialized value' warnings
Cc: Frédéric Weisbecker
Cc: Ingo Molnar
Message-Id:
Signed-off-by: Tom Zanussi
Signed-off-by: Arnaldo Carvalho de Melo -
Some minor fixes for the rw-by-pid script:
- Fix nuisance 'use of uninitialized value' warnings
- Change the failed read/write sections to sort by error counts
Cc: Frédéric Weisbecker
Cc: Ingo Molnar
LKML-Reference:
Signed-off-by: Tom Zanussi
Signed-off-by: Arnaldo Carvalho de Melo -
A couple small fixes for the failed syscalls script:
- The script description says it can be restricted to a specific comm,
make it so.- silence the match output in the shell script
Cc: Frédéric Weisbecker
Cc: Ingo Molnar
LKML-Reference:
Signed-off-by: Tom Zanussi
Signed-off-by: Arnaldo Carvalho de Melo
01 May, 2010
1 commit
-
-f, -c 1, -R are now useless for trace events recording, moreover
-M is useless and event hurts.Remove them from the documentation examples and from record scripts.
Signed-off-by: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Tom Zanussi
14 Apr, 2010
2 commits
-
It should be possible to run any perf trace script in 'live
mode'. This requires being able to pass in e.g. '-i -' or other
args, which the current shell scripts aren't equipped to handle.
In a few cases, there are required or optional args that also
need special handling. This patch makes changes the current set
of shell scripts as necessary.Signed-off-by: Tom Zanussi
Acked-by: Thomas Gleixner
Cc: fweisbec@gmail.com
Cc: rostedt@goodmis.org
Cc: k-keiichi@bx.jp.nec.com
Cc: acme@ghostprotocols.net
LKML-Reference:
Signed-off-by: Ingo Molnar -
A couple of scripts, one in Python and the other in Perl, that
demonstrate 'live mode' tracing. For each, the output of the
perf event stream is fed continuously to the script, which
continuously aggregates the data and reports the current results
every 3 seconds, or at the optionally specified interval. After
the current results are displayed, the aggregations are cleared
and the cycle begins anew.To run the scripts, simply pipe the output of the 'perf trace
record' step as input to the corresponding 'perf trace report'
step, using '-' as the filename to -o and -i:$ perf trace record sctop -o - | perf trace report sctop -i -
Also adds clear_term() utility functions to the Util.pm and
Util.py utility modules, for use by any script to clear the
screen.Signed-off-by: Tom Zanussi
Acked-by: Thomas Gleixner
Cc: fweisbec@gmail.com
Cc: rostedt@goodmis.org
Cc: k-keiichi@bx.jp.nec.com
Cc: acme@ghostprotocols.net
LKML-Reference:
Signed-off-by: Ingo Molnar
25 Feb, 2010
2 commits
-
Adds a set of scripts that aggregate system call totals and system
call errors. Most are Python scripts that also test basic
functionality of the new Python engine, but there's also one Perl
script added for comparison and for reference in some new
Documentation contained in a later patch.Signed-off-by: Tom Zanussi
Cc: Ingo Molnar
Cc: Steven Rostedt
Cc: Keiichi KII
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Frederic Weisbecker -
Add base support for Python scripting to perf trace.
Signed-off-by: Tom Zanussi
Cc: Ingo Molnar
Cc: Steven Rostedt
Cc: Keiichi KII
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Frederic Weisbecker
24 Feb, 2010
3 commits
-
The check-perf-trace script only checks Perl functionality, and
doesn't really need to be listed as as user script anyway.This only removes the '-report' shell script, so although it doesn't
appear in the listing, the '-record' shell script and the check perf
trace perl script itself is still available and can still be run
manually as such:$ libexec/perf-core/scripts/perl/bin/check-perf-trace-record
$ perf trace -s libexec/perf-core/scripts/perl/check-perf-trace.plSigned-off-by: Tom Zanussi
Cc: Ingo Molnar
Cc: Steven Rostedt
Cc: Keiichi KII
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Frederic Weisbecker -
This stuff is needed by all scripting engines; move it from the Perl
engine source to a more common place.Signed-off-by: Tom Zanussi
Cc: Ingo Molnar
Cc: Steven Rostedt
Cc: Keiichi KII
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Frederic Weisbecker -
Fix bogus calculation.
Signed-off-by: Tom Zanussi
Cc: Ingo Molnar
Cc: Steven Rostedt
Cc: Keiichi KII
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Frederic Weisbecker
15 Dec, 2009
1 commit
-
Lists the available perf trace scripts, one per line e.g.:
root@tropicana:~# perf trace -l
List of available trace scripts:
workqueue-stats workqueue stats (ins/exe/create/destroy)
wakeup-latency system-wide min/max/avg wakeup latency
rw-by-file r/w activity for a program, by file
check-perf-trace useless but exhaustive test script
rw-by-pid system-wide r/w activityTo be consistent with the other listing options in perf, the
current latency trace option was changed to '-L', and '-l' is
now used to access the script listing as:To create the list, it searches each scripts/*/bin directory for
files ending with "-report" and reads information found in
certain comment lines contained in those shell scripts:- if the comment line starts with "description:", the rest of the
line is used as a 'half-line' description. To keep each line in
the list to a single line, the description should be limited to 40
characters (the rest of the line contains the script name and
args)- if the comment line starts with "args:", the rest of the line
names the args the script supports. Required args should be
surrounded by <> brackets, optional args by [] brackets.The current scripts in scripts/perl/bin have also been updated
with description: and args: comments.Signed-off-by: Tom Zanussi
Cc: fweisbec@gmail.com
Cc: rostedt@goodmis.org
LKML-Reference:
Signed-off-by: Ingo Molnar