From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5006 invoked by alias); 20 Apr 2011 20:46:00 -0000 Received: (qmail 4998 invoked by uid 22791); 20 Apr 2011 20:46:00 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-pz0-f41.google.com (HELO mail-pz0-f41.google.com) (209.85.210.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Apr 2011 20:45:46 +0000 Received: by pzk32 with SMTP id 32so852204pzk.0 for ; Wed, 20 Apr 2011 13:45:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.15.134 with SMTP id x6mr10948377pbc.308.1303332345610; Wed, 20 Apr 2011 13:45:45 -0700 (PDT) Received: by 10.68.44.67 with HTTP; Wed, 20 Apr 2011 13:45:45 -0700 (PDT) In-Reply-To: <4DAF3D59.7020609@redhat.com> References: <4DAF3D59.7020609@redhat.com> Date: Wed, 20 Apr 2011 20:46:00 -0000 Message-ID: Subject: Re: Linux VFS cache hit rate script From: Jake Maul To: William Cohen 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/msg00130.txt.bz2 On Wed, Apr 20, 2011 at 1:08 PM, William Cohen wrote: > On 04/20/2011 03:04 PM, Jake Maul wrote: >> Greetings all, > > Hi Jake, > > Thanks for taking the time to submit the example. > >> >> I have recently put a script up on the War Stories page, and it was >> requested of me to also post it to the list, along with a .meta file. >> They're both attached. >> >> http://sourceware.org/systemtap/wiki/WSCacheHitRate > > Why the need for =A0-DMAXMAPENTRIES=3D100000 on the second example on the= wiki page? There doesn't seem to be any arrays in the script. For some reason on that particular server, I get this error sometimes: ERROR: Array overflow, check MAXMAPENTRIES near identifier '$file' at /usr/share/systemtap/tapset/vfs.stp:769:9 I freely admit, that was voodoo-administration on my part- I found something somewhere that indicated you can make that variable larger like that, and tried it out. It seems to help, but I haven't the slightest idea why. If anyone can shed some light on that, I'd be much obliged. :) On a different server, it works fine without that. They're both RHEL5, but the working on is 64-bit and the one that sometimes errors is 32-bit PAE. Not sure if that matters. They do have completely different datasets and workloads. >> Let me know what you think! It's my first SystemTap script, so I'm >> sure there are improvements that could be made. I'm by no means a >> kernel hacker, or even a C dev... just a lowly sysadmin. :) > > Include a short header like the following at the beginning of the script: > > #!/usr/bin/env stap > # cache-hit.stp > # Copyright (C) 2011 xxx > # > # This program is free software; you can redistribute it and/or modify > # it under the terms of the GNU General Public License version 2 as > # published by the Free Software Foundation. Good call, I'll add something. > Should avoid long line lengths in the printf statements. Wrapped lines do= n't look good in manuals. Also good. > The following line sounds unsure, need to check that that is really the c= ase: > > =A0if (devname=3D=3D"N/A") { /* N/A means cache hit... right? */ > > It would be good to have a better explanation for the "N/A" check. This is from the beginner's guide, actually: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/SystemTap= _Beginners_Guide/mainsect-disk.html It bothers me too, because I can't find any documentation that says explicitly when you would get an 'N/A' devname. I don't know if it's a SystemTap thing or a kernel thing, but being that I don't have experience working on either, I'm fairly lost. Thanks for the feedback! Jake