This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: page faults counter example is broken?!
- From: "Paddie O'Brien" <paddieobrien at gmail dot com>
- To: Thomas Knauth <thomas dot knauth at googlemail dot com>
- Cc: systemtap at sourceware dot org
- Date: Sat, 21 Sep 2013 20:58:31 +0100
- Subject: Re: page faults counter example is broken?!
- Authentication-results: sourceware.org; auth=none
- References: <CABhLV03Fw6dXAU7opacFhr5hBV2GUF5TekkpNGuWapa5M27iqg at mail dot gmail dot com>
I think the way minor faults are recorded is the problem. The code below
is used to determine the type of fault (from memory.stp). Perhaps the
check should be:
#if defined(VM_FAULT_MINOR) && VM_FAULT_MINOR == 0
function vm_fault_contains:long (value:long, test:long)
%{
int res;
switch (STAP_ARG_test){
case 0: res = STAP_ARG_value & VM_FAULT_OOM; break;
case 1: res = STAP_ARG_value & VM_FAULT_SIGBUS; break;
#if defined(VM_FAULT_MINOR) && VM_FAULT_MINOR != 0
case 2: /* VM_FAULT_MINOR infered by that flags off */
res = !((VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_MAJOR) &
STAP_ARG_value);
break;
#else
case 2: res = STAP_ARG_value == VM_FAULT_MINOR; break;
On 20 September 2013 17:20, Thomas Knauth <thomas.knauth@googlemail.com> wrote:
> Dear list,
>
> the system tap examples include a page fault counter. However, I've
> noticed that it's way off with the number of page faults it records. A
> simple
>
> # stap -c df pfaults.stp
>
> records about 20 page faults (minor and major). A simple cross-check with
>
> # \time df
>
> shows that it should report ~270 page faults.
>
> What am I missing?!
>
> Thanks,
> Thomas.