fix: timer/trace: Improve timer tracing (v5.2)
[lttng-modules.git] / probes / Kbuild
CommitLineData
b933d85e 1TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
72e6c528 2
b933d85e 3include $(TOP_LTTNG_MODULES_DIR)/Makefile.ABI.workarounds
72e6c528 4
b933d85e 5ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)
6d61b34d 6
6ccec973
MJ
7obj-$(CONFIG_LTTNG) += lttng-probe-sched.o
8obj-$(CONFIG_LTTNG) += lttng-probe-irq.o
9obj-$(CONFIG_LTTNG) += lttng-probe-timer.o
10obj-$(CONFIG_LTTNG) += lttng-probe-kmem.o
11obj-$(CONFIG_LTTNG) += lttng-probe-module.o
12obj-$(CONFIG_LTTNG) += lttng-probe-power.o
6ccec973 13obj-$(CONFIG_LTTNG) += lttng-probe-statedump.o
c337ddc2 14
a918229e
MD
15i2c_dep = $(srctree)/include/trace/events/i2c.h
16ifneq ($(wildcard $(i2c_dep)),)
17 obj-$(CONFIG_LTTNG) += lttng-probe-i2c.o
18endif
19
056f5922 20ifneq ($(CONFIG_KVM),)
808dd6df
MJ
21 obj-$(CONFIG_LTTNG) += lttng-probe-kvm.o
22 ifneq ($(CONFIG_X86),)
23 kvm_dep_lapic = $(srctree)/arch/x86/kvm/lapic.h
24 ifneq ($(wildcard $(kvm_dep_lapic)),)
25 kvm_dep = $(srctree)/virt/kvm/iodev.h $(srctree)/include/kvm/iodev.h
26 ifneq ($(wildcard $(kvm_dep)),)
27 CFLAGS_lttng-probe-kvm-x86.o += -I$(srctree)/virt/kvm
28 CFLAGS_lttng-probe-kvm-x86-mmu.o += -I$(srctree)/virt/kvm
29 obj-$(CONFIG_LTTNG) += $(shell \
30 if [ $(VERSION) -ge 3 \
78b33418 31 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
808dd6df
MJ
32 echo "lttng-probe-kvm-x86.o" ; fi;)
33 obj-$(CONFIG_LTTNG) += $(shell \
34 if [ $(VERSION) -ge 3 \
78b33418 35 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
808dd6df
MJ
36 echo "lttng-probe-kvm-x86-mmu.o" ; fi;)
37 else
38 $(warning File $(kvm_dep) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.)
39 endif # $(wildcard $(kvm_dep))
40 else
41 $(warning File $(kvm_dep_lapic) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.)
42 endif # $(wildcard $(kvm_dep_lapic))
43 endif # CONFIG_X86
44endif # CONFIG_KVM
056f5922 45
d2507215 46ifneq ($(CONFIG_X86),)
808dd6df 47 x86_irq_vectors_dep = $(srctree)/arch/x86/include/asm/trace/irq_vectors.h
da0f6c58 48
808dd6df
MJ
49 ifneq ($(wildcard $(x86_irq_vectors_dep)),)
50 obj-$(CONFIG_LTTNG) += lttng-probe-x86-irq-vectors.o
51 endif # $(wildcard $(x86_irq_vectors_dep))
da0f6c58 52
808dd6df 53 x86_exceptions_dep = $(srctree)/arch/x86/include/asm/trace/exceptions.h
da0f6c58 54
808dd6df
MJ
55 ifneq ($(wildcard $(x86_exceptions_dep)),)
56 obj-$(CONFIG_LTTNG) += lttng-probe-x86-exceptions.o
57 endif # $(wildcard $(x86_exceptions_dep))
58endif # CONFIG_X86
d2507215 59
6ccec973 60obj-$(CONFIG_LTTNG) += $(shell \
808dd6df 61 if [ $(VERSION) -ge 3 \
78b33418 62 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 33 \) ] ; then \
808dd6df 63 echo "lttng-probe-signal.o" ; fi;)
3a523f5b 64
c9604bd3 65ifneq ($(CONFIG_BLOCK),)
808dd6df
MJ
66 # need blk_cmd_buf_len
67 ifneq ($(CONFIG_EVENT_TRACING),)
68 obj-$(CONFIG_LTTNG) += lttng-probe-block.o
69 endif # CONFIG_EVENT_TRACING
70endif # CONFIG_BLOCK
c9604bd3 71
b283666f 72ifneq ($(CONFIG_NET),)
808dd6df
MJ
73 obj-$(CONFIG_LTTNG) += lttng-probe-napi.o
74 obj-$(CONFIG_LTTNG) += lttng-probe-skb.o
75 obj-$(CONFIG_LTTNG) += $(shell \
76 if [ $(VERSION) -ge 3 \
78b33418 77 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 37 \) ] ; then \
808dd6df
MJ
78 echo "lttng-probe-net.o" ; fi;)
79 obj-$(CONFIG_LTTNG) += $(shell \
80 if [ $(VERSION) -ge 4 \
81 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
82 echo "lttng-probe-sock.o" ; fi;)
83 obj-$(CONFIG_LTTNG) += $(shell \
84 if [ $(VERSION) -ge 4 \
85 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
86 echo "lttng-probe-udp.o" ; fi;)
87endif # CONFIG_NET
b283666f
PW
88
89ifneq ($(CONFIG_SND_SOC),)
808dd6df
MJ
90 obj-$(CONFIG_LTTNG) += $(shell \
91 if [ $(VERSION) -ge 3 \
78b33418 92 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
808dd6df
MJ
93 echo "lttng-probe-asoc.o" ; fi;)
94endif # CONFIG_SND_SOC
b283666f
PW
95
96ifneq ($(CONFIG_EXT3_FS),)
808dd6df
MJ
97 ext3_dep = $(srctree)/fs/ext3/*.h
98 ext3_dep_check = $(wildcard $(ext3_dep))
99 ext3 = $(shell \
8f89e22d
MJ
100 if [ $(VERSION) -lt 4 -o \( $(VERSION) -eq 4 -a $(PATCHLEVEL) -lt 3 \) ] ; then \
101 if [ $(VERSION) -ge 4 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
102 if [ \( $(VERSION) -ge 4 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) \) -a \
103 -z "$(ext3_dep_check)" ] ; then \
104 echo "warn" ; \
105 exit ; \
106 fi; \
107 echo "lttng-probe-ext3.o" ; \
808dd6df 108 fi; \
808dd6df
MJ
109 fi;)
110 ifeq ($(ext3),warn)
111 $(warning Files $(ext3_dep) not found. Probe "ext3" is disabled. Use full kernel source tree to enable it.)
112 ext3 =
113 endif # $(ext3),warn
114 obj-$(CONFIG_LTTNG) += $(ext3)
115endif # CONFIG_EXT3_FS
b283666f
PW
116
117ifneq ($(CONFIG_GPIOLIB),)
808dd6df
MJ
118 obj-$(CONFIG_LTTNG) += $(shell \
119 if [ $(VERSION) -ge 3 ] ; then \
120 echo "lttng-probe-gpio.o" ; fi;)
121endif # CONFIG_GPIOLIB
b283666f
PW
122
123ifneq ($(CONFIG_JBD2),)
808dd6df
MJ
124 obj-$(CONFIG_LTTNG) += lttng-probe-jbd2.o
125endif # CONFIG_JBD2
b283666f
PW
126
127ifneq ($(CONFIG_JBD),)
808dd6df
MJ
128 obj-$(CONFIG_LTTNG) += $(shell \
129 if [ $(VERSION) -ge 4 \
130 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
131 echo "lttng-probe-jbd.o" ; fi;)
132endif # CONFIG_JBD
b283666f
PW
133
134ifneq ($(CONFIG_REGULATOR),)
808dd6df
MJ
135 obj-$(CONFIG_LTTNG) += $(shell \
136 if [ $(VERSION) -ge 3 \
78b33418 137 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
808dd6df
MJ
138 echo "lttng-probe-regulator.o" ; fi;)
139endif # CONFIG_REGULATOR
b283666f
PW
140
141ifneq ($(CONFIG_SCSI),)
808dd6df
MJ
142 obj-$(CONFIG_LTTNG) += $(shell \
143 if [ $(VERSION) -ge 3 \
78b33418 144 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 35 \) ] ; then \
808dd6df
MJ
145 echo "lttng-probe-scsi.o" ; fi;)
146endif # CONFIG_SCSI
b283666f 147
7b2f646c 148obj-$(CONFIG_LTTNG) += $(shell \
808dd6df 149 if [ $(VERSION) -ge 3 \
78b33418 150 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
808dd6df
MJ
151 echo "lttng-probe-vmscan.o" ; fi;)
152
7c68b363
AG
153# lock probe does not work, so disabling it for now
154#ifneq ($(CONFIG_LOCKDEP),)
808dd6df
MJ
155# obj-$(CONFIG_LTTNG) += lttng-probe-lock.o
156#endif # CONFIG_LOCKDEP
7c68b363 157
b87700e3 158ifneq ($(CONFIG_BTRFS_FS),)
808dd6df
MJ
159 btrfs_dep = $(srctree)/fs/btrfs/*.h
160 btrfs = $(shell \
161 if [ $(VERSION) -ge 3 \
78b33418 162 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 39 \) ] ; then \
808dd6df
MJ
163 echo "lttng-probe-btrfs.o" ; fi;)
164 ifneq ($(btrfs),)
165 ifeq ($(wildcard $(btrfs_dep)),)
166 $(warning Files $(btrfs_dep) not found. Probe "btrfs" is disabled. Use full kernel source tree to enable it.)
167 btrfs =
168 endif # $(wildcard $(btrfs_dep))
169 endif # $(btrfs)
170 obj-$(CONFIG_LTTNG) += $(btrfs)
171endif # CONFIG_BTRFS_FS
b87700e3 172
6ccec973 173obj-$(CONFIG_LTTNG) += $(shell \
808dd6df 174 if [ $(VERSION) -ge 3 \
78b33418 175 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
808dd6df 176 echo "lttng-probe-compaction.o" ; fi;)
b87700e3
AG
177
178ifneq ($(CONFIG_EXT4_FS),)
808dd6df
MJ
179 ext4_dep = $(srctree)/fs/ext4/*.h
180 ext4 = lttng-probe-ext4.o
181 ifeq ($(wildcard $(ext4_dep)),)
182 $(warning Files $(ext4_dep) not found. Probe "ext4" is disabled. Use full kernel source tree to enable it.)
183 ext4 =
184 endif # $(wildcard $(ext4_dep))
185 obj-$(CONFIG_LTTNG) += $(ext4)
186endif # CONFIG_EXT4_FS
b87700e3 187
6ccec973 188obj-$(CONFIG_LTTNG) += $(shell \
808dd6df
MJ
189 if [ $(VERSION) -ge 4 \
190 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) ] ; then \
191 echo "lttng-probe-printk.o" ; fi;)
192
b87700e3 193ifneq ($(CONFIG_FRAME_WARN),0)
808dd6df 194 CFLAGS_lttng-probe-printk.o += -Wframe-larger-than=2200
b87700e3
AG
195endif
196
6ccec973 197obj-$(CONFIG_LTTNG) += $(shell \
808dd6df
MJ
198 if [ $(VERSION) -ge 4 \
199 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 6 \) \
200 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 5 -a $(SUBLEVEL) -ge 2 \) \
201 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 4 -a $(SUBLEVEL) -ge 9 \) \
202 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 0 -a $(SUBLEVEL) -ge 41 \) ] ; then \
203 echo "lttng-probe-random.o" ; fi;)
b87700e3 204
6ccec973 205obj-$(CONFIG_LTTNG) += $(shell \
808dd6df
MJ
206 if [ $(VERSION) -ge 4 \
207 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \
208 echo "lttng-probe-rcu.o" ; fi;)
b87700e3
AG
209
210ifneq ($(CONFIG_REGMAP),)
808dd6df
MJ
211 regmap_dep_4_1 = $(srctree)/drivers/base/regmap/trace.h
212 ifneq ($(wildcard $(regmap_dep_4_1)),)
213 obj-$(CONFIG_LTTNG) += lttng-probe-regmap.o
214 else
215 $(warning File $(regmap_dep_4_1) not found. Probe "regmap" is disabled. Need Linux 4.1+ kernel source tree to enable it.)
216 endif # $(wildcard $(regmap_dep_4_1)),
217endif # CONFIG_REGMAP
b87700e3
AG
218
219ifneq ($(CONFIG_PM_RUNTIME),)
808dd6df
MJ
220 obj-$(CONFIG_LTTNG) += $(shell \
221 if [ $(VERSION) -ge 4 \
222 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \
223 echo "lttng-probe-rpm.o" ; fi;)
224endif # CONFIG_PM_RUNTIME
b87700e3
AG
225
226ifneq ($(CONFIG_SUNRPC),)
808dd6df
MJ
227 obj-$(CONFIG_LTTNG) += $(shell \
228 if [ $(VERSION) -ge 4 \
229 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) ] ; then \
230 echo "lttng-probe-sunrpc.o" ; fi;)
231endif # CONFIG_SUNRPC
b87700e3 232
e09a6084 233ifneq ($(CONFIG_VIDEO_V4L2),)
808dd6df
MJ
234 obj-$(CONFIG_LTTNG) += $(shell \
235 if [ $(VERSION) -ge 4 \
236 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 14 \) ] ; then \
237 echo "lttng-probe-v4l2.o" ; fi;)
238endif # CONFIG_VIDEO_V4L2
e09a6084 239
6ccec973 240obj-$(CONFIG_LTTNG) += lttng-probe-workqueue.o
b87700e3 241
42d9070d 242ifneq ($(CONFIG_KALLSYMS_ALL),)
808dd6df
MJ
243 obj-$(CONFIG_LTTNG) += $(shell \
244 if [ $(VERSION) -ge 3 \
78b33418 245 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
808dd6df 246 echo "lttng-probe-writeback.o" ; fi;)
bf2ba318 247else
2aa13013
MJ
248 ifdef CONFIG_LOCALVERSION # Check if dot-config is included.
249 $(warning CONFIG_KALLSYMS_ALL is disabled, therefore probe "writeback" is disabled. Rebuild your kernel with this configuration option enabled in order to trace this subsystem.)
250 endif
808dd6df 251endif # CONFIG_KALLSYMS_ALL
b283666f 252
acd614cc 253ifneq ($(CONFIG_KPROBES),)
808dd6df
MJ
254 obj-$(CONFIG_LTTNG) += lttng-kprobes.o
255endif # CONFIG_KPROBES
7371f44c
MD
256
257ifneq ($(CONFIG_KRETPROBES),)
808dd6df
MJ
258 obj-$(CONFIG_LTTNG) += lttng-kretprobes.o
259endif # CONFIG_KRETPROBES
7371f44c 260
e0a7a7c4 261ifneq ($(CONFIG_DYNAMIC_FTRACE),)
fea65d0c
MJ
262 ifeq ($(have_ftrace_header),yes)
263 obj-$(CONFIG_LTTNG) += lttng-ftrace.o
264 else
2b31a1ab 265 $(warning Files $(ftrace_dep) not found. Probe "ftrace" is disabled. Use full kernel source tree to enable it.)
fea65d0c 266 endif
808dd6df 267endif # CONFIG_DYNAMIC_FTRACE
6d61b34d 268
50984b44 269# vim:syntax=make
This page took 0.057247 seconds and 4 git commands to generate.