diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-05-21 09:11:34 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-06-09 05:12:33 -0400 |
commit | ecc55f84b2e9741f29daa787ded93986df6cbe17 (patch) | |
tree | 9da1012eb14faf8133e7e432b0da581ed55de6ee | |
parent | e768aee89c687a50e6a2110e30c5cae1fbf0d2da (diff) |
perf, trace: Inline perf_swevent_put_recursion_context()
Inline perf_swevent_put_recursion_context into perf_tp_event(), this
shrinks the per trace template code footprint and saves a function
call.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/linux/ftrace_event.h | 3 | ||||
-rw-r--r-- | include/linux/perf_event.h | 2 | ||||
-rw-r--r-- | kernel/perf_event.c | 8 |
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 | |||
257 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, | 257 | perf_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) | |||
1001 | extern void perf_event_init(void); | 1001 | extern void perf_event_init(void); |
1002 | extern void perf_tp_event(u64 addr, u64 count, void *record, | 1002 | extern 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); |
1005 | extern void perf_bp_event(struct perf_event *event, void *data); | 1005 | extern 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 | } |
4214 | EXPORT_SYMBOL_GPL(perf_swevent_get_recursion_context); | 4214 | EXPORT_SYMBOL_GPL(perf_swevent_get_recursion_context); |
4215 | 4215 | ||
4216 | void perf_swevent_put_recursion_context(int rctx) | 4216 | void 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 | } |
4222 | EXPORT_SYMBOL_GPL(perf_swevent_put_recursion_context); | ||
4223 | |||
4224 | 4222 | ||
4225 | void __perf_sw_event(u32 event_id, u64 nr, int nmi, | 4223 | void __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 | ||
4603 | void perf_tp_event(u64 addr, u64 count, void *record, int entry_size, | 4601 | void 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 | } |
4625 | EXPORT_SYMBOL_GPL(perf_tp_event); | 4625 | EXPORT_SYMBOL_GPL(perf_tp_event); |
4626 | 4626 | ||