From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16548 invoked by alias); 21 Sep 2013 19:58:34 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 16540 invoked by uid 89); 21 Sep 2013 19:58:34 -0000 Received: from mail-ob0-f182.google.com (HELO mail-ob0-f182.google.com) (209.85.214.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 21 Sep 2013 19:58:34 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,NO_RELAYS,PLING_QUERY autolearn=no version=3.3.2 X-HELO: mail-ob0-f182.google.com Received: by mail-ob0-f182.google.com with SMTP id wo20so2125761obc.41 for ; Sat, 21 Sep 2013 12:58:32 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.63.167 with SMTP id h7mr40234oes.43.1379793511905; Sat, 21 Sep 2013 12:58:31 -0700 (PDT) Received: by 10.182.120.70 with HTTP; Sat, 21 Sep 2013 12:58:31 -0700 (PDT) In-Reply-To: References: Date: Sat, 21 Sep 2013 19:58:00 -0000 Message-ID: Subject: Re: page faults counter example is broken?! From: "Paddie O'Brien" To: Thomas Knauth Cc: systemtap@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-q3/txt/msg00350.txt.bz2 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 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.