summaryrefslogtreecommitdiffstats
path: root/include/trace/perf.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@fb.com>2016-04-19 05:11:50 +0200
committerDavid S. Miller <davem@davemloft.net>2016-04-21 19:48:20 +0200
commit85b67bcb7e4a23ced05e7020bf5843b9857f6881 (patch)
tree5cb64f3464f1beeed2f950cc3cc2f41b121de2bf /include/trace/perf.h
parentnet: dsa: remove tag_protocol from dsa_switch (diff)
downloadlinux-85b67bcb7e4a23ced05e7020bf5843b9857f6881.tar.xz
linux-85b67bcb7e4a23ced05e7020bf5843b9857f6881.zip
perf, bpf: minimize the size of perf_trace_() tracepoint handler
move trace_call_bpf() into helper function to minimize the size of perf_trace_*() tracepoint handlers. text data bss dec hex filename 10541679 5526646 2945024 19013349 1221ee5 vmlinux_before 10509422 5526646 2945024 18981092 121a0e4 vmlinux_after It may seem that perf_fetch_caller_regs() can also be moved, but that is incorrect, since ip/sp will be wrong. bpf+tracepoint performance is not affected, since perf_swevent_put_recursion_context() is now inlined. export_symbol_gpl can also be dropped. No measurable change in normal perf tracepoints. Suggested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/trace/perf.h')
-rw-r--r--include/trace/perf.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/include/trace/perf.h b/include/trace/perf.h
index a182306eefd7..88de5c205e86 100644
--- a/include/trace/perf.h
+++ b/include/trace/perf.h
@@ -64,16 +64,9 @@ perf_trace_##call(void *__data, proto) \
\
{ assign; } \
\
- if (prog) { \
- *(struct pt_regs **)entry = __regs; \
- if (!trace_call_bpf(prog, entry) || hlist_empty(head)) { \
- perf_swevent_put_recursion_context(rctx); \
- return; \
- } \
- } \
- perf_trace_buf_submit(entry, __entry_size, rctx, \
- event_call->event.type, __count, __regs, \
- head, __task); \
+ perf_trace_run_bpf_submit(entry, __entry_size, rctx, \
+ event_call, __count, __regs, \
+ head, __task); \
}
/*