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