-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf trace/scripting: Enable scripting shell scripts for live mode
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 <tzanussi@gmail.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: fweisbec@gmail.com Cc: rostedt@goodmis.org Cc: k-keiichi@bx.jp.nec.com Cc: acme@ghostprotocols.net LKML-Reference: <1270184365-8281-11-git-send-email-tzanussi@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
- Loading branch information
Tom Zanussi
authored and
Ingo Molnar
committed
Apr 14, 2010
1 parent
47902f3
commit 00b21a0
Showing
16 changed files
with
47 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
perf record -c 1 -f -a -M -R -e raw_syscalls:sys_exit | ||
perf record -c 1 -f -a -M -R -e raw_syscalls:sys_exit $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
#!/bin/bash | ||
# description: system-wide failed syscalls | ||
# args: [comm] | ||
perf trace -s ~/libexec/perf-core/scripts/perl/failed-syscalls.pl $1 | ||
if [ $# -gt 0 ] ; then | ||
if ! expr match "$1" "-" ; then | ||
comm=$1 | ||
shift | ||
fi | ||
fi | ||
perf trace $@ -s ~/libexec/perf-core/scripts/perl/failed-syscalls.pl $comm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/bin/bash | ||
perf record -c 1 -f -a -M -R -e syscalls:sys_enter_read -e syscalls:sys_enter_write | ||
perf record -c 1 -f -a -M -R -e syscalls:sys_enter_read -e syscalls:sys_enter_write $@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
#!/bin/bash | ||
# description: r/w activity for a program, by file | ||
# args: <comm> | ||
perf trace -s ~/libexec/perf-core/scripts/perl/rw-by-file.pl $1 | ||
if [ $# -lt 1 ] ; then | ||
echo "usage: rw-by-file <comm>" | ||
exit | ||
fi | ||
comm=$1 | ||
shift | ||
perf trace $@ -s ~/libexec/perf-core/scripts/perl/rw-by-file.pl $comm | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
perf record -c 1 -f -a -M -R -e syscalls:sys_enter_read -e syscalls:sys_exit_read -e syscalls:sys_enter_write -e syscalls:sys_exit_write | ||
perf record -c 1 -f -a -M -R -e syscalls:sys_enter_read -e syscalls:sys_exit_read -e syscalls:sys_enter_write -e syscalls:sys_exit_write $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
# description: system-wide r/w activity | ||
perf trace -s ~/libexec/perf-core/scripts/perl/rw-by-pid.pl | ||
perf trace $@ -s ~/libexec/perf-core/scripts/perl/rw-by-pid.pl | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
# description: system-wide min/max/avg wakeup latency | ||
perf trace -s ~/libexec/perf-core/scripts/perl/wakeup-latency.pl | ||
perf trace $@ -s ~/libexec/perf-core/scripts/perl/wakeup-latency.pl | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
perf record -c 1 -f -a -M -R -e workqueue:workqueue_creation -e workqueue:workqueue_destruction -e workqueue:workqueue_execution -e workqueue:workqueue_insertion | ||
perf record -c 1 -f -a -M -R -e workqueue:workqueue_creation -e workqueue:workqueue_destruction -e workqueue:workqueue_execution -e workqueue:workqueue_insertion $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
perf record -c 1 -f -a -M -R -e raw_syscalls:sys_exit | ||
perf record -c 1 -f -a -M -R -e raw_syscalls:sys_exit $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
#!/bin/bash | ||
# description: system-wide failed syscalls, by pid | ||
# args: [comm] | ||
perf trace -s ~/libexec/perf-core/scripts/python/failed-syscalls-by-pid.py $1 | ||
if [ $# -gt 0 ] ; then | ||
if ! expr match "$1" "-" ; then | ||
comm=$1 | ||
shift | ||
fi | ||
fi | ||
perf trace $@ -s ~/libexec/perf-core/scripts/python/failed-syscalls-by-pid.py $comm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
perf record -c 1 -f -a -M -R -e raw_syscalls:sys_enter | ||
perf record -c 1 -f -a -M -R -e raw_syscalls:sys_enter $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
#!/bin/bash | ||
# description: system-wide syscall counts, by pid | ||
# args: [comm] | ||
perf trace -s ~/libexec/perf-core/scripts/python/syscall-counts-by-pid.py $1 | ||
if [ $# -gt 0 ] ; then | ||
if ! expr match "$1" "-" ; then | ||
comm=$1 | ||
shift | ||
fi | ||
fi | ||
perf trace $@ -s ~/libexec/perf-core/scripts/python/syscall-counts-by-pid.py $comm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
perf record -c 1 -f -a -M -R -e raw_syscalls:sys_enter | ||
perf record -c 1 -f -a -M -R -e raw_syscalls:sys_enter $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
#!/bin/bash | ||
# description: system-wide syscall counts | ||
# args: [comm] | ||
perf trace -s ~/libexec/perf-core/scripts/python/syscall-counts.py $1 | ||
if [ $# -gt 0 ] ; then | ||
if ! expr match "$1" "-" ; then | ||
comm=$1 | ||
shift | ||
fi | ||
fi | ||
perf trace $@ -s ~/libexec/perf-core/scripts/python/syscall-counts.py $comm |