linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to use perf to log page faults
@ 2010-05-12 19:38 Taras Glek
  2010-05-12 19:59 ` Frederic Weisbecker
  2010-05-12 20:07 ` Andi Kleen
  0 siblings, 2 replies; 5+ messages in thread
From: Taras Glek @ 2010-05-12 19:38 UTC (permalink / raw)
  To: lkml

Hi,
 From the docs it seems that perf may be useful for logging page faults. 
I tried
perf record -g -d -f -e page-faults <mycommand>
but all I got were PERF_RECORD_MMAP events.

I'm using 2.6.32. Ideally I'd like to collect fault addresses and 
userspace stacks that caused them. Isn't this what the page-fault event 
is for?

Taras

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use perf to log page faults
  2010-05-12 19:38 How to use perf to log page faults Taras Glek
@ 2010-05-12 19:59 ` Frederic Weisbecker
  2010-05-12 21:18   ` Taras Glek
  2010-05-12 20:07 ` Andi Kleen
  1 sibling, 1 reply; 5+ messages in thread
From: Frederic Weisbecker @ 2010-05-12 19:59 UTC (permalink / raw)
  To: Taras Glek; +Cc: lkml

On Wed, May 12, 2010 at 12:38:30PM -0700, Taras Glek wrote:
> Hi,
> From the docs it seems that perf may be useful for logging page faults.  
> I tried
> perf record -g -d -f -e page-faults <mycommand>
> but all I got were PERF_RECORD_MMAP events.
>
> I'm using 2.6.32. Ideally I'd like to collect fault addresses and  
> userspace stacks that caused them. Isn't this what the page-fault event  
> is for?
>
> Taras


Could you try with -c 1 ?

Otherwise, does that work on the latest kernel?

Thanks.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use perf to log page faults
  2010-05-12 19:38 How to use perf to log page faults Taras Glek
  2010-05-12 19:59 ` Frederic Weisbecker
@ 2010-05-12 20:07 ` Andi Kleen
  1 sibling, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2010-05-12 20:07 UTC (permalink / raw)
  To: Taras Glek; +Cc: lkml

Taras Glek <tglek@mozilla.com> writes:

> Hi,
> From the docs it seems that perf may be useful for logging page
> faults. I tried
> perf record -g -d -f -e page-faults <mycommand>
> but all I got were PERF_RECORD_MMAP events.
>
> I'm using 2.6.32. Ideally I'd like to collect fault addresses and
> userspace stacks that caused them. Isn't this what the page-fault
> event is for?

Some time ago I used systemtap to do this for my pbitmaps
works. This was the old systemtap script.

-Andi

probe vm.pagefault  { 
	if (task_execname(task_current()) == "executable" && address < 0x100000000) { 
		printf("%u\n", address); 
	}

} 



-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use perf to log page faults
  2010-05-12 19:59 ` Frederic Weisbecker
@ 2010-05-12 21:18   ` Taras Glek
  2010-05-12 21:29     ` Frederic Weisbecker
  0 siblings, 1 reply; 5+ messages in thread
From: Taras Glek @ 2010-05-12 21:18 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: lkml

On 05/12/2010 12:59 PM, Frederic Weisbecker wrote:
> On Wed, May 12, 2010 at 12:38:30PM -0700, Taras Glek wrote:
>    
>> Hi,
>>  From the docs it seems that perf may be useful for logging page faults.
>> I tried
>> perf record -g -d -f -e page-faults<mycommand>
>> but all I got were PERF_RECORD_MMAP events.
>>
>> I'm using 2.6.32. Ideally I'd like to collect fault addresses and
>> userspace stacks that caused them. Isn't this what the page-fault event
>> is for?
>>
>> Taras
>>      
>
> Could you try with -c 1 ?
>
> Otherwise, does that work on the latest kernel?
>    
this just gets me PERF_RECORD_SAMPLE events which don't seem to be 
related to page-faults(ie they show up with/without -e page-faults).

I don't have the latest kernel installed here. Can you get perf 
page-fault events on your system?

Taras


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use perf to log page faults
  2010-05-12 21:18   ` Taras Glek
@ 2010-05-12 21:29     ` Frederic Weisbecker
  0 siblings, 0 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2010-05-12 21:29 UTC (permalink / raw)
  To: Taras Glek; +Cc: lkml

On Wed, May 12, 2010 at 02:18:08PM -0700, Taras Glek wrote:
> On 05/12/2010 12:59 PM, Frederic Weisbecker wrote:
>> On Wed, May 12, 2010 at 12:38:30PM -0700, Taras Glek wrote:
>>    
>>> Hi,
>>>  From the docs it seems that perf may be useful for logging page faults.
>>> I tried
>>> perf record -g -d -f -e page-faults<mycommand>
>>> but all I got were PERF_RECORD_MMAP events.
>>>
>>> I'm using 2.6.32. Ideally I'd like to collect fault addresses and
>>> userspace stacks that caused them. Isn't this what the page-fault event
>>> is for?
>>>
>>> Taras
>>>      
>>
>> Could you try with -c 1 ?
>>
>> Otherwise, does that work on the latest kernel?
>>    
> this just gets me PERF_RECORD_SAMPLE events which don't seem to be  
> related to page-faults(ie they show up with/without -e page-faults).
>
> I don't have the latest kernel installed here. Can you get perf  
> page-fault events on your system?


Yeah, no problem on 2.6.34-rc7.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-12 21:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12 19:38 How to use perf to log page faults Taras Glek
2010-05-12 19:59 ` Frederic Weisbecker
2010-05-12 21:18   ` Taras Glek
2010-05-12 21:29     ` Frederic Weisbecker
2010-05-12 20:07 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).