lkml.org 
[lkml]   [2009]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/4] perf_counter: provide pagefault software events
From
Date
On Tue, 2009-03-10 at 15:59 +0100, Ingo Molnar wrote:
> * Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
>
> > Index: linux-2.6/arch/powerpc/mm/fault.c
> > ===================================================================
> > --- linux-2.6.orig/arch/powerpc/mm/fault.c
> > +++ linux-2.6/arch/powerpc/mm/fault.c
> > @@ -29,6 +29,7 @@
> > #include <linux/module.h>
> > #include <linux/kprobes.h>
> > #include <linux/kdebug.h>
> > +#include <linux/perf_counter.h>
> >
> > #include <asm/firmware.h>
> > #include <asm/page.h>
> > @@ -170,6 +171,8 @@ int __kprobes do_page_fault(struct pt_re
> > die("Weird page fault", regs, SIGSEGV);
> > }
> >
> > + perf_swcount_event(PERF_COUNT_PAGE_FAULTS, 1, regs);
>
> Wow, that's really nice - this way we can display a profile of
> pagefault events in KernelTop - as if it was a real cycles or
> other hw event based profile. Have you tried it out?

Yeah, but unsurprising all pagefaults I generated were in userspace, so
kerneltop stayed empty.

Found that perfstat went bokers though, forgot to handle the case where
there's no overflow interrupt.

/me goes poke at the code a bit more.





\
 
 \ /
  Last update: 2009-03-10 16:09    [W:0.030 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site