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:14 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-06 03:30:43 -0400
commit394ee07623cf556c8daae2b3c00cf5fea47f0811 (patch)
treef3568c9d779c282732c7bbeccb75a4bb3041b857 /include/linux/perf_counter.h
parent023c54c42288416b4f43c67bfd5049a76926fad6 (diff)
perf_counter: provide generic callchain bits
Provide the generic callchain support bits. If hw_event->callchain is set the arch specific perf_callchain() function is called upon to provide a perf_callchain_entry structure filled with the current callchain. If it does so, it is added to the overflow output event. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Paul Mackerras <paulus@samba.org> Orig-LKML-Reference: <20090330171024.254266860@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.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index edf5bfb7ff51..43083afffe0f 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -140,8 +140,9 @@ struct perf_counter_hw_event {
140 include_tid : 1, /* include the tid */ 140 include_tid : 1, /* include the tid */
141 mmap : 1, /* include mmap data */ 141 mmap : 1, /* include mmap data */
142 munmap : 1, /* include munmap data */ 142 munmap : 1, /* include munmap data */
143 callchain : 1, /* add callchain data */
143 144
144 __reserved_1 : 52; 145 __reserved_1 : 51;
145 146
146 __u32 extra_config_len; 147 __u32 extra_config_len;
147 __u32 __reserved_4; 148 __u32 __reserved_4;
@@ -219,6 +220,7 @@ enum perf_event_type {
219 PERF_EVENT_OVERFLOW = 1UL << 31, 220 PERF_EVENT_OVERFLOW = 1UL << 31,
220 __PERF_EVENT_IP = 1UL << 30, 221 __PERF_EVENT_IP = 1UL << 30,
221 __PERF_EVENT_TID = 1UL << 29, 222 __PERF_EVENT_TID = 1UL << 29,
223 __PERF_EVENT_CALLCHAIN = 1UL << 28,
222}; 224};
223 225
224#ifdef __KERNEL__ 226#ifdef __KERNEL__
@@ -504,6 +506,15 @@ extern void perf_counter_mmap(unsigned long addr, unsigned long len,
504extern void perf_counter_munmap(unsigned long addr, unsigned long len, 506extern void perf_counter_munmap(unsigned long addr, unsigned long len,
505 unsigned long pgoff, struct file *file); 507 unsigned long pgoff, struct file *file);
506 508
509#define MAX_STACK_DEPTH 255
510
511struct perf_callchain_entry {
512 u64 nr;
513 u64 ip[MAX_STACK_DEPTH];
514};
515
516extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs);
517
507#else 518#else
508static inline void 519static inline void
509perf_counter_task_sched_in(struct task_struct *task, int cpu) { } 520perf_counter_task_sched_in(struct task_struct *task, int cpu) { }