aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ftrace_event.h3
-rw-r--r--include/linux/perf_event.h2
-rw-r--r--kernel/perf_event.c8
3 files changed, 6 insertions, 7 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 3167f2df4126..0af31cd335d6 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -257,8 +257,7 @@ static inline void
257perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, 257perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
258 u64 count, struct pt_regs *regs, void *head) 258 u64 count, struct pt_regs *regs, void *head)
259{ 259{
260 perf_tp_event(addr, count, raw_data, size, regs, head); 260 perf_tp_event(addr, count, raw_data, size, regs, head, rctx);
261 perf_swevent_put_recursion_context(rctx);
262} 261}
263#endif 262#endif
264 263
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 5d0266d94985..c691a0b27bcd 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1001,7 +1001,7 @@ static inline bool perf_paranoid_kernel(void)
1001extern void perf_event_init(void); 1001extern void perf_event_init(void);
1002extern void perf_tp_event(u64 addr, u64 count, void *record, 1002extern void perf_tp_event(u64 addr, u64 count, void *record,
1003 int entry_size, struct pt_regs *regs, 1003 int entry_size, struct pt_regs *regs,
1004 struct hlist_head *head); 1004 struct hlist_head *head, int rctx);
1005extern void perf_bp_event(struct perf_event *event, void *data); 1005extern void perf_bp_event(struct perf_event *event, void *data);
1006 1006
1007#ifndef perf_misc_flags 1007#ifndef perf_misc_flags
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index ff86c558af4c..4bd3b597bcca 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4213,14 +4213,12 @@ int perf_swevent_get_recursion_context(void)
4213} 4213}
4214EXPORT_SYMBOL_GPL(perf_swevent_get_recursion_context); 4214EXPORT_SYMBOL_GPL(perf_swevent_get_recursion_context);
4215 4215
4216void perf_swevent_put_recursion_context(int rctx) 4216void inline perf_swevent_put_recursion_context(int rctx)
4217{ 4217{
4218 struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context); 4218 struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
4219 barrier(); 4219 barrier();
4220 cpuctx->recursion[rctx]--; 4220 cpuctx->recursion[rctx]--;
4221} 4221}
4222EXPORT_SYMBOL_GPL(perf_swevent_put_recursion_context);
4223
4224 4222
4225void __perf_sw_event(u32 event_id, u64 nr, int nmi, 4223void __perf_sw_event(u32 event_id, u64 nr, int nmi,
4226 struct pt_regs *regs, u64 addr) 4224 struct pt_regs *regs, u64 addr)
@@ -4601,7 +4599,7 @@ static int perf_tp_event_match(struct perf_event *event,
4601} 4599}
4602 4600
4603void perf_tp_event(u64 addr, u64 count, void *record, int entry_size, 4601void perf_tp_event(u64 addr, u64 count, void *record, int entry_size,
4604 struct pt_regs *regs, struct hlist_head *head) 4602 struct pt_regs *regs, struct hlist_head *head, int rctx)
4605{ 4603{
4606 struct perf_sample_data data; 4604 struct perf_sample_data data;
4607 struct perf_event *event; 4605 struct perf_event *event;
@@ -4621,6 +4619,8 @@ void perf_tp_event(u64 addr, u64 count, void *record, int entry_size,
4621 perf_swevent_add(event, count, 1, &data, regs); 4619 perf_swevent_add(event, count, 1, &data, regs);
4622 } 4620 }
4623 rcu_read_unlock(); 4621 rcu_read_unlock();
4622
4623 perf_swevent_put_recursion_context(rctx);
4624} 4624}
4625EXPORT_SYMBOL_GPL(perf_tp_event); 4625EXPORT_SYMBOL_GPL(perf_tp_event);
4626 4626