mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 17:54:13 +08:00
e1abf2cc8d
So bpf_tracing.o depends on CONFIG_BPF_SYSCALL - but that's not its only dependency, it also depends on the tracing infrastructure and on kprobes, without which it will fail to build with: In file included from kernel/trace/bpf_trace.c:14:0: kernel/trace/trace.h: In function ‘trace_test_and_set_recursion’: kernel/trace/trace.h:491:28: error: ‘struct task_struct’ has no member named ‘trace_recursion’ unsigned int val = current->trace_recursion; [...] It took quite some time to trigger this build failure, because right now BPF_SYSCALL is very obscure, depends on CONFIG_EXPERT. So also make BPF_SYSCALL more configurable, not just under CONFIG_EXPERT. If BPF_SYSCALL, tracing and kprobes are enabled then enable the bpf_tracing gateway as well. We might want to make this an interactive option later on, although I'd not complicate it unnecessarily: enabling BPF_SYSCALL is enough of an indicator that the user wants BPF support. Cc: Alexei Starovoitov <ast@plumgrid.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: David S. Miller <davem@davemloft.net> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
71 lines
2.3 KiB
Makefile
71 lines
2.3 KiB
Makefile
|
|
# Do not instrument the tracer itself:
|
|
|
|
ifdef CONFIG_FUNCTION_TRACER
|
|
ORIG_CFLAGS := $(KBUILD_CFLAGS)
|
|
KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
|
|
|
|
ifdef CONFIG_FTRACE_SELFTEST
|
|
# selftest needs instrumentation
|
|
CFLAGS_trace_selftest_dynamic.o = $(CC_FLAGS_FTRACE)
|
|
obj-y += trace_selftest_dynamic.o
|
|
endif
|
|
endif
|
|
|
|
# If unlikely tracing is enabled, do not trace these files
|
|
ifdef CONFIG_TRACING_BRANCHES
|
|
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
|
|
endif
|
|
|
|
CFLAGS_trace_benchmark.o := -I$(src)
|
|
CFLAGS_trace_events_filter.o := -I$(src)
|
|
|
|
obj-$(CONFIG_TRACE_CLOCK) += trace_clock.o
|
|
|
|
obj-$(CONFIG_FUNCTION_TRACER) += libftrace.o
|
|
obj-$(CONFIG_RING_BUFFER) += ring_buffer.o
|
|
obj-$(CONFIG_RING_BUFFER_BENCHMARK) += ring_buffer_benchmark.o
|
|
|
|
obj-$(CONFIG_TRACING) += trace.o
|
|
obj-$(CONFIG_TRACING) += trace_output.o
|
|
obj-$(CONFIG_TRACING) += trace_seq.o
|
|
obj-$(CONFIG_TRACING) += trace_stat.o
|
|
obj-$(CONFIG_TRACING) += trace_printk.o
|
|
obj-$(CONFIG_CONTEXT_SWITCH_TRACER) += trace_sched_switch.o
|
|
obj-$(CONFIG_FUNCTION_TRACER) += trace_functions.o
|
|
obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o
|
|
obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o
|
|
obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o
|
|
obj-$(CONFIG_NOP_TRACER) += trace_nop.o
|
|
obj-$(CONFIG_STACK_TRACER) += trace_stack.o
|
|
obj-$(CONFIG_MMIOTRACE) += trace_mmiotrace.o
|
|
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += trace_functions_graph.o
|
|
obj-$(CONFIG_TRACE_BRANCH_PROFILING) += trace_branch.o
|
|
obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o
|
|
ifeq ($(CONFIG_BLOCK),y)
|
|
obj-$(CONFIG_EVENT_TRACING) += blktrace.o
|
|
endif
|
|
obj-$(CONFIG_EVENT_TRACING) += trace_events.o
|
|
obj-$(CONFIG_EVENT_TRACING) += trace_export.o
|
|
obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o
|
|
ifeq ($(CONFIG_PERF_EVENTS),y)
|
|
obj-$(CONFIG_EVENT_TRACING) += trace_event_perf.o
|
|
endif
|
|
obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
|
|
obj-$(CONFIG_EVENT_TRACING) += trace_events_trigger.o
|
|
obj-$(CONFIG_BPF_EVENTS) += bpf_trace.o
|
|
obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o
|
|
obj-$(CONFIG_TRACEPOINTS) += power-traces.o
|
|
ifeq ($(CONFIG_PM),y)
|
|
obj-$(CONFIG_TRACEPOINTS) += rpm-traces.o
|
|
endif
|
|
ifeq ($(CONFIG_TRACING),y)
|
|
obj-$(CONFIG_KGDB_KDB) += trace_kdb.o
|
|
endif
|
|
obj-$(CONFIG_PROBE_EVENTS) += trace_probe.o
|
|
obj-$(CONFIG_UPROBE_EVENT) += trace_uprobe.o
|
|
|
|
obj-$(CONFIG_TRACEPOINT_BENCHMARK) += trace_benchmark.o
|
|
|
|
libftrace-y := ftrace.o
|