aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-13 17:39:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-13 17:39:42 -0500
commit9fdfbc2bff587f454dd95e2caa6d147c9abe39e4 (patch)
tree2feaee47cbcfb57dd0d5cf23509e22011541e717 /include
parent8cea4eb642890a1de58980e7e1617d1765ef8f7c (diff)
parentdc1d628a67a8f042e711ea5accc0beedc3ef0092 (diff)
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: perf: Provide generic perf_sample_data initialization MAINTAINERS: Add Arnaldo as tools/perf/ co-maintainer perf trace: Don't use pager if scripting perf trace/scripting: Remove extraneous header read perf, ARM: Modify kuser rmb() call to compile for Thumb-2 x86/stacktrace: Don't dereference bad frame pointers perf archive: Don't try to collect files without a build-id perf_events, x86: Fixup fixed counter constraints perf, x86: Restrict the ANY flag perf, x86: rename macro in ARCH_PERFMON_EVENTSEL_ENABLE perf, x86: add some IBS macros to perf_event.h perf, x86: make IBS macros available in perf_event.h hw-breakpoints: Remove stub unthrottle callback x86/hw-breakpoints: Remove the name field perf: Remove pointless breakpoint union perf lock: Drop the buffers multiplexing dependency perf lock: Fix and add misc documentally things percpu: Add __percpu sparse annotations to hw_breakpoint
Diffstat (limited to 'include')
-rw-r--r--include/linux/hw_breakpoint.h8
-rw-r--r--include/linux/perf_event.h27
2 files changed, 28 insertions, 7 deletions
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index 5977b724f7c6..c70d27af03f9 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -66,14 +66,14 @@ register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
66 perf_overflow_handler_t triggered, 66 perf_overflow_handler_t triggered,
67 int cpu); 67 int cpu);
68 68
69extern struct perf_event ** 69extern struct perf_event * __percpu *
70register_wide_hw_breakpoint(struct perf_event_attr *attr, 70register_wide_hw_breakpoint(struct perf_event_attr *attr,
71 perf_overflow_handler_t triggered); 71 perf_overflow_handler_t triggered);
72 72
73extern int register_perf_hw_breakpoint(struct perf_event *bp); 73extern int register_perf_hw_breakpoint(struct perf_event *bp);
74extern int __register_perf_hw_breakpoint(struct perf_event *bp); 74extern int __register_perf_hw_breakpoint(struct perf_event *bp);
75extern void unregister_hw_breakpoint(struct perf_event *bp); 75extern void unregister_hw_breakpoint(struct perf_event *bp);
76extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); 76extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events);
77 77
78extern int dbg_reserve_bp_slot(struct perf_event *bp); 78extern int dbg_reserve_bp_slot(struct perf_event *bp);
79extern int dbg_release_bp_slot(struct perf_event *bp); 79extern int dbg_release_bp_slot(struct perf_event *bp);
@@ -100,7 +100,7 @@ static inline struct perf_event *
100register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, 100register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
101 perf_overflow_handler_t triggered, 101 perf_overflow_handler_t triggered,
102 int cpu) { return NULL; } 102 int cpu) { return NULL; }
103static inline struct perf_event ** 103static inline struct perf_event * __percpu *
104register_wide_hw_breakpoint(struct perf_event_attr *attr, 104register_wide_hw_breakpoint(struct perf_event_attr *attr,
105 perf_overflow_handler_t triggered) { return NULL; } 105 perf_overflow_handler_t triggered) { return NULL; }
106static inline int 106static inline int
@@ -109,7 +109,7 @@ static inline int
109__register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } 109__register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
110static inline void unregister_hw_breakpoint(struct perf_event *bp) { } 110static inline void unregister_hw_breakpoint(struct perf_event *bp) { }
111static inline void 111static inline void
112unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { } 112unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events) { }
113static inline int 113static inline int
114reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } 114reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; }
115static inline void release_bp_slot(struct perf_event *bp) { } 115static inline void release_bp_slot(struct perf_event *bp) { }
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 7b18b4fd5df7..6f8cd7da1a01 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -487,9 +487,8 @@ struct hw_perf_event {
487 struct hrtimer hrtimer; 487 struct hrtimer hrtimer;
488 }; 488 };
489#ifdef CONFIG_HAVE_HW_BREAKPOINT 489#ifdef CONFIG_HAVE_HW_BREAKPOINT
490 union { /* breakpoint */ 490 /* breakpoint */
491 struct arch_hw_breakpoint info; 491 struct arch_hw_breakpoint info;
492 };
493#endif 492#endif
494 }; 493 };
495 atomic64_t prev_count; 494 atomic64_t prev_count;
@@ -802,6 +801,13 @@ struct perf_sample_data {
802 struct perf_raw_record *raw; 801 struct perf_raw_record *raw;
803}; 802};
804 803
804static inline
805void perf_sample_data_init(struct perf_sample_data *data, u64 addr)
806{
807 data->addr = addr;
808 data->raw = NULL;
809}
810
805extern void perf_output_sample(struct perf_output_handle *handle, 811extern void perf_output_sample(struct perf_output_handle *handle,
806 struct perf_event_header *header, 812 struct perf_event_header *header,
807 struct perf_sample_data *data, 813 struct perf_sample_data *data,
@@ -858,6 +864,21 @@ extern int sysctl_perf_event_paranoid;
858extern int sysctl_perf_event_mlock; 864extern int sysctl_perf_event_mlock;
859extern int sysctl_perf_event_sample_rate; 865extern int sysctl_perf_event_sample_rate;
860 866
867static inline bool perf_paranoid_tracepoint_raw(void)
868{
869 return sysctl_perf_event_paranoid > -1;
870}
871
872static inline bool perf_paranoid_cpu(void)
873{
874 return sysctl_perf_event_paranoid > 0;
875}
876
877static inline bool perf_paranoid_kernel(void)
878{
879 return sysctl_perf_event_paranoid > 1;
880}
881
861extern void perf_event_init(void); 882extern void perf_event_init(void);
862extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, int entry_size); 883extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, int entry_size);
863extern void perf_bp_event(struct perf_event *event, void *data); 884extern void perf_bp_event(struct perf_event *event, void *data);