public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Patch for traceio.stp
@ 2009-04-27 21:46 Kai Meyer
  2009-04-28  5:58 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Meyer @ 2009-04-27 21:46 UTC (permalink / raw)
  To: systemtap

I found traceio.stp very useful, but it only ran for a few seconds 
before exiting with the error 'ERROR: MAXACTION exceeded'. With some 
help in the IRC channel, I've modified teh traceio.stp file to run 
longer as well as adding some changes that gives me more useful 
information. I would rather have a list of Process IDs rather than 
Process name (pid instead of execname) because I haev multiple qemu-dm 
processes that I want individual disk usage stats for.

Thanks for such a great program. I wish I had found you earlier, you are 
going to make so many of my weekly headaches dissapear!

Here's the diff:

--- traceio.stp.orig    2009-04-27 15:17:38.000000000 -0600
+++ traceio.stp    2009-04-27 15:18:58.000000000 -0600
@@ -10,22 +10,20 @@
 global reads, writes, total_io
 
 probe vfs.read.return {
-  reads[execname()] += $return
+  reads[pid()] += $return
+  total_io[pid()] += $return
 }
 
 probe vfs.write.return {
-  writes[execname()] += $return
+  writes[pid()] += $return
+  total_io[pid()] += $return
 }
 
 probe timer.s(1) {
-  foreach (p in reads)
-    total_io[p] += reads[p]
-  foreach (p in writes)
-    total_io[p] += writes[p]
   foreach(p in total_io- limit 10)
-    printf("%15s r: %8d KiB w: %8d KiB\n",
-           p, reads[p]/1024,
-           writes[p]/1024)
+    printf("%8d r: %8d MiB w: %8d MiB\n",
+           p, reads[p]/1024/1024,
+           writes[p]/1024/1024)
   printf("\n")
   # Note we don't zero out reads, writes and total_io,
   # so the values are cumulative since the script started.

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

* Re: Patch for traceio.stp
  2009-04-27 21:46 Patch for traceio.stp Kai Meyer
@ 2009-04-28  5:58 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2009-04-28  5:58 UTC (permalink / raw)
  To: Kai Meyer; +Cc: systemtap

Hi Kai,

On Mon, 2009-04-27 at 15:43 -0600, Kai Meyer wrote:
> Thanks for such a great program. I wish I had found you earlier, you are 
> going to make so many of my weekly headaches dissapear!

Thanks!

You might already know, but Frank already applied your patches to make
traceio.stp more useful to git master. I really like the cleaned up
output.

Cheers,

Mark

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

end of thread, other threads:[~2009-04-28  5:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-27 21:46 Patch for traceio.stp Kai Meyer
2009-04-28  5:58 ` Mark Wielaard

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).