Split syscall tracepoint generation in their own files
[lttng-modules.git] / src / Kbuild
1 # SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
2
3 ifdef CONFIG_LOCALVERSION # Check if dot-config is included.
4 ifeq ($(CONFIG_TRACEPOINTS),)
5 $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
6 endif # CONFIG_TRACEPOINTS
7 endif # ifdef CONFIG_LOCALVERSION
8
9 TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
10
11 lttng_check_linux_version = $(shell pwd)/include/linux/version.h
12 lttng_check_generated_linux_version = $(shell pwd)/include/generated/uapi/linux/version.h
13
14 #
15 # Check for stale version.h, which can be a leftover from an old Linux
16 # kernel tree moved to a newer kernel version, only pruned by make
17 # distclean.
18 #
19 ifneq ($(wildcard $(lttng_check_linux_version)),)
20 ifneq ($(wildcard $(lttng_check_generated_linux_version)),)
21 $(error Duplicate version.h files found in $(lttng_check_linux_version) and $(lttng_check_generated_linux_version). Consider running make distclean on your kernel, or removing the stale $(lttng_check_linux_version) file)
22 endif
23 endif
24
25 include $(TOP_LTTNG_MODULES_DIR)/src/Kbuild.common
26
27 ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)/include
28
29 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-client-discard.o
30 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-client-overwrite.o
31 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-metadata-client.o
32 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-client-mmap-discard.o
33 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-client-mmap-overwrite.o
34 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-metadata-mmap-client.o
35 obj-$(CONFIG_LTTNG) += lttng-ring-buffer-event-notifier-client.o
36
37 obj-$(CONFIG_LTTNG) += lttng-counter-client-percpu-32-modular.o
38 ifneq ($CONFIG_64BIT),)
39 obj-$(CONFIG_LTTNG) += lttng-counter-client-percpu-64-modular.o
40 endif # CONFIG_64BIT
41
42 obj-$(CONFIG_LTTNG) += lttng-clock.o
43
44 obj-$(CONFIG_LTTNG) += lttng-tracer.o
45
46 obj-$(CONFIG_LTTNG) += lttng-wrapper.o
47
48 lttng-tracer-objs := lib/msgpack/msgpack.o \
49 lttng-events.o lttng-abi.o lttng-string-utils.o \
50 lttng-probes.o lttng-context.o \
51 lttng-context-pid.o lttng-context-procname.o \
52 lttng-context-prio.o lttng-context-nice.o \
53 lttng-context-vpid.o lttng-context-tid.o \
54 lttng-context-vtid.o lttng-context-ppid.o \
55 lttng-context-vppid.o lttng-context-cpu-id.o \
56 lttng-context-uid.o \
57 lttng-context-euid.o \
58 lttng-context-suid.o \
59 lttng-context-gid.o \
60 lttng-context-egid.o \
61 lttng-context-sgid.o \
62 lttng-context-vuid.o \
63 lttng-context-veuid.o \
64 lttng-context-vsuid.o \
65 lttng-context-vgid.o \
66 lttng-context-vegid.o \
67 lttng-context-vsgid.o \
68 lttng-context-interruptible.o \
69 lttng-context-need-reschedule.o \
70 lttng-calibrate.o \
71 lttng-context-hostname.o \
72 lttng-context-callstack.o \
73 probes/lttng.o \
74 lttng-tracker-id.o \
75 lttng-bytecode.o lttng-bytecode-interpreter.o \
76 lttng-bytecode-specialize.o \
77 lttng-bytecode-validator.o \
78 probes/lttng-probe-user.o \
79 lttng-tp-mempool.o \
80 lttng-event-notifier-notification.o
81
82 lttng-wrapper-objs := wrapper/page_alloc.o \
83 wrapper/random.o \
84 wrapper/trace-clock.o \
85 wrapper/kallsyms.o \
86 wrapper/irqdesc.o \
87 wrapper/fdtable.o \
88 wrapper/genhd.o \
89 lttng-wrapper-impl.o
90
91 ifneq ($(CONFIG_HAVE_SYSCALL_TRACEPOINTS),)
92 lttng-tracer-objs += lttng-syscalls.o
93 lttng-tracer-objs += lttng-syscalls-entry-table.o
94 lttng-tracer-objs += lttng-syscalls-entry-compat-table.o
95 lttng-tracer-objs += lttng-syscalls-exit-table.o
96 lttng-tracer-objs += lttng-syscalls-exit-compat-table.o
97 lttng-tracer-objs += lttng-syscalls-enum.o
98 endif # CONFIG_HAVE_SYSCALL_TRACEPOINTS
99
100 ifneq ($(CONFIG_PERF_EVENTS),)
101 lttng-tracer-objs += lttng-context-perf-counters.o
102 endif # CONFIG_PERF_EVENTS
103
104 ifneq ($(CONFIG_PREEMPT_RT_FULL),)
105 lttng-tracer-objs += lttng-context-migratable.o
106 lttng-tracer-objs += lttng-context-preemptible.o
107 endif # CONFIG_PREEMPT_RT_FULL
108
109 ifneq ($(CONFIG_PREEMPT),)
110 lttng-tracer-objs += lttng-context-preemptible.o
111 endif
112
113 lttng-tracer-objs += $(shell \
114 if [ $(VERSION) -ge 4 \
115 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 15 \) ] ; then \
116 echo "lttng-tracepoint.o" ; fi;)
117
118 lttng-tracer-objs += lttng-context-cgroup-ns.o
119
120 ifneq ($(CONFIG_IPC_NS),)
121 lttng-tracer-objs += lttng-context-ipc-ns.o
122 endif
123
124 ifneq ($(wildcard $(mnt_ns_dep)),)
125 lttng-tracer-objs += lttng-context-mnt-ns.o
126 endif
127
128 ifneq ($(CONFIG_NET_NS),)
129 lttng-tracer-objs += lttng-context-net-ns.o
130 endif
131
132 ifneq ($(CONFIG_PID_NS),)
133 lttng-tracer-objs += lttng-context-pid-ns.o
134 endif
135
136 ifneq ($(CONFIG_USER_NS),)
137 lttng-tracer-objs += lttng-context-user-ns.o
138 endif
139
140 ifneq ($(CONFIG_UTS_NS),)
141 lttng-tracer-objs += lttng-context-uts-ns.o
142 endif
143
144 ifneq ($(CONFIG_TIME_NS),)
145 lttng-tracer-objs += lttng-context-time-ns.o
146 endif
147
148 obj-$(CONFIG_LTTNG) += lttng-statedump.o
149 lttng-statedump-objs := lttng-statedump-impl.o
150
151 obj-$(CONFIG_LTTNG) += probes/
152 obj-$(CONFIG_LTTNG) += lib/
153 obj-$(CONFIG_LTTNG) += tests/
This page took 0.0317460000000001 seconds and 4 git commands to generate.