aboutsummaryrefslogtreecommitdiff
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-03-30 19:07:05 +0200
committerIngo Molnar <mingo@elte.hu>2009-04-06 09:30:38 +0200
commit0a4a93919bdc5cee48fe4367591e8e0449c1086c (patch)
tree0f0d7ac3ee4f61c1e7e53f0ba4e3b01e0e4ac728 /include/linux/perf_counter.h
parent195564390210977954fe4ef45b39cdee34f41b59 (diff)
perf_counter: executable mmap() information
Currently the profiling information returns userspace IPs but no way to correlate them to userspace code. Userspace could look into /proc/$pid/maps but that might not be current or even present anymore at the time of analyzing the IPs. Therefore provide means to track the mmap information and provide it in the output stream. XXX: only covers mmap()/munmap(), mremap() and mprotect() are missing. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Paul Mackerras <paulus@samba.org> Cc: Andrew Morton <akpm@linux-foundation.org> Orig-LKML-Reference: <20090330171023.417259499@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r--include/linux/perf_counter.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 8ac18852dcf..037a81145ac 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -137,9 +137,11 @@ struct perf_counter_hw_event {
exclude_kernel : 1, /* ditto kernel */
exclude_hv : 1, /* ditto hypervisor */
exclude_idle : 1, /* don't count when idle */
- include_tid : 1, /* include the tid */
+ include_tid : 1, /* include the tid */
+ mmap : 1, /* include mmap data */
+ munmap : 1, /* include munmap data */
- __reserved_1 : 54;
+ __reserved_1 : 52;
__u32 extra_config_len;
__u32 __reserved_4;
@@ -211,6 +213,9 @@ enum perf_event_type {
PERF_EVENT_IP = 0,
PERF_EVENT_GROUP = 1,
+ PERF_EVENT_MMAP = 2,
+ PERF_EVENT_MUNMAP = 3,
+
__PERF_EVENT_TID = 0x100,
};
@@ -491,6 +496,12 @@ static inline int is_software_counter(struct perf_counter *counter)
extern void perf_swcounter_event(u32, u64, int, struct pt_regs *);
+extern void perf_counter_mmap(unsigned long addr, unsigned long len,
+ unsigned long pgoff, struct file *file);
+
+extern void perf_counter_munmap(unsigned long addr, unsigned long len,
+ unsigned long pgoff, struct file *file);
+
#else
static inline void
perf_counter_task_sched_in(struct task_struct *task, int cpu) { }
@@ -511,6 +522,15 @@ static inline int perf_counter_task_enable(void) { return -EINVAL; }
static inline void
perf_swcounter_event(u32 event, u64 nr, int nmi, struct pt_regs *regs) { }
+
+static inline void
+perf_counter_mmap(unsigned long addr, unsigned long len,
+ unsigned long pgoff, struct file *file) { }
+
+static inline void
+perf_counter_munmap(unsigned long addr, unsigned long len,
+ unsigned long pgoff, struct file *file) { }
+
#endif
#endif /* __KERNEL__ */