1 # SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
3 TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
5 include $(TOP_LTTNG_MODULES_DIR)/Kbuild.common
7 ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)/include
9 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-client-discard.o
10 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-client-overwrite.o
11 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-metadata-client.o
12 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-client-mmap-discard.o
13 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-client-mmap-overwrite.o
14 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-metadata-mmap-client.o
15 obj-$(CONFIG_LTTNG) += lttng-clock.o
17 obj-$(CONFIG_LTTNG) += lttng-tracer.o
19 obj-$(CONFIG_LTTNG) += lttng-wrapper.o
21 lttng-tracer-objs := lttng-events.o lttng-abi.o lttng-string-utils.o \
22 lttng-probes.o lttng-context.o \
23 lttng-context-pid.o lttng-context-procname.o \
24 lttng-context-prio.o lttng-context-nice.o \
25 lttng-context-vpid.o lttng-context-tid.o \
26 lttng-context-vtid.o lttng-context-ppid.o \
27 lttng-context-vppid.o lttng-context-cpu-id.o \
29 lttng-context-euid.o \
30 lttng-context-suid.o \
32 lttng-context-egid.o \
33 lttng-context-sgid.o \
34 lttng-context-vuid.o \
35 lttng-context-veuid.o \
36 lttng-context-vsuid.o \
37 lttng-context-vgid.o \
38 lttng-context-vegid.o \
39 lttng-context-vsgid.o \
40 lttng-context-interruptible.o \
41 lttng-context-need-reschedule.o \
42 lttng-context-callstack.o lttng-calibrate.o \
43 lttng-context-hostname.o \
46 lttng-filter.o lttng-filter-interpreter.o \
47 lttng-filter-specialize.o \
48 lttng-filter-validator.o \
49 probes/lttng-probe-user.o \
52 lttng-wrapper-objs := wrapper/page_alloc.o \
54 wrapper/trace-clock.o \
60 ifneq ($(CONFIG_HAVE_SYSCALL_TRACEPOINTS),)
61 lttng-tracer-objs += lttng-syscalls.o
62 endif # CONFIG_HAVE_SYSCALL_TRACEPOINTS
64 ifneq ($(CONFIG_PERF_EVENTS),)
65 lttng-tracer-objs += lttng-context-perf-counters.o
66 endif # CONFIG_PERF_EVENTS
68 ifneq ($(CONFIG_PREEMPT_RT_FULL),)
69 lttng-tracer-objs += lttng-context-migratable.o
70 lttng-tracer-objs += lttng-context-preemptible.o
71 endif # CONFIG_PREEMPT_RT_FULL
73 ifneq ($(CONFIG_PREEMPT),)
74 lttng-tracer-objs += lttng-context-preemptible.o
77 lttng-tracer-objs += $(shell \
78 if [ $(VERSION) -ge 4 \
79 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 15 \) ] ; then \
80 echo "lttng-tracepoint.o" ; fi;)
82 lttng-tracer-objs += lttng-context-cgroup-ns.o
84 ifneq ($(CONFIG_IPC_NS),)
85 lttng-tracer-objs += lttng-context-ipc-ns.o
88 ifneq ($(wildcard $(mnt_ns_dep)),)
89 lttng-tracer-objs += lttng-context-mnt-ns.o
92 ifneq ($(CONFIG_NET_NS),)
93 lttng-tracer-objs += lttng-context-net-ns.o
96 ifneq ($(CONFIG_PID_NS),)
97 lttng-tracer-objs += lttng-context-pid-ns.o
100 ifneq ($(CONFIG_USER_NS),)
101 lttng-tracer-objs += lttng-context-user-ns.o
104 ifneq ($(CONFIG_UTS_NS),)
105 lttng-tracer-objs += lttng-context-uts-ns.o
108 ifneq ($(CONFIG_TIME_NS),)
109 lttng-tracer-objs += lttng-context-time-ns.o
112 obj-$(CONFIG_LTTNG) += lttng-statedump.o
113 lttng-statedump-objs := lttng-statedump-impl.o
115 obj-$(CONFIG_LTTNG) += probes/
116 obj-$(CONFIG_LTTNG) += lib/