lkml.org 
[lkml]   [2009]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectperf_counters: page fault trace record
Hi,

One of the tools we are working on needs to be able to look not only at counts
of page faults, but where they are occurring (ip and faulting page address).

What would you think about adding a new bit to the config record, something like:

diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 6e13395..c27d0bc 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -167,8 +167,9 @@ struct perf_counter_attr {
mmap : 1, /* include mmap data */
comm : 1, /* include comm data */
freq : 1, /* use freq, not period */
-
- __reserved_2 : 53;
+ page_fault : 1, /* include page fault data
*/
+
+ __reserved_2 : 52;

We'd need a new event type too - PERF_EVENT_PAGE_FAULT which would have:

/*
* struct {
* struct perf_event_header header;
* u64 ip;
* u64 fault_address;
* };
*/
etc.

I would guess that special care would need to be taken to post an event record
like this on the thread of a page fault handler.

Any objection to this idea?



Regards,

- Corey

Corey Ashford
Software Engineer
IBM Linux Technology Center, Linux Toolchain
cjashfor@us.ibm.com



\
 
 \ /
  Last update: 2009-06-13 03:31    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site