aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-03-30 13:07:05 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-06 03:30:38 -0400
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 8ac18852dcfe..037a81145aca 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -137,9 +137,11 @@ struct perf_counter_hw_event {
137 exclude_kernel : 1, /* ditto kernel */ 137 exclude_kernel : 1, /* ditto kernel */
138 exclude_hv : 1, /* ditto hypervisor */ 138 exclude_hv : 1, /* ditto hypervisor */
139 exclude_idle : 1, /* don't count when idle */ 139 exclude_idle : 1, /* don't count when idle */
140 include_tid : 1, /* include the tid */ 140 include_tid : 1, /* include the tid */
141 mmap : 1, /* include mmap data */
142 munmap : 1, /* include munmap data */
141 143
142 __reserved_1 : 54; 144 __reserved_1 : 52;
143 145
144 __u32 extra_config_len; 146 __u32 extra_config_len;
145 __u32 __reserved_4; 147 __u32 __reserved_4;
@@ -211,6 +213,9 @@ enum perf_event_type {
211 PERF_EVENT_IP = 0, 213 PERF_EVENT_IP = 0,
212 PERF_EVENT_GROUP = 1, 214 PERF_EVENT_GROUP = 1,
213 215
216 PERF_EVENT_MMAP = 2,
217 PERF_EVENT_MUNMAP = 3,
218
214 __PERF_EVENT_TID = 0x100, 219 __PERF_EVENT_TID = 0x100,
215}; 220};
216 221
@@ -491,6 +496,12 @@ static inline int is_software_counter(struct perf_counter *counter)
491 496
492extern void perf_swcounter_event(u32, u64, int, struct pt_regs *); 497extern void perf_swcounter_event(u32, u64, int, struct pt_regs *);
493 498
499extern void perf_counter_mmap(unsigned long addr, unsigned long len,
500 unsigned long pgoff, struct file *file);
501
502extern void perf_counter_munmap(unsigned long addr, unsigned long len,
503 unsigned long pgoff, struct file *file);
504
494#else 505#else
495static inline void 506static inline void
496perf_counter_task_sched_in(struct task_struct *task, int cpu) { } 507perf_counter_task_sched_in(struct task_struct *task, int cpu) { }
@@ -511,6 +522,15 @@ static inline int perf_counter_task_enable(void) { return -EINVAL; }
511static inline void 522static inline void
512perf_swcounter_event(u32 event, u64 nr, int nmi, struct pt_regs *regs) { } 523perf_swcounter_event(u32 event, u64 nr, int nmi, struct pt_regs *regs) { }
513 524
525
526static inline void
527perf_counter_mmap(unsigned long addr, unsigned long len,
528 unsigned long pgoff, struct file *file) { }
529
530static inline void
531perf_counter_munmap(unsigned long addr, unsigned long len,
532 unsigned long pgoff, struct file *file) { }
533
514#endif 534#endif
515 535
516#endif /* __KERNEL__ */ 536#endif /* __KERNEL__ */