diff options
author | Tom Zanussi <tzanussi@gmail.com> | 2009-12-15 03:53:35 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-15 04:31:31 -0500 |
commit | 586bc5cce88be993dad584c3936c49f945368551 (patch) | |
tree | f335951b59c1106918ced48a6e1242e131808225 /tools/perf/scripts | |
parent | c249a4ce796b30b742bb4854bf3039ced12ef8e5 (diff) |
perf trace/scripting: Add support for script args
One oversight of the original scripting_ops patch was a lack of
support for passing args to handler scripts. This adds
argc/argv to the start_script() scripting_op, and changes the
rw-by-file script to take 'comm' arg rather than the 'perf'
value currently hard-coded. It also takes the opportunity to do
some related minor cleanup.
Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
Cc: fweisbec@gmail.com
Cc: rostedt@goodmis.org
LKML-Reference: <1260867220-15699-2-git-send-email-tzanussi@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/scripts')
-rw-r--r-- | tools/perf/scripts/perl/bin/rw-by-file-report | 2 | ||||
-rw-r--r-- | tools/perf/scripts/perl/rw-by-file.pl | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/scripts/perl/bin/rw-by-file-report b/tools/perf/scripts/perl/bin/rw-by-file-report index f5dcf9cb5bd2..1c0567516aba 100644 --- a/tools/perf/scripts/perl/bin/rw-by-file-report +++ b/tools/perf/scripts/perl/bin/rw-by-file-report | |||
@@ -1,5 +1,5 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | perf trace -s ~/libexec/perf-core/scripts/perl/rw-by-file.pl | 2 | perf trace -s ~/libexec/perf-core/scripts/perl/rw-by-file.pl $1 |
3 | 3 | ||
4 | 4 | ||
5 | 5 | ||
diff --git a/tools/perf/scripts/perl/rw-by-file.pl b/tools/perf/scripts/perl/rw-by-file.pl index 61f91561d848..2a39097687b9 100644 --- a/tools/perf/scripts/perl/rw-by-file.pl +++ b/tools/perf/scripts/perl/rw-by-file.pl | |||
@@ -18,8 +18,9 @@ use lib "./Perf-Trace-Util/lib"; | |||
18 | use Perf::Trace::Core; | 18 | use Perf::Trace::Core; |
19 | use Perf::Trace::Util; | 19 | use Perf::Trace::Util; |
20 | 20 | ||
21 | # change this to the comm of the program you're interested in | 21 | my $usage = "perf trace -s rw-by-file.pl <comm>\n"; |
22 | my $for_comm = "perf"; | 22 | |
23 | my $for_comm = shift or die $usage; | ||
23 | 24 | ||
24 | my %reads; | 25 | my %reads; |
25 | my %writes; | 26 | my %writes; |