aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-04-27 04:38:30 -0400
committerIngo Molnar <mingo@elte.hu>2011-04-27 04:40:21 -0400
commit32673822e440eb92eb334631eb0a199d0c532d13 (patch)
treec1e55c1793fa17937d9b8e0a9a2946583f1948d5 /include/linux/perf_event.h
parentfa7b69475a6c192853949ba496dd9c37b497b548 (diff)
parent5373db886b791b2bc7811e2c115377916c409a5d (diff)
Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core
Conflicts: include/linux/perf_event.h Merge reason: pick up the latest jump-label enhancements, they are cooked ready. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index ee9f1e782800..9eec53d97370 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -505,7 +505,7 @@ struct perf_guest_info_callbacks {
505#include <linux/ftrace.h> 505#include <linux/ftrace.h>
506#include <linux/cpu.h> 506#include <linux/cpu.h>
507#include <linux/irq_work.h> 507#include <linux/irq_work.h>
508#include <linux/jump_label_ref.h> 508#include <linux/jump_label.h>
509#include <asm/atomic.h> 509#include <asm/atomic.h>
510#include <asm/local.h> 510#include <asm/local.h>
511 511
@@ -1034,7 +1034,7 @@ static inline int is_software_event(struct perf_event *event)
1034 return event->pmu->task_ctx_nr == perf_sw_context; 1034 return event->pmu->task_ctx_nr == perf_sw_context;
1035} 1035}
1036 1036
1037extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; 1037extern struct jump_label_key perf_swevent_enabled[PERF_COUNT_SW_MAX];
1038 1038
1039extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); 1039extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64);
1040 1040
@@ -1063,22 +1063,21 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)
1063{ 1063{
1064 struct pt_regs hot_regs; 1064 struct pt_regs hot_regs;
1065 1065
1066 JUMP_LABEL(&perf_swevent_enabled[event_id], have_event); 1066 if (static_branch(&perf_swevent_enabled[event_id])) {
1067 return; 1067 if (!regs) {
1068 1068 perf_fetch_caller_regs(&hot_regs);
1069have_event: 1069 regs = &hot_regs;
1070 if (!regs) { 1070 }
1071 perf_fetch_caller_regs(&hot_regs); 1071 __perf_sw_event(event_id, nr, nmi, regs, addr);
1072 regs = &hot_regs;
1073 } 1072 }
1074 __perf_sw_event(event_id, nr, nmi, regs, addr);
1075} 1073}
1076 1074
1077extern atomic_t perf_sched_events; 1075extern struct jump_label_key perf_sched_events;
1078 1076
1079static inline void perf_event_task_sched_in(struct task_struct *task) 1077static inline void perf_event_task_sched_in(struct task_struct *task)
1080{ 1078{
1081 COND_STMT(&perf_sched_events, __perf_event_task_sched_in(task)); 1079 if (static_branch(&perf_sched_events))
1080 __perf_event_task_sched_in(task);
1082} 1081}
1083 1082
1084static inline 1083static inline