From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31365 invoked by alias); 22 Apr 2011 21:47:46 -0000 Received: (qmail 31358 invoked by uid 22791); 22 Apr 2011 21:47:45 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FILL_THIS_FORM,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-px0-f182.google.com (HELO mail-px0-f182.google.com) (209.85.212.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Apr 2011 21:47:31 +0000 Received: by pxi20 with SMTP id 20so572238pxi.13 for ; Fri, 22 Apr 2011 14:47:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.29.166 with SMTP id l6mr2408566pbh.294.1303508850764; Fri, 22 Apr 2011 14:47:30 -0700 (PDT) Received: by 10.68.43.72 with HTTP; Fri, 22 Apr 2011 14:47:30 -0700 (PDT) In-Reply-To: <4DB1E4D2.70200@redhat.com> References: <4DAF3D59.7020609@redhat.com> <4DB0B049.8070806@redhat.com> <4DB0C1AD.6080802@redhat.com> <4DB1E4D2.70200@redhat.com> Date: Fri, 22 Apr 2011 21:47:00 -0000 Message-ID: Subject: Re: Linux VFS cache hit rate script From: Jake Maul To: Josh Stone Cc: systemtap@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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: 2011-q2/txt/msg00150.txt.bz2 On Fri, Apr 22, 2011 at 1:28 PM, Josh Stone wrote: > That should do it. =A0I should have been more clear - the effect I > intended was just to relieve the need for MAXMAPENTRIES. =A0The > "__devnames" map should now only contain the real device names, and not > waste any time/space on "N/A" entries. =A0Your script's output would not > be affected though. > > Josh > Ah. Well, in that case, sorry, still no good. I cut out that bit of the output, but: # time stap -DSTP_NO_OVERLOAD devnames.stp -c "sleep 35" | sort | uniq -c ERROR: Array overflow, check MAXMAPENTRIES near identifier '$file' at /usr/share/systemtap/tapset/vfs.stp:780:9 WARNING: Number of errors: 1, skipped probes: 2126 Pass 5: run failed. Try again with another '--vp 00001' option. Here's an interesting note though: the line numbers are different. The only difference between the runs is which of the 2 functions is commented out. With stock function: ERROR: Array overflow, check MAXMAPENTRIES near identifier '$file' at /usr/share/systemtap/tapset/vfs.stp:769:9 With your function: ERROR: Array overflow, check MAXMAPENTRIES near identifier '$file' at /usr/share/systemtap/tapset/vfs.stp:780:9 Here's that snippet in vfs.stp (pasting here because the line numbers are going to be off now, as compared to the stock file): 761 probe vfs.read =3D kernel.function("vfs_read") 762 { 763 file =3D $file 764 pos =3D $pos 765 buf =3D $buf 766 bytes_to_read =3D $count 767 dev =3D __file_dev($file) 768 devname =3D __find_bdevname(dev, __file_bdev($file)) 769 ino =3D __file_ino($file) 770 771 name =3D "vfs.read" 772 argstr =3D sprintf("%d, %d, %p", $count, $pos, $buf) 773 } 774 775 probe vfs.read.return =3D kernel.function("vfs_read").return 776 { 777 name =3D "vfs.read" 778 retstr =3D sprintf("%d", $return) 779 780 file =3D $file 781 pos =3D $pos 782 buf =3D $buf 783 bytes_to_read =3D $count 784 dev =3D __file_dev($file) 785 devname =3D __find_bdevname(dev, __file_bdev($file)) 786 ino =3D __file_ino($file) 787 788 ret =3D $return 789 bytes_read =3D $return > 0 ? $return : 0 790 error =3D $return < 0 ? $return : 0 791 error_str =3D error ? errno_str(error) : "" 792 } So as you can see, one errors in vfs.read, the other in vfs.read.return. In both cases something to do with $file gets assigned to a normal variable. Side note: I wonder if the "name" variables are messed up... vfs.read* and vfs.write* don't follow quite the same pattern: probe vfs.read =3D kernel.function("vfs_read") name =3D "vfs.read" probe vfs.read.return =3D kernel.function("vfs_read").return name =3D "vfs.read" probe vfs.readv =3D kernel.function("vfs_readv") name =3D "vfs.read" probe vfs.readv.return =3D kernel.function("vfs_readv").return name =3D "vfs.readv" probe vfs.write =3D kernel.function("vfs_write") name =3D "vfs.write" probe vfs.write.return =3D kernel.function("vfs_write").return name =3D "vfs.write" probe vfs.writev =3D kernel.function("vfs_writev") name =3D "vfs.writev" probe vfs.writev.return =3D kernel.function("vfs_writev").return name =3D "vfs.writev" Jake