public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: William Cohen <wcohen@redhat.com>
To: Daire Byrne <daire@dneg.com>
Cc: wcohen@redhat.com, "systemtap@sourceware.org" <systemtap@sourceware.org>
Subject: Re: vfs.add_to_page_cache not working anymore?
Date: Tue, 13 Jun 2023 11:22:11 -0400	[thread overview]
Message-ID: <4893d129-6569-4318-cf3b-7821bef98441@redhat.com> (raw)
In-Reply-To: <CAPt2mGOm2_mXZ5uNEoeZm_H1dGi17229mubquC8P_AfoipjvJQ@mail.gmail.com>

On 6/12/23 11:39, Daire Byrne via Systemtap wrote:
> I have recently updated my kernel (v6.3) and with systemtap version (v4.8),
> an old systemtap script I was using has stopped working.
> 
> It looks like I was counting pages added via vfs.add_to_page_cache as a
> means to work out file reads (over NFS) per pid.
> 
> But this function no longer seem to hit at all for me anymore:
> 
> stap -e 'probe vfs.add_to_page_cache { printf("Works.\n"); exit() }'
> 
> I am aware that v4.9 is the latest systemtap, but I have been struggling to
> get it to compile with the new jupyter stuff (my python version is too old).
> 
> Anyway, any help or pointers for vfs.add_to_page_cache greatly appreciated.
> 
> Daire
> 

Hi,

Switching to systemtap-4.9 is probably not going to change the results
in this case as there are no changes in tapset/linux/vfs.stp between
4.8 and 4.9.

Unfortunately, the kernels changes over time and some functions probed
by the tapset change over time or the way they are used by other parts
of the kernel changes.  The vfs.add_to_page cache in the vfs.stp has
three possible functions it probes: add_to_page_cache_locked,
add_to_page_cache_lru, and add_to_page_cache.  The first two functions
were added due to kernel commit f00654007fe1c15.  Did some git commit
archeology and only add_to_page_cache_lru is in the kernel due to
kernel git commit 2bb876b58d593d7f2522ec0f41f20a74fde76822.

The following URL show where add_to_page_cache_lru is used in 6.2.16
kernels nfs and can provide some method of seeing how the nfs related
functions get called:

https://elixir.bootlin.com/linux/v6.2.16/A/ident/add_to_page_cache_lru

As far as specifically what has changed to cause vfs.add_to_page_cache
not to trigger for NFS operations I am not sure.  For the 6.2 kernel
it might be good to get a backtrace of the triggering of it and then
use that information to see what has changed in the functions on the
backtrace.

stap -ldd -e 'probe vfs.add_to_page_cache { print_backtrace(); printf("Works.\n"); exit() }'

-Will


  reply	other threads:[~2023-06-13 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 15:39 Daire Byrne
2023-06-13 15:22 ` William Cohen [this message]
2023-06-13 16:39   ` Daire Byrne
2023-06-13 17:34     ` William Cohen
2023-06-14 12:11       ` Daire Byrne
2023-06-14 15:58         ` Daire Byrne
2023-11-06 11:20           ` Daire Byrne

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=4893d129-6569-4318-cf3b-7821bef98441@redhat.com \
    --to=wcohen@redhat.com \
    --cc=daire@dneg.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).