This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Page faults
- From: David Smith <dsmith at redhat dot com>
- To: "Paddie O'Brien" <paddieobrien at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Tue, 10 Sep 2013 13:12:40 -0500
- Subject: Re: Page faults
- Authentication-results: sourceware.org; auth=none
- References: <CAOK12DZSCVBTZsi8iMAgjpJCU+8q-DWoK0KBUsuj0XUAz17azA at mail dot gmail dot com> <522E36EF dot 3080904 at redhat dot com> <CAOK12DbaDN6kY6Ng-V9oGcPAzoh7eDoDSZ6gz+wkKkUZO=kHsA at mail dot gmail dot com>
On 09/10/2013 11:14 AM, Paddie O'Brien wrote:
> Thanks David. I tried your approach but I get the same result.
>
> The script sometimes crashes unless I include --skip-badvars.
>
> Could my problem be caused by a misconfigured systemtap installation?
>
> Thanks,
> P
Hmm, interesting. I tweaked the script a bit to use the 'target()'
function, which returns the pid of the target (from either '-c command'
or '-x pid').
====
global handled
probe kernel.function("filemap_fault")
{
if (pid() != target()) next;
printf("%s: filemap_fault\n", execname());
printf("Page: %lu\n", $vmf->pgoff);
handled[tid()] = 1
}
probe kernel.function("filemap_fault").return
{
if (pid() != target()) next;
delete handled[tid()]
}
probe kernel.function("find_get_page")
{
if (handled[tid()] != 1) next;
printf("%s: find_get_page\n", execname());
printf("Page: %lu\n\n", $offset);
}
====
When I run "stap -c page_faults.stp -c ls", all the page numbers match up.
Since I didn't have to use '--skip-badvars', my next guess would be that
you've got an older systemtap.
I'm running HEAD systemtap (~2.3) on 3.11.0-0.rc5.git3.1.fc20.x86_64.
What version of systemtap and what kernel are you running?
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)