This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: page faults counter example is broken?!
- From: Thomas Knauth <thomas dot knauth at gmx dot de>
- To: "Paddie O'Brien" <paddieobrien at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Wed, 25 Sep 2013 17:33:02 +0200
- Subject: Re: page faults counter example is broken?!
- Authentication-results: sourceware.org; auth=none
- References: <CABhLV03Fw6dXAU7opacFhr5hBV2GUF5TekkpNGuWapa5M27iqg at mail dot gmail dot com> <CAOK12DYmqqQVy5SC5coi-0J9_takdMn4PFbZ-ZFfe7hk40XwbQ at mail dot gmail dot com>
On Sat, Sep 21, 2013 at 9:58 PM, Paddie O'Brien <paddieobrien@gmail.com> wrote:
> 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;
After changing the != into an == operator the number of reported
faults indeed matches with the counters maintained by the OS.
Did this catch the attention of some systemtap developer or shall I
file a separate bug report?
Thanks,
Thomas.