aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-04-08 09:01:33 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-08 13:05:56 -0400
commit78f13e9525ba777da25c4ddab89f28e9366a8b7c (patch)
treed23d43df02330f39e9c31901df9956d2e58a3474 /include/linux/perf_counter.h
parent4d855457d84b819fefcd1cd1b0a2a0a0ec475c07 (diff)
perf_counter: allow for data addresses to be recorded
Paul suggested we allow for data addresses to be recorded along with the traditional IPs as power can provide these. For now, only the software pagefault events provide data addresses, but in the future power might as well for some events. x86 doesn't seem capable of providing this atm. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> LKML-Reference: <20090408130409.394816925@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.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 8bd1be58c938..c22363a4f746 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -101,8 +101,9 @@ enum perf_counter_record_format {
101 PERF_RECORD_IP = 1U << 0, 101 PERF_RECORD_IP = 1U << 0,
102 PERF_RECORD_TID = 1U << 1, 102 PERF_RECORD_TID = 1U << 1,
103 PERF_RECORD_TIME = 1U << 2, 103 PERF_RECORD_TIME = 1U << 2,
104 PERF_RECORD_GROUP = 1U << 3, 104 PERF_RECORD_ADDR = 1U << 3,
105 PERF_RECORD_CALLCHAIN = 1U << 4, 105 PERF_RECORD_GROUP = 1U << 4,
106 PERF_RECORD_CALLCHAIN = 1U << 5,
106}; 107};
107 108
108/* 109/*
@@ -251,6 +252,7 @@ enum perf_event_type {
251 * { u64 ip; } && PERF_RECORD_IP 252 * { u64 ip; } && PERF_RECORD_IP
252 * { u32 pid, tid; } && PERF_RECORD_TID 253 * { u32 pid, tid; } && PERF_RECORD_TID
253 * { u64 time; } && PERF_RECORD_TIME 254 * { u64 time; } && PERF_RECORD_TIME
255 * { u64 addr; } && PERF_RECORD_ADDR
254 * 256 *
255 * { u64 nr; 257 * { u64 nr;
256 * { u64 event, val; } cnt[nr]; } && PERF_RECORD_GROUP 258 * { u64 event, val; } cnt[nr]; } && PERF_RECORD_GROUP
@@ -537,7 +539,7 @@ extern int hw_perf_group_sched_in(struct perf_counter *group_leader,
537extern void perf_counter_update_userpage(struct perf_counter *counter); 539extern void perf_counter_update_userpage(struct perf_counter *counter);
538 540
539extern int perf_counter_overflow(struct perf_counter *counter, 541extern int perf_counter_overflow(struct perf_counter *counter,
540 int nmi, struct pt_regs *regs); 542 int nmi, struct pt_regs *regs, u64 addr);
541/* 543/*
542 * Return 1 for a software counter, 0 for a hardware counter 544 * Return 1 for a software counter, 0 for a hardware counter
543 */ 545 */
@@ -547,7 +549,7 @@ static inline int is_software_counter(struct perf_counter *counter)
547 perf_event_type(&counter->hw_event) != PERF_TYPE_HARDWARE; 549 perf_event_type(&counter->hw_event) != PERF_TYPE_HARDWARE;
548} 550}
549 551
550extern void perf_swcounter_event(u32, u64, int, struct pt_regs *); 552extern void perf_swcounter_event(u32, u64, int, struct pt_regs *, u64);
551 553
552extern void perf_counter_mmap(unsigned long addr, unsigned long len, 554extern void perf_counter_mmap(unsigned long addr, unsigned long len,
553 unsigned long pgoff, struct file *file); 555 unsigned long pgoff, struct file *file);
@@ -584,8 +586,8 @@ static inline int perf_counter_task_disable(void) { return -EINVAL; }
584static inline int perf_counter_task_enable(void) { return -EINVAL; } 586static inline int perf_counter_task_enable(void) { return -EINVAL; }
585 587
586static inline void 588static inline void
587perf_swcounter_event(u32 event, u64 nr, int nmi, struct pt_regs *regs) { } 589perf_swcounter_event(u32 event, u64 nr, int nmi,
588 590 struct pt_regs *regs, u64 addr) { }
589 591
590static inline void 592static inline void
591perf_counter_mmap(unsigned long addr, unsigned long len, 593perf_counter_mmap(unsigned long addr, unsigned long len,