public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Josh Stone <jistone@redhat.com>
To: Jake Maul <jakemaul@gmail.com>
Cc: systemtap@sourceware.org
Subject: Re: Linux VFS cache hit rate script
Date: Mon, 25 Apr 2011 21:54:00 -0000	[thread overview]
Message-ID: <4DB5ED98.7070207@redhat.com> (raw)
In-Reply-To: <BANLkTiny5EKO=yv-L7Kiag5+S0feRTx_nw@mail.gmail.com>

On 04/22/2011 02:47 PM, Jake Maul wrote:
> 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

Was the "stock" one before you added my new version of the function?  I
think that would easily explain why the line numbers got shifted.  Note
that both are talking about $file at column 9, which in your snippet
only makes sense for the "<TAB>file = $file".

Anyway, I just realized that there is a way that $file could actually be
involved with a map overflow (which I thought was wrong before).  When
accessing parameters in a .return probe, we first use an entry probe to
save the value into a map, then read that back in the actual .return
probe.  So that saving map could be the thing that is overflowing.

I notice that you also have a bunch of skipped probes, which is probably
due to not enough kretprobe slots available.  (-t can tell for sure.)  I
think this may be causing a bug that sometimes the saved $file is not
being cleared, because the part that would use it is getting skipped.
Your 2035 skipped seems not enough to accumulate past the default 10,000
MAXMAPENTRIES, but I don't have other ideas.  I would suggest tweaking
KRETACTIVE until there's no skipping, as described here:
	http://sourceware.org/systemtap/wiki/TipSkippedProbes

I'm not sure there's a way we could more cleanly fail this case of
skipped probe vs. stale saved $var.  On kernels since 2.6.25 we actually
use a different saving mechanism though, which wouldn't have the same
mapping problem.

> 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 = kernel.function("vfs_read")
>         name = "vfs.read"
> probe vfs.read.return = kernel.function("vfs_read").return
>         name = "vfs.read"
> probe vfs.readv = kernel.function("vfs_readv")
>         name = "vfs.read"
> probe vfs.readv.return = kernel.function("vfs_readv").return
>         name = "vfs.readv"

Yeah, looks like a typo - the third should probably be readv.


Josh

  reply	other threads:[~2011-04-25 21:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20 19:04 Jake Maul
2011-04-20 20:09 ` William Cohen
2011-04-20 20:46   ` Jake Maul
2011-04-20 20:57     ` Josh Stone
2011-04-20 22:25       ` Jake Maul
2011-04-21 20:17   ` Jake Maul
2011-04-21 22:31     ` William Cohen
2011-04-21 23:02       ` Jake Maul
2011-04-21 23:46         ` Josh Stone
2011-04-22 19:17           ` Jake Maul
2011-04-22 20:28             ` Josh Stone
2011-04-22 21:47               ` Jake Maul
2011-04-25 21:54                 ` Josh Stone [this message]
2011-04-26  2:11                   ` Jake Maul
2011-04-25 22:53           ` Josh Stone
2011-04-26  1:59             ` Jake Maul
2011-04-26  2:44               ` Josh Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DB5ED98.7070207@redhat.com \
    --to=jistone@redhat.com \
    --cc=jakemaul@gmail.com \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).