LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] perf-trace/scripting: script fixes
@ 2010-05-10  4:46 Tom Zanussi
  2010-05-10  4:46 ` [PATCH 1/9] perf/trace/scripting: failed-syscalls script cleanup Tom Zanussi
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Tom Zanussi @ 2010-05-10  4:46 UTC (permalink / raw
  To: linux-kernel; +Cc: mingo, fweisbec, acme

While testing the new 'trace events reordering' patches, I noticed
some problems with the current set of scripts, mostly annoying warning
messages, but a couple of real problems too.

Another annoyance, which I moved to verbose mode, was the display of
the script name on each invocation.

Anyway, after testing all the scripts in both normal and live mode, I
haven't seen any problems with the new event reordering patches...

Tom Zanussi (9):
  perf/trace/scripting: failed-syscalls script cleanup
  perf/trace/scripting: rw-by-pid script cleanup
  perf/trace/scripting: rwtop script cleanup
  perf/trace/scripting: wakeup-latency script cleanup
  perf/trace/scripting: workqueue-stats script cleanup
  perf/trace/scripting: don't show script start/stop messages by
    default
  perf/trace/scripting: failed-syscalls-by-pid script cleanup
  perf/trace/scripting: syscall-counts-by-pid script cleanup
  perf/trace/scripting: syscall-counts script cleanup

 tools/perf/builtin-trace.c                         |    3 +
 tools/perf/scripts/perl/bin/failed-syscalls-report |    2 +-
 tools/perf/scripts/perl/failed-syscalls.pl         |    6 ++-
 tools/perf/scripts/perl/rw-by-pid.pl               |   60 ++++++++++++--------
 tools/perf/scripts/perl/rwtop.pl                   |   48 +++++++++++----
 tools/perf/scripts/perl/wakeup-latency.pl          |   12 +++-
 tools/perf/scripts/perl/workqueue-stats.pl         |   12 ++--
 .../python/bin/failed-syscalls-by-pid-report       |    2 +-
 .../python/bin/syscall-counts-by-pid-report        |    2 +-
 .../perf/scripts/python/bin/syscall-counts-report  |    2 +-
 .../perf/util/scripting-engines/trace-event-perl.c |    3 -
 .../util/scripting-engines/trace-event-python.c    |    4 -
 12 files changed, 98 insertions(+), 58 deletions(-)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/9] perf/trace/scripting: failed-syscalls script cleanup
  2010-05-10  4:46 [PATCH 0/9] perf-trace/scripting: script fixes Tom Zanussi
@ 2010-05-10  4:46 ` Tom Zanussi
  2010-05-10  4:46 ` [PATCH 2/9] perf/trace/scripting: rw-by-pid " Tom Zanussi
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tom Zanussi @ 2010-05-10  4:46 UTC (permalink / raw
  To: linux-kernel; +Cc: mingo, fweisbec, acme

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

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
---
 tools/perf/scripts/perl/bin/failed-syscalls-report |    2 +-
 tools/perf/scripts/perl/failed-syscalls.pl         |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/scripts/perl/bin/failed-syscalls-report b/tools/perf/scripts/perl/bin/failed-syscalls-report
index f634608..e3a5e55 100644
--- a/tools/perf/scripts/perl/bin/failed-syscalls-report
+++ b/tools/perf/scripts/perl/bin/failed-syscalls-report
@@ -2,7 +2,7 @@
 # description: system-wide failed syscalls
 # args: [comm]
 if [ $# -gt 0 ] ; then
-    if ! expr match "$1" "-" ; then
+    if ! expr match "$1" "-" > /dev/null ; then
 	comm=$1
 	shift
     fi
diff --git a/tools/perf/scripts/perl/failed-syscalls.pl b/tools/perf/scripts/perl/failed-syscalls.pl
index c18e7e2..94bc25a 100644
--- a/tools/perf/scripts/perl/failed-syscalls.pl
+++ b/tools/perf/scripts/perl/failed-syscalls.pl
@@ -11,6 +11,8 @@ use Perf::Trace::Core;
 use Perf::Trace::Context;
 use Perf::Trace::Util;
 
+my $for_comm = shift;
+
 my %failed_syscalls;
 
 sub raw_syscalls::sys_exit
@@ -33,6 +35,8 @@ sub trace_end
 
     foreach my $comm (sort {$failed_syscalls{$b} <=> $failed_syscalls{$a}}
 		      keys %failed_syscalls) {
-	    printf("%-20s  %10s\n", $comm, $failed_syscalls{$comm});
+	next if ($for_comm && $comm ne $for_comm);
+
+	printf("%-20s  %10s\n", $comm, $failed_syscalls{$comm});
     }
 }
-- 
1.6.4.GIT


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/9] perf/trace/scripting: rw-by-pid script cleanup
  2010-05-10  4:46 [PATCH 0/9] perf-trace/scripting: script fixes Tom Zanussi
  2010-05-10  4:46 ` [PATCH 1/9] perf/trace/scripting: failed-syscalls script cleanup Tom Zanussi
