Fix: SWITCH_FLUSH new sub-buffer checks
[lttng-modules.git] / probes / Makefile
... / ...
CommitLineData
1#
2# Makefile for the LTT probes.
3# Only build from the package top-level directory. Never use with make directly.
4
5ifneq ($(KERNELRELEASE),)
6ifneq ($(CONFIG_TRACEPOINTS),)
7
8ccflags-y += -I$(PWD)/probes
9obj-m += lttng-types.o
10
11obj-m += lttng-probe-sched.o
12obj-m += lttng-probe-irq.o
13obj-m += lttng-probe-timer.o
14obj-m += lttng-probe-kmem.o
15obj-m += lttng-probe-module.o
16obj-m += lttng-probe-power.o
17
18obj-m += lttng-probe-statedump.o
19
20ifneq ($(CONFIG_KVM),)
21obj-m += lttng-probe-kvm.o
22endif
23
24obj-m += $(shell \
25 if [ $(VERSION) -ge 3 \
26 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 33 \) ] ; then \
27 echo "lttng-probe-signal.o" ; fi;)
28
29ifneq ($(CONFIG_BLOCK),)
30ifneq ($(CONFIG_EVENT_TRACING),) # need blk_cmd_buf_len
31obj-m += lttng-probe-block.o
32endif
33endif
34
35ifneq ($(CONFIG_NET),)
36obj-m += lttng-probe-napi.o
37obj-m += lttng-probe-skb.o
38obj-m += $(shell \
39 if [ $(VERSION) -ge 3 \
40 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 37 \) ] ; then \
41 echo "lttng-probe-net.o" ; fi;)
42obj-m += $(shell \
43 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
44 echo "lttng-probe-sock.o" ; fi;)
45obj-m += $(shell \
46 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
47 echo "lttng-probe-udp.o" ; fi;)
48endif
49
50ifneq ($(CONFIG_SND_SOC),)
51obj-m += $(shell \
52 if [ $(VERSION) -ge 3 \
53 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
54 echo "lttng-probe-asoc.o" ; fi;)
55endif
56
57ifneq ($(CONFIG_EXT3_FS),)
58ext3_dep = $(srctree)/fs/ext3/*.h
59ext3_dep_check = $(wildcard $(ext3_dep))
60ext3 = $(shell \
61 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
62 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 4 -a \
63 -z "$(ext3_dep_check)" ] ; then \
64 echo "warn" ; \
65 exit ; \
66 fi; \
67 echo "lttng-probe-ext3.o" ; \
68 fi;)
69ifeq ($(ext3),warn)
70$(warning Files $(ext3_dep) not found. Probe "ext3" is disabled. Use full kernel source tree to enable it.)
71ext3 =
72endif
73obj-m += $(ext3)
74endif
75
76ifneq ($(CONFIG_GPIOLIB),)
77obj-m += $(shell \
78 if [ $(VERSION) -ge 3 ] ; then \
79 echo "lttng-probe-gpio.o" ; fi;)
80endif
81
82ifneq ($(CONFIG_JBD2),)
83obj-m += lttng-probe-jbd2.o
84endif
85
86ifneq ($(CONFIG_JBD),)
87obj-m += $(shell \
88 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
89 echo "lttng-probe-jbd.o" ; fi;)
90endif
91
92ifneq ($(CONFIG_REGULATOR),)
93obj-m += $(shell \
94 if [ $(VERSION) -ge 3 \
95 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
96 echo "lttng-probe-regulator.o" ; fi;)
97endif
98
99ifneq ($(CONFIG_SCSI),)
100obj-m += $(shell \
101 if [ $(VERSION) -ge 3 \
102 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 35 \) ] ; then \
103 echo "lttng-probe-scsi.o" ; fi;)
104endif
105
106vmscan = $(shell \
107 if [ $(VERSION) -ge 3 \
108 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
109 echo "lttng-probe-vmscan.o" ; fi;)
110ifneq ($(CONFIG_SWAP),)
111 obj-m += $(vmscan)
112else
113ifneq ($(CONFIG_CGROUP_MEM_RES_CTLR),)
114 obj-m += $(vmscan)
115endif
116endif
117
118# lock probe does not work, so disabling it for now
119#ifneq ($(CONFIG_LOCKDEP),)
120#obj-m += lttng-probe-lock.o
121#endif
122
123ifneq ($(CONFIG_BTRFS_FS),)
124btrfs_dep = $(srctree)/fs/btrfs/*.h
125btrfs = $(shell \
126 if [ $(VERSION) -ge 3 \
127 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 39 \) ] ; then \
128 echo "lttng-probe-btrfs.o" ; fi;)
129ifneq ($(btrfs),)
130ifeq ($(wildcard $(btrfs_dep)),)
131$(warning Files $(btrfs_dep) not found. Probe "btrfs" is disabled. Use full kernel source tree to enable it.)
132btrfs =
133endif
134endif
135obj-m += $(btrfs)
136endif
137
138obj-m += $(shell \
139 if [ $(VERSION) -ge 3 \
140 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
141 echo "lttng-probe-compaction.o" ; fi;)
142
143ifneq ($(CONFIG_EXT4_FS),)
144ext4_dep = $(srctree)/fs/ext4/*.h
145ext4 = lttng-probe-ext4.o
146ifeq ($(wildcard $(ext4_dep)),)
147$(warning Files $(ext4_dep) not found. Probe "ext4" is disabled. Use full kernel source tree to enable it.)
148ext4 =
149endif
150obj-m += $(ext4)
151endif
152
153obj-m += $(shell \
154 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 4 ] ; then \
155 echo "lttng-probe-printk.o" ; fi;)
156ifneq ($(CONFIG_FRAME_WARN),0)
157CFLAGS_lttng-probe-printk.o += -Wframe-larger-than=2200
158endif
159
160obj-m += $(shell \
161 if [ \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 6 \) \
162 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 5 -a $(SUBLEVEL) -ge 2 \) \
163 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 4 -a $(SUBLEVEL) -ge 9 \) \
164 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 0 -a $(SUBLEVEL) -ge 41 \) ] ; then \
165 echo "lttng-probe-random.o" ; fi;)
166
167obj-m += $(shell \
168 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 2 ] ; then \
169 echo "lttng-probe-rcu.o" ; fi;)
170
171ifneq ($(CONFIG_REGMAP),)
172obj-m += $(shell \
173 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 2 ] ; then \
174 echo "lttng-probe-regmap.o" ; fi;)
175endif
176
177ifneq ($(CONFIG_PM_RUNTIME),)
178obj-m += $(shell \
179 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 2 ] ; then \
180 echo "lttng-probe-rpm.o" ; fi;)
181endif
182
183ifneq ($(CONFIG_SUNRPC),)
184obj-m += $(shell \
185 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 4 ] ; then \
186 echo "lttng-probe-sunrpc.o" ; fi;)
187endif
188
189obj-m += lttng-probe-workqueue.o
190
191ifneq ($(CONFIG_KALLSYMS_ALL),)
192obj-m += $(shell \
193 if [ $(VERSION) -ge 3 \
194 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
195 echo "lttng-probe-writeback.o" ; fi;)
196endif
197
198
199ifneq ($(CONFIG_KPROBES),)
200obj-m += lttng-kprobes.o
201endif
202
203
204ifneq ($(CONFIG_KRETPROBES),)
205obj-m += lttng-kretprobes.o
206endif
207
208ifneq ($(CONFIG_DYNAMIC_FTRACE),)
209obj-m += lttng-ftrace.o
210endif
211
212endif
213
214else
215 KERNELDIR ?= /lib/modules/$(shell uname -r)/build
216 PWD := $(shell pwd)
217 CFLAGS = $(EXTCFLAGS)
218
219default:
220 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
221
222modules_install:
223 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
224 /sbin/depmod -a
225
226clean:
227 $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
228
229endif
This page took 0.027174 seconds and 4 git commands to generate.