From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19905 invoked by alias); 27 Apr 2009 22:14:56 -0000 Received: (qmail 19898 invoked by uid 22791); 27 Apr 2009 22:14:55 -0000 X-SWARE-Spam-Status: No, hits=1.4 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_51,J_CHICKENPOX_61,J_CHICKENPOX_71,J_CHICKENPOX_73,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.fiber.net (HELO mail.fiber.net) (216.83.130.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Apr 2009 22:14:50 +0000 Received: from [10.1.80.38] (asa-2.fbp.ore.fiber.net [216.83.131.162]) (authenticated bits=0) by mail.fiber.net (8.14.0/8.14.0) with ESMTP id n3RMEm4k059597 for ; Mon, 27 Apr 2009 16:14:48 -0600 (MDT) (envelope-from kai@fiber.net) Message-ID: <49F62DCD.8080109@fiber.net> Date: Mon, 27 Apr 2009 22:14:00 -0000 From: Kai Meyer User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: systemtap@sources.redhat.com Subject: traceio.stp diff #2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00448.txt.bz2 fche in the IRC channel suggested we index on both the pid and execname. If we do, we get the following: --- traceio.stp.orig 2009-04-27 15:17:38.000000000 -0600 +++ traceio.stp 2009-04-27 16:12:15.000000000 -0600 @@ -10,22 +10,20 @@ global reads, writes, total_io probe vfs.read.return { - reads[execname()] += $return + reads[pid(),execname()] += $return + total_io[pid(),execname()] += $return } probe vfs.write.return { - writes[execname()] += $return + writes[pid(),execname()] += $return + total_io[pid(),execname()] += $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) + foreach([p,e] in total_io- limit 10) + printf("%8d %15s r: %8d MiB w: %8d MiB\n", + p, e, reads[p,e]/1024/1024, + writes[p,e]/1024/1024) printf("\n") # Note we don't zero out reads, writes and total_io, # so the values are cumulative since the script started.