From 586bc5cce88be993dad584c3936c49f945368551 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Tue, 15 Dec 2009 02:53:35 -0600 Subject: 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 Cc: fweisbec@gmail.com Cc: rostedt@goodmis.org LKML-Reference: <1260867220-15699-2-git-send-email-tzanussi@gmail.com> Signed-off-by: Ingo Molnar --- tools/perf/scripts/perl/bin/rw-by-file-report | 2 +- tools/perf/scripts/perl/rw-by-file.pl | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'tools/perf/scripts') diff --git a/tools/perf/scripts/perl/bin/rw-by-file-report b/tools/perf/scripts/perl/bin/rw-by-file-report index f5dcf9cb5bd..1c0567516ab 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 @@ #!/bin/bash -perf trace -s ~/libexec/perf-core/scripts/perl/rw-by-file.pl +perf trace -s ~/libexec/perf-core/scripts/perl/rw-by-file.pl $1 diff --git a/tools/perf/scripts/perl/rw-by-file.pl b/tools/perf/scripts/perl/rw-by-file.pl index 61f91561d84..2a39097687b 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"; use Perf::Trace::Core; use Perf::Trace::Util; -# change this to the comm of the program you're interested in -my $for_comm = "perf"; +my $usage = "perf trace -s rw-by-file.pl \n"; + +my $for_comm = shift or die $usage; my %reads; my %writes; -- cgit v1.2.3