@ 2010-05-10  4:46 ` Tom Zanussi
  2010-05-10  4:46 ` [PATCH 3/9] perf/trace/scripting: rwtop " Tom Zanussi
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tom Zanussi @ 2010-05-10  4:46 UTC (permalink / raw
  To: linux-kernel; +Cc: mingo, fweisbec, acme

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

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
---
 tools/perf/scripts/perl/rw-by-pid.pl |   60 +++++++++++++++++++++-------------
 1 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/tools/perf/scripts/perl/rw-by-pid.pl b/tools/perf/scripts/perl/rw-by-pid.pl
index da601fa..9db23c9 100644
--- a/tools/perf/scripts/perl/rw-by-pid.pl
+++ b/tools/perf/scripts/perl/rw-by-pid.pl
@@ -79,12 +79,12 @@ sub trace_end
     printf("%6s  %-20s  %10s  %10s  %10s\n", "------", "--------------------",
 	   "-----------", "----------", "----------");
 
-    foreach my $pid (sort {$reads{$b}{bytes_read} <=>
-			       $reads{$a}{bytes_read}} keys %reads) {
-	my $comm = $reads{$pid}{comm};
-	my $total_reads = $reads{$pid}{total_reads};
-	my $bytes_requested = $reads{$pid}{bytes_requested};
-	my $bytes_read = $reads{$pid}{bytes_read};
+    foreach my $pid (sort { ($reads{$b}{bytes_read} || 0) <=>
+				($reads{$a}{bytes_read} || 0) } keys %reads) {
+	my $comm = $reads{$pid}{comm} || "";
+	my $total_reads = $reads{$pid}{total_reads} || 0;
+	my $bytes_requested = $reads{$pid}{bytes_requested} || 0;
+	my $bytes_read = $reads{$pid}{bytes_read} || 0;
 
 	printf("%6s  %-20s  %10s  %10s  %10s\n", $pid, $comm,
 	       $total_reads, $bytes_requested, $bytes_read);
@@ -96,16 +96,23 @@ sub trace_end
     printf("%6s  %20s  %6s  %10s\n", "------", "--------------------",
 	   "------", "----------");
 
-    foreach my $pid (keys %reads) {
-	my $comm = $reads{$pid}{comm};
-	foreach my $err (sort {$reads{$b}{comm} cmp $reads{$a}{comm}}
-			 keys %{$reads{$pid}{errors}}) {
-	    my $errors = $reads{$pid}{errors}{$err};
+    my @errcounts = ();
 
-	    printf("%6d  %-20s  %6d  %10s\n", $pid, $comm, $err, $errors);
+    foreach my $pid (keys %reads) {
+	foreach my $error (keys %{$reads{$pid}{errors}}) {
+	    my $comm = $reads{$pid}{comm} || "";
+	    my $errcount = $reads{$pid}{errors}{$error} || 0;
+	    push @errcounts, [$pid, $comm, $error, $errcount];
 	}
     }
 
+    @errcounts = sort { $b->[3] <=> $a->[3] } @errcounts;
+
+    for my $i (0 .. $#errcounts) {
+	printf("%6d  %-20s  %6d  %10s\n", $errcounts[$i][0],
+	       $errcounts[$i][1], $errcounts[$i][2], $errcounts[$i][3]);
+    }
+
     printf("\nwrite counts by pid:\n\n");
 
     printf("%6s  %20s  %10s  %10s\n", "pid", "comm",
@@ -113,11 +120,11 @@ sub trace_end
     printf("%6s  %-20s  %10s  %10s\n", "------", "--------------------",
 	   "-----------", "----------");
 
-    foreach my $pid (sort {$writes{$b}{bytes_written} <=>
-			       $writes{$a}{bytes_written}} keys %writes) {
-	my $comm = $writes{$pid}{comm};
-	my $total_writes = $writes{$pid}{total_writes};
-	my $bytes_written = $writes{$pid}{bytes_written};
+    foreach my $pid (sort { ($writes{$b}{bytes_written} || 0) <=>
+			($writes{$a}{bytes_written} || 0)} keys %writes) {
+	my $comm = $writes{$pid}{comm} || "";
+	my $total_writes = $writes{$pid}{total_writes} || 0;
+	my $bytes_written = $writes{$pid}{bytes_written} || 0;
 
 	printf("%6s  %-20s  %10s  %10s\n", $pid, $comm,
 	       $total_writes, $bytes_written);
@@ -129,16 +136,23 @@ sub trace_end
     printf("%6s  %20s  %6s  %10s\n", "------", "--------------------",
 	   "------", "----------");
 
-    foreach my $pid (keys %writes) {
-	my $comm = $writes{$pid}{comm};
-	foreach my $err (sort {$writes{$b}{comm} cmp $writes{$a}{comm}}
-			 keys %{$writes{$pid}{errors}}) {
-	    my $errors = $writes{$pid}{errors}{$err};
+    @errcounts = ();
 
-	    printf("%6d  %-20s  %6d  %10s\n", $pid, $comm, $err, $errors);
+    foreach my $pid (keys %writes) {
+	foreach my $error (keys %{$writes{$pid}{errors}}) {
+	    my $comm = $writes{$pid}{comm} || "";
+	    my $errcount = $writes{$pid}{errors}{$error} || 0;
+	    push @errcounts, [$pid, $comm, $error, $errcount];
 	}
     }
 
+    @errcounts = sort { $b->[3] <=> $a->[3] } @errcounts;
+
+    for my $i (0 .. $#errcounts) {
+	printf("%6d  %-20s  %6d  %10s\n", $errcounts[$i][0],
+	       $errcounts[$i][1], $errcounts[$i][2], $errcounts[$i][3]);
+    }
+
     print_unhandled();
 }
 
-- 
1.6.4.GIT


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/9] perf/trace/scripting: rwtop script cleanup
  2010-05-10  4:46 [PATCH 0/9] perf-trace/scripting: script fixes Tom Zanussi
  2010-05-10  4:46 ` [PATCH 1/9] perf/trace/scripting: failed-syscalls script cleanup Tom Zanussi
  2010-05-10  4:46 ` [PATCH 2/9] perf/trace/scripting: rw-by-pid " Tom Zanussi
@ 2010-05-10  4:46 ` Tom Zanussi
  2010-05-10  4:46 ` [PATCH 4/9] perf/trace/scripting: wakeup-latency " Tom Zanussi
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tom Zanussi @ 2010-05-10  4:46 UTC (permalink / raw
  To: linux-kernel; +Cc: mingo, fweisbec, acme

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

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
---
 tools/perf/scripts/perl/rwtop.pl |   48 +++++++++++++++++++++++++++----------
 1 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/tools/perf/scripts/perl/rwtop.pl b/tools/perf/scripts/perl/rwtop.pl
index ec2ab49..4bb3ecd 100644
--- a/tools/perf/scripts/perl/rwtop.pl
+++ b/tools/perf/scripts/perl/rwtop.pl
@@ -21,6 +21,7 @@ use Perf::Trace::Util;
 my $default_interval = 3;
 my $nlines = 20;
 my $print_thread;
+my $print_pending = 0;
 
 my %reads;
 my %writes;
@@ -36,6 +37,8 @@ sub syscalls::sys_exit_read
 	$common_pid, $common_comm,
 	$nr, $ret) = @_;
 
+    print_check();
+
     if ($ret > 0) {
 	$reads{$common_pid}{bytes_read} += $ret;
     } else {
@@ -52,6 +55,8 @@ sub syscalls::sys_enter_read
 	$common_pid, $common_comm,
 	$nr, $fd, $buf, $count) = @_;
 
+    print_check();
+
     $reads{$common_pid}{bytes_requested} += $count;
     $reads{$common_pid}{total_reads}++;
     $reads{$common_pid}{comm} = $common_comm;
@@ -63,6 +68,8 @@ sub syscalls::sys_exit_write
 	$common_pid, $common_comm,
 	$nr, $ret) = @_;
 
+    print_check();
+
     if ($ret <= 0) {
 	$writes{$common_pid}{errors}{$ret}++;
     }
@@ -74,6 +81,8 @@ sub syscalls::sys_enter_write
 	$common_pid, $common_comm,
 	$nr, $fd, $buf, $count) = @_;
 
+    print_check();
+
     $writes{$common_pid}{bytes_written} += $count;
     $writes{$common_pid}{total_writes}++;
     $writes{$common_pid}{comm} = $common_comm;
@@ -81,7 +90,7 @@ sub syscalls::sys_enter_write
 
 sub trace_begin
 {
-    $SIG{ALRM} = \&print_totals;
+    $SIG{ALRM} = \&set_print_pending;
     alarm 1;
 }
 
@@ -91,6 +100,20 @@ sub trace_end
     print_totals();
 }
 
+sub print_check()
+{
+    if ($print_pending == 1) {
+	$print_pending = 0;
+	print_totals();
+    }
+}
+
+sub set_print_pending()
+{
+    $print_pending = 1;
+    alarm $interval;
+}
+
 sub print_totals
 {
     my $count;
@@ -106,12 +129,12 @@ sub print_totals
     printf("%6s  %-20s  %10s  %10s  %10s\n", "------", "--------------------",
 	   "----------", "----------", "----------");
 
-    foreach my $pid (sort {$reads{$b}{bytes_read} <=>
-			       $reads{$a}{bytes_read}} keys %reads) {
-	my $comm = $reads{$pid}{comm};
-	my $total_reads = $reads{$pid}{total_reads};
-	my $bytes_requested = $reads{$pid}{bytes_requested};
-	my $bytes_read = $reads{$pid}{bytes_read};
+    foreach my $pid (sort { ($reads{$b}{bytes_read} || 0) <=>
+			       ($reads{$a}{bytes_read} || 0) } keys %reads) {
+	my $comm = $reads{$pid}{comm} || "";
+	my $total_reads = $reads{$pid}{total_reads} || 0;
+	my $bytes_requested = $reads{$pid}{bytes_requested} || 0;
+	my $bytes_read = $reads{$pid}{bytes_read} || 0;
 
 	printf("%6s  %-20s  %10s  %10s  %10s\n", $pid, $comm,
 	       $total_reads, $bytes_requested, $bytes_read);
@@ -130,11 +153,11 @@ sub print_totals
     printf("%6s  %-20s  %10s  %13s\n", "------", "--------------------",
 	   "----------", "-------------");
 
-    foreach my $pid (sort {$writes{$b}{bytes_written} <=>
-			       $writes{$a}{bytes_written}} keys %writes) {
-	my $comm = $writes{$pid}{comm};
-	my $total_writes = $writes{$pid}{total_writes};
-	my $bytes_written = $writes{$pid}{bytes_written};
+    foreach my $pid (sort { ($writes{$b}{bytes_written} || 0) <=>
+			($writes{$a}{bytes_written} || 0)} keys %writes) {
+	my $comm = $writes{$pid}{comm} || "";
+	my $total_writes = $writes{$pid}{total_writes} || 0;
+	my $bytes_written = $writes{$pid}{bytes_written} || 0;
 
 	printf("%6s  %-20s  %10s  %13s\n", $pid, $comm,
 	       $total_writes, $bytes_written);
@@ -146,7 +169,6 @@ sub print_totals
 
     %reads = ();
     %writes = ();
-    alarm $interval;
 }
 
 my %unhandled;
-- 
1.6.4.GIT


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/9] perf/trace/scripting: wakeup-latency script cleanup
  2010-05-10  4:46 [PATCH 0/9] perf-trace/scripting: script fixes Tom Zanussi
                   ` (2 preceding siblings ...)
  2010-05-10  4:46 ` [PATCH 3/9] perf/trace/scripting: rwtop " Tom Zanussi
@ 2010-05-10  4:46 ` Tom Zanussi
  2010-05-10  4:46 ` [PATCH 5/9] perf/trace/scripting: workqueue-stats " Tom Zanussi
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tom Zanussi @ 2010-05-10  4:46 UTC (permalink / raw
  To: linux-kernel; +Cc: mingo, fweisbec, acme

Some minor fixes for the wakeup-latency script:

- Fix nuisance 'use of uninitialized value' warnings

- Avoid divide-by-zero error

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
---
 tools/perf/scripts/perl/wakeup-latency.pl |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/perf/scripts/perl/wakeup-latency.pl b/tools/perf/scripts/perl/wakeup-latency.pl
index ed58ef2..d9143dc 100644
--- a/tools/perf/scripts/perl/wakeup-latency.pl
+++ b/tools/perf/scripts/perl/wakeup-latency.pl
@@ -22,8 +22,8 @@ my %last_wakeup;
 
 my $max_wakeup_latency;
 my $min_wakeup_latency;
-my $total_wakeup_latency;
-my $total_wakeups;
+my $total_wakeup_latency = 0;
+my $total_wakeups = 0;
 
 sub sched::sched_switch
 {
@@ -67,8 +67,12 @@ sub trace_end
 {
     printf("wakeup_latency stats:\n\n");
     print "total_wakeups: $total_wakeups\n";
-    printf("avg_wakeup_latency (ns): %u\n",
-	   avg($total_wakeup_latency, $total_wakeups));
+    if ($total_wakeups) {
+	printf("avg_wakeup_latency (ns): %u\n",
+	       avg($total_wakeup_latency, $total_wakeups));
+    } else {
+	printf("avg_wakeup_latency (ns): N/A\n");
+    }
     printf("min_wakeup_latency (ns): %u\n", $min_wakeup_latency);
     printf("max_wakeup_latency (ns): %u\n", $max_wakeup_latency);
 
-- 
1.6.4.GIT


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/9] perf/trace/scripting: workqueue-stats script cleanup
  2010-05-10  4:46 [PATCH 0/9] perf-trace/scripting: script fixes Tom Zanussi
                   ` (3 preceding siblings ...)
  2010-05-10  4:46 ` [PATCH 4/9] perf/trace/scripting: wakeup-latency " Tom Zanussi
@ 2010-05-10  4:46 ` Tom Zanussi
  2010-05-10  4:46 ` [PATCH 6/9] perf/trace/scripting: don't show script start/stop messages by default Tom Zanussi
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tom Zanussi @ 2010-05-10  4:46 UTC (permalink / raw
  To: linux-kernel; +Cc: mingo, fweisbec, acme

Some minor fixes for the workqueue-stats script:

- Fix nuisance 'use of uninitialized value' warnings

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
---
 tools/perf/scripts/perl/workqueue-stats.pl |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/scripts/perl/workqueue-stats.pl b/tools/perf/scripts/perl/workqueue-stats.pl
index 511302c..b84b126 100644
--- a/tools/perf/scripts/perl/workqueue-stats.pl
+++ b/tools/perf/scripts/perl/workqueue-stats.pl
@@ -71,9 +71,9 @@ sub trace_end
     printf("%3s %6s %6s\t%-20s\n", "---", "---", "----", "----");
     foreach my $pidhash (@cpus) {
 	while ((my $pid, my $wqhash) = each %$pidhash) {
-	    my $ins = $$wqhash{'inserted'};
-	    my $exe = $$wqhash{'executed'};
-	    my $comm = $$wqhash{'comm'};
+	    my $ins = $$wqhash{'inserted'} || 0;
+	    my $exe = $$wqhash{'executed'} || 0;
+	    my $comm = $$wqhash{'comm'} || "";
 	    if ($ins || $exe) {
 		printf("%3u %6u %6u\t%-20s\n", $cpu, $ins, $exe, $comm);
 	    }
@@ -87,9 +87,9 @@ sub trace_end
     printf("%3s %6s %6s\t%-20s\n", "---", "-------", "---------", "----");
     foreach my $pidhash (@cpus) {
 	while ((my $pid, my $wqhash) = each %$pidhash) {
-	    my $created = $$wqhash{'created'};
-	    my $destroyed = $$wqhash{'destroyed'};
-	    my $comm = $$wqhash{'comm'};
+	    my $created = $$wqhash{'created'} || 0;
+	    my $destroyed = $$wqhash{'destroyed'} || 0;
+	    my $comm = $$wqhash{'comm'} || "";
 	    if ($created || $destroyed) {
 		printf("%3u %6u %6u\t%-20s\n", $cpu, $created, $destroyed,
 		       $comm);
-- 
1.6.4.GIT


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/9] perf/trace/scripting: don't show script start/stop messages by default
  2010-05-10  4:46 [PATCH 0/9] perf-trace/scripting: script fixes Tom Zanussi
                   ` (4 preceding siblings ...)
  2010-05-10  4:46 ` [PATCH 5/9] perf/trace/scripting: workqueue-stats " Tom Zanussi
@ 2010-05-10  4:46 ` Tom Zanussi
  2010-05-10  4:46 ` [PATCH 7/9] perf/trace/scripting: failed-syscalls-by-pid script cleanup Tom Zanussi
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tom Zanussi @ 2010-05-10  4:46 UTC (permalink / raw
  To: linux-kernel; +Cc: mingo, fweisbec, acme

Only print the script start/stop messages in verbose mode - users
normally don't care and it just clutters up the output.

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
---
 tools/perf/builtin-trace.c                         |    3 +++
 .../perf/util/scripting-engines/trace-event-perl.c |    3 ---
 .../util/scripting-engines/trace-event-python.c    |    4 ----
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 9c483e9..cd9cffc 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -53,6 +53,8 @@ static void setup_scripting(void)
 
 static int cleanup_scripting(void)
 {
+	pr_debug("\nperf trace script stopped\n");
+
 	return scripting_ops->stop_script();
 }
 
@@ -703,6 +705,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used)
 		err = scripting_ops->start_script(script_name, argc, argv);
 		if (err)
 			goto out;
+		pr_debug("perf trace started with script %s\n\n", script_name);
 	}
 
 	err = __cmd_trace(session);
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index 5376378..b059dc5 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -371,7 +371,6 @@ static int perl_start_script(const char *script, int argc, const char **argv)
 	run_start_sub();
 
 	free(command_line);
-	fprintf(stderr, "perf trace started with Perl script %s\n\n", script);
 	return 0;
 error:
 	perl_free(my_perl);
@@ -394,8 +393,6 @@ static int perl_stop_script(void)
 	perl_destruct(my_perl);
 	perl_free(my_perl);
 
-	fprintf(stderr, "\nperf trace Perl script stopped\n");
-
 	return 0;
 }
 
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 6a72f14..81f39ca 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -374,8 +374,6 @@ static int python_start_script(const char *script, int argc, const char **argv)
 	}
 
 	free(command_line);
-	fprintf(stderr, "perf trace started with Python script %s\n\n",
-		script);
 
 	return err;
 error:
@@ -407,8 +405,6 @@ out:
 	Py_XDECREF(main_module);
 	Py_Finalize();
 
-	fprintf(stderr, "\nperf trace Python script stopped\n");
-
 	return err;
 }
 
-- 
1.6.4.GIT


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/9] perf/trace/scripting: failed-syscalls-by-pid script cleanup
  2010-05-10  4:46 [PATCH 0/9] perf-trace/scripting: script fixes Tom Zanussi
                   ` (5 preceding siblings ...)
  2010-05-10  4:46 ` [PATCH 6/9] perf/trace/scripting: don't show script start/stop messages by default Tom Zanussi
@ 2010-05-10  4:46 ` Tom Zanussi
  2010-05-10  4:46 ` [PATCH 8/9] perf/trace/scripting: syscall-counts-by-pid " Tom Zanussi
  2010-05-10  4:47 ` [PATCH 9/9] perf/trace/scripting: syscall-counts " Tom Zanussi
  8 siblings, 0 replies; 10+ messages in thread
From: Tom Zanussi @ 2010-05-10  4:46 UTC (permalink / raw
  To: linux-kernel; +Cc: mingo, fweisbec, acme

A small fixe for the failed syscalls by pid script:

- silence the match output in the shell script

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
---
 .../python/bin/failed-syscalls-by-pid-report       |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/scripts/python/bin/failed-syscalls-by-pid-report b/tools/perf/scripts/python/bin/failed-syscalls-by-pid-report
index 8c128ef..3029354 100644
--- a/tools/perf/scripts/python/bin/failed-syscalls-by-pid-report
+++ b/tools/perf/scripts/python/bin/failed-syscalls-by-pid-report
@@ -2,7 +2,7 @@
 # description: system-wide failed syscalls, by pid
 # args: [comm]
 if [ $# -gt 0 ] ; then
-    if ! expr match "$1" "-" ; then
+    if ! expr match "$1" "-" > /dev/null ; then
 	comm=$1
 	shift
     fi
-- 
1.6.4.GIT


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 8/9] perf/trace/scripting: syscall-counts-by-pid script cleanup
  2010-05-10  4:46 [PATCH 0/9] perf-trace/scripting: script fixes Tom Zanussi
                   ` (6 preceding siblings ...)
  2010-05-10  4:46 ` [PATCH 7/9] perf/trace/scripting: failed-syscalls-by-pid script cleanup Tom Zanussi
@ 2010-05-10  4:46 ` Tom Zanussi
  2010-05-10  4:47 ` [PATCH 9/9] perf/trace/scripting: syscall-counts " Tom Zanussi
  8 siblings, 0 replies; 10+ messages in thread
From: Tom Zanussi @ 2010-05-10  4:46 UTC (permalink / raw
  To: linux-kernel; +Cc: mingo, fweisbec, acme

A small fix for the syscall counts by pid script:

- silence the match output in the shell script

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
---
 .../python/bin/syscall-counts-by-pid-report        |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/scripts/python/bin/syscall-counts-by-pid-report b/tools/perf/scripts/python/bin/syscall-counts-by-pid-report
index c53362e..9e9d8dd 100644
--- a/tools/perf/scripts/python/bin/syscall-counts-by-pid-report
+++ b/tools/perf/scripts/python/bin/syscall-counts-by-pid-report
@@ -2,7 +2,7 @@
 # description: system-wide syscall counts, by pid
 # args: [comm]
 if [ $# -gt 0 ] ; then
-    if ! expr match "$1" "-" ; then
+    if ! expr match "$1" "-" > /dev/null ; then
 	comm=$1
 	shift
     fi
-- 
1.6.4.GIT


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 9/9] perf/trace/scripting: syscall-counts script cleanup
  2010-05-10  4:46 [PATCH 0/9] perf-trace/scripting: script fixes Tom Zanussi
                   ` (7 preceding siblings ...)
  2010-05-10  4:46 ` [PATCH 8/9] perf/trace/scripting: syscall-counts-by-pid " Tom Zanussi
@ 2010-05-10  4:47 ` Tom Zanussi
  8 siblings, 0 replies; 10+ messages in thread
From: Tom Zanussi @ 2010-05-10  4:47 UTC (permalink / raw
  To: linux-kernel; +Cc: mingo, fweisbec, acme

 A small fix for the syscall counts script:

- silence the match output in the shell script

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
---
 .../perf/scripts/python/bin/syscall-counts-report  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/scripts/python/bin/syscall-counts-report b/tools/perf/scripts/python/bin/syscall-counts-report
index 8c21552..dc076b6 100644
--- a/tools/perf/scripts/python/bin/syscall-counts-report
+++ b/tools/perf/scripts/python/bin/syscall-counts-report
@@ -2,7 +2,7 @@
 # description: system-wide syscall counts
 # args: [comm]
 if [ $# -gt 0 ] ; then
-    if ! expr match "$1" "-" ; then
+    if ! expr match "$1" "-" > /dev/null ; then
 	comm=$1
 	shift
     fi
-- 
1.6.4.GIT


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-05-10  4:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-10  4:46 [PATCH 0/9] perf-trace/scripting: script fixes Tom Zanussi
2010-05-10  4:46 ` [PATCH 1/9] perf/trace/scripting: failed-syscalls script cleanup Tom Zanussi
2010-05-10  4:46 ` [PATCH 2/9] perf/trace/scripting: rw-by-pid " Tom Zanussi
2010-05-10  4:46 ` [PATCH 3/9] perf/trace/scripting: rwtop " Tom Zanussi
2010-05-10  4:46 ` [PATCH 4/9] perf/trace/scripting: wakeup-latency " Tom Zanussi
2010-05-10  4:46 ` [PATCH 5/9] perf/trace/scripting: workqueue-stats " Tom Zanussi
2010-05-10  4:46 ` [PATCH 6/9] perf/trace/scripting: don't show script start/stop messages by default Tom Zanussi
2010-05-10  4:46 ` [PATCH 7/9] perf/trace/scripting: failed-syscalls-by-pid script cleanup Tom Zanussi
2010-05-10  4:46 ` [PATCH 8/9] perf/trace/scripting: syscall-counts-by-pid " Tom Zanussi
2010-05-10  4:47 ` [PATCH 9/9] perf/trace/scripting: syscall-counts " Tom Zanussi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).