Commit | Line | Data |
---|---|---|
cfa6cc1d MD |
1 | # SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) |
2 | ||
600da0c9 MJ |
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 | ||
cfa6cc1d MD |
9 | TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/.. |
10 | ||
600da0c9 MJ |
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 | |
cfa6cc1d MD |
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 | |
250c663f | 35 | obj-$(CONFIG_LTTNG) += lttng-ring-buffer-event-notifier-client.o |
a101fa10 MD |
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 | ||
cfa6cc1d MD |
42 | obj-$(CONFIG_LTTNG) += lttng-clock.o |
43 | ||
44 | obj-$(CONFIG_LTTNG) += lttng-tracer.o | |
45 | ||
46 | obj-$(CONFIG_LTTNG) += lttng-wrapper.o | |
47 | ||
7ab8c616 FD |
48 | lttng-tracer-objs := lib/msgpack/msgpack.o \ |
49 | lttng-events.o lttng-abi.o lttng-string-utils.o \ | |
cfa6cc1d MD |
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 \ | |
437d5aa5 | 70 | lttng-calibrate.o \ |
cfa6cc1d | 71 | lttng-context-hostname.o \ |
437d5aa5 | 72 | lttng-context-callstack.o \ |
cfa6cc1d MD |
73 | probes/lttng.o \ |
74 | lttng-tracker-id.o \ | |
80c2a69a FD |
75 | lttng-bytecode.o lttng-bytecode-interpreter.o \ |
76 | lttng-bytecode-specialize.o \ | |
77 | lttng-bytecode-validator.o \ | |
cfa6cc1d MD |
78 | probes/lttng-probe-user.o \ |
79 | lttng-tp-mempool.o \ | |
21f58fb7 | 80 | lttng-event-notifier-notification.o |
cfa6cc1d MD |
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 \ | |
7633c773 | 88 | wrapper/genhd.o \ |
cfa6cc1d MD |
89 | lttng-wrapper-impl.o |
90 | ||
91 | ifneq ($(CONFIG_HAVE_SYSCALL_TRACEPOINTS),) | |
92 | lttng-tracer-objs += lttng-syscalls.o | |
93 | endif # CONFIG_HAVE_SYSCALL_TRACEPOINTS | |
94 | ||
95 | ifneq ($(CONFIG_PERF_EVENTS),) | |
96 | lttng-tracer-objs += lttng-context-perf-counters.o | |
97 | endif # CONFIG_PERF_EVENTS | |
98 | ||
99 | ifneq ($(CONFIG_PREEMPT_RT_FULL),) | |
100 | lttng-tracer-objs += lttng-context-migratable.o | |
101 | lttng-tracer-objs += lttng-context-preemptible.o | |
102 | endif # CONFIG_PREEMPT_RT_FULL | |
103 | ||
104 | ifneq ($(CONFIG_PREEMPT),) | |
105 | lttng-tracer-objs += lttng-context-preemptible.o | |
106 | endif | |
107 | ||
108 | lttng-tracer-objs += $(shell \ | |
109 | if [ $(VERSION) -ge 4 \ | |
110 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 15 \) ] ; then \ | |
111 | echo "lttng-tracepoint.o" ; fi;) | |
112 | ||
113 | lttng-tracer-objs += lttng-context-cgroup-ns.o | |
114 | ||
115 | ifneq ($(CONFIG_IPC_NS),) | |
116 | lttng-tracer-objs += lttng-context-ipc-ns.o | |
117 | endif | |
118 | ||
119 | ifneq ($(wildcard $(mnt_ns_dep)),) | |
120 | lttng-tracer-objs += lttng-context-mnt-ns.o | |
121 | endif | |
122 | ||
123 | ifneq ($(CONFIG_NET_NS),) | |
124 | lttng-tracer-objs += lttng-context-net-ns.o | |
125 | endif | |
126 | ||
127 | ifneq ($(CONFIG_PID_NS),) | |
128 | lttng-tracer-objs += lttng-context-pid-ns.o | |
129 | endif | |
130 | ||
131 | ifneq ($(CONFIG_USER_NS),) | |
132 | lttng-tracer-objs += lttng-context-user-ns.o | |
133 | endif | |
134 | ||
135 | ifneq ($(CONFIG_UTS_NS),) | |
136 | lttng-tracer-objs += lttng-context-uts-ns.o | |
137 | endif | |
138 | ||
876e2e92 MJ |
139 | ifneq ($(CONFIG_TIME_NS),) |
140 | lttng-tracer-objs += lttng-context-time-ns.o | |
141 | endif | |
142 | ||
cfa6cc1d MD |
143 | obj-$(CONFIG_LTTNG) += lttng-statedump.o |
144 | lttng-statedump-objs := lttng-statedump-impl.o | |
145 | ||
146 | obj-$(CONFIG_LTTNG) += probes/ | |
147 | obj-$(CONFIG_LTTNG) += lib/ | |
600da0c9 | 148 | obj-$(CONFIG_LTTNG) += tests/ |