From 1c0f18a9730f1fa5990c79debfc1960b08c8b7cf Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 10 Dec 2008 14:49:46 -0500 Subject: Edit useful script examples. Clean up formating para-call-graph-simple.stp --- .../en-US/extras/para-callgraph-simple.stp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'doc/SystemTap_Beginners_Guide/en-US/extras') diff --git a/doc/SystemTap_Beginners_Guide/en-US/extras/para-callgraph-simple.stp b/doc/SystemTap_Beginners_Guide/en-US/extras/para-callgraph-simple.stp index 17cf50a5..1a3e2e03 100755 --- a/doc/SystemTap_Beginners_Guide/en-US/extras/para-callgraph-simple.stp +++ b/doc/SystemTap_Beginners_Guide/en-US/extras/para-callgraph-simple.stp @@ -1,39 +1,39 @@ function trace(entry_p) { - if(tid() in trace) - printf("%s%s%s\n",thread_indent(entry_p), - (entry_p>0?"->":"<-"), - probefunc()) + if(tid() in trace) + printf("%s%s%s\n",thread_indent(entry_p), + (entry_p>0?"->":"<-"), + probefunc()) } global trace probe kernel.function(@1).call { - if (execname() == "stapio") next # skip our own helper process - trace[tid()] = 1 - trace(1) + if (execname() == "stapio") next # skip our own helper process + trace[tid()] = 1 + trace(1) } probe kernel.function(@1).return { - trace(-1) - delete trace[tid()] + trace(-1) + delete trace[tid()] } probe kernel.function(@2).call { trace(1) } probe kernel.function(@2).return { trace(-1) } function trace(entry_p) { - if(tid() in trace) - printf("%s%s%s\n",thread_indent(entry_p), - (entry_p>0?"->":"<-"), - probefunc()) + if(tid() in trace) + printf("%s%s%s\n",thread_indent(entry_p), + (entry_p>0?"->":"<-"), + probefunc()) } global trace probe kernel.function(@1).call { - if (execname() == "stapio") next # skip our own helper process - trace[tid()] = 1 - trace(1) + if (execname() == "stapio") next # skip our own helper process + trace[tid()] = 1 + trace(1) } probe kernel.function(@1).return { - trace(-1) - delete trace[tid()] + trace(-1) + delete trace[tid()] } probe kernel.function(@2).call { trace(1) } -- cgit From 9a701ca695c885e9524a5f9488e1fc952d325f54 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 10 Dec 2008 14:54:14 -0500 Subject: Clean up formatting iotime-simple.stp --- doc/SystemTap_Beginners_Guide/en-US/extras/iotime-simple.stp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/SystemTap_Beginners_Guide/en-US/extras') diff --git a/doc/SystemTap_Beginners_Guide/en-US/extras/iotime-simple.stp b/doc/SystemTap_Beginners_Guide/en-US/extras/iotime-simple.stp index a14f7731..a16ee4a2 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/extras/iotime-simple.stp +++ b/doc/SystemTap_Beginners_Guide/en-US/extras/iotime-simple.stp @@ -68,10 +68,10 @@ probe syscall.write.return { probe syscall.close { if (filehandles[pid(), $fd] != "") { printf("%d %s access %s read: %d write: %d\n", timestamp(), proc(), - filehandles[pid(), $fd], fileread[pid(), $fd], filewrite[pid(), $fd]) + filehandles[pid(), $fd], fileread[pid(), $fd], filewrite[pid(), $fd]) if (@count(time_io[pid(), $fd])) printf("%d %s iotime %s time: %d\n", timestamp(), proc(), - filehandles[pid(), $fd], @sum(time_io[pid(), $fd])) + filehandles[pid(), $fd], @sum(time_io[pid(), $fd])) } delete fileread[pid(), $fd] delete filewrite[pid(), $fd] @@ -79,4 +79,4 @@ probe syscall.close { delete fd_io[pid()] delete entry_io[pid()] delete time_io[pid(),$fd] -} \ No newline at end of file +} -- cgit