public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Retrieving filename / inode from page fault probe
@ 2017-05-28 14:05 Yun-Chih Chen
  2017-05-28 15:40 ` Yunchih Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Yun-Chih Chen @ 2017-05-28 14:05 UTC (permalink / raw)
  To: systemtap

Hi, friends:

I am benchmarking a NFS server, on which I want to answer this question:

When there is a NFS read request coming in, are the pages of the
requested file in page cache?

My plan is to record timestamp of arriving read request with
"network/nfsd-trace.stp" and record the file that corresponds to every
page-cache-add and page-cache-remove.  Once the data is collected, I
can match read request timeline with that of page cache to see if the
request is a hit or miss.

The following script aims to record the file that an added page belongs to:

probe kernel.trace("mm_filemap_add_to_page_cache") {
 f = inode_path($page->mapping->host)
 printf("%s %s \n", tz_ctime(gettimeofday_s()), f);
}

This will result in a read fault runtime error:
ERROR: read fault [man error::fault] at 0xffffffffffffff78 (addr) near
operator '->' at /usr/share/systemtap/tapset/linux/dentry.stp:65:33

Well, I'm not sure if this is the correct way of achieving the goal
...  It is also not clear to me how the probe differs from Systemtap's
"vm.pagefault" probe.

Anyone has suggest on this?

Thanks,

Yunchih

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Retrieving filename / inode from page fault probe
  2017-05-28 14:05 Retrieving filename / inode from page fault probe Yun-Chih Chen
@ 2017-05-28 15:40 ` Yunchih Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Yunchih Chen @ 2017-05-28 15:40 UTC (permalink / raw)
  To: Yun-Chih Chen; +Cc: systemtap

Well, I have managed to make it work with the following script:

probe kernel.trace("mm_filemap_add_to_page_cache") {
  if($page->mapping->host->i_ino){
        f = inode_path($page->mapping->host)
        printf("%s Added %s \n", tz_ctime(gettimeofday_s()), f);
  }
}

Some inode turn out to be 0 and causes the read fault!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-28 15:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-28 14:05 Retrieving filename / inode from page fault probe Yun-Chih Chen
2017-05-28 15:40 ` Yunchih Chen

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).