2 # Makefile for the LTT probes.
3 # Only build from the package top-level directory. Never use with make directly.
5 ifneq ($(KERNELRELEASE
),)
6 ifneq ($(CONFIG_TRACEPOINTS
),)
8 ccflags-y
+= -I
$(PWD
)/probes
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
19 obj-m
+= lttng-probe-statedump.o
21 ifneq ($(CONFIG_KVM
),)
22 obj-m
+= lttng-probe-kvm.o
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
;)
30 ifneq ($(CONFIG_BLOCK
),)
31 ifneq ($(CONFIG_EVENT_TRACING
),) # need blk_cmd_buf_len
32 obj-m
+= lttng-probe-block.o
36 ifneq ($(CONFIG_NET
),)
37 obj-m
+= lttng-probe-napi.o
38 obj-m
+= lttng-probe-skb.o
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
;)
44 if
[ $(VERSION
) -ge
3 -a
$(PATCHLEVEL
) -ge
1 ] ; then \
45 echo
"lttng-probe-sock.o" ; fi
;)
47 if
[ $(VERSION
) -ge
3 -a
$(PATCHLEVEL
) -ge
1 ] ; then \
48 echo
"lttng-probe-udp.o" ; fi
;)
51 ifneq ($(CONFIG_SND_SOC
),)
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
;)
58 ifneq ($(CONFIG_EXT3_FS
),)
59 ext3_dep
= $(srctree
)/fs
/ext3
/*.h
60 ext3_dep_check
= $(wildcard $(ext3_dep
))
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 \
68 echo
"lttng-probe-ext3.o" ; \
71 $(warning Files
$(ext3_dep
) not found. Probe
"ext3" is disabled. Use full kernel source tree to enable it.
)
77 ifneq ($(CONFIG_GPIOLIB
),)
79 if
[ $(VERSION
) -ge
3 ] ; then \
80 echo
"lttng-probe-gpio.o" ; fi
;)
83 ifneq ($(CONFIG_JBD2
),)
84 obj-m
+= lttng-probe-jbd2.o
87 ifneq ($(CONFIG_JBD
),)
89 if
[ $(VERSION
) -ge
3 -a
$(PATCHLEVEL
) -ge
1 ] ; then \
90 echo
"lttng-probe-jbd.o" ; fi
;)
93 ifneq ($(CONFIG_REGULATOR
),)
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
;)
100 ifneq ($(CONFIG_SCSI
),)
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
;)
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
),)
114 ifneq ($(CONFIG_CGROUP_MEM_RES_CTLR
),)
119 # lock probe does not work, so disabling it for now
120 #ifneq ($(CONFIG_LOCKDEP),)
121 #obj-m += lttng-probe-lock.o
124 ifneq ($(CONFIG_BTRFS_FS
),)
125 btrfs_dep
= $(srctree
)/fs
/btrfs
/*.h
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
;)
131 ifeq ($(wildcard $(btrfs_dep
)),)
132 $(warning Files
$(btrfs_dep
) not found. Probe
"btrfs" is disabled. Use full kernel source tree to enable it.
)
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
;)
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.
)
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
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
;)
169 if
[ $(VERSION
) -ge
3 -a
$(PATCHLEVEL
) -ge
2 ] ; then \
170 echo
"lttng-probe-rcu.o" ; fi
;)
172 ifneq ($(CONFIG_REGMAP
),)
174 if
[ $(VERSION
) -ge
3 -a
$(PATCHLEVEL
) -ge
2 ] ; then \
175 echo
"lttng-probe-regmap.o" ; fi
;)
178 ifneq ($(CONFIG_PM_RUNTIME
),)
180 if
[ $(VERSION
) -ge
3 -a
$(PATCHLEVEL
) -ge
2 ] ; then \
181 echo
"lttng-probe-rpm.o" ; fi
;)
184 ifneq ($(CONFIG_SUNRPC
),)
186 if
[ $(VERSION
) -ge
3 -a
$(PATCHLEVEL
) -ge
4 ] ; then \
187 echo
"lttng-probe-sunrpc.o" ; fi
;)
190 obj-m
+= lttng-probe-workqueue.o
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
;)
198 ifneq ($(CONFIG_KPROBES
),)
199 obj-m
+= lttng-kprobes.o
203 ifneq ($(CONFIG_KRETPROBES
),)
204 obj-m
+= lttng-kretprobes.o
207 ifneq ($(CONFIG_DYNAMIC_FTRACE
),)
208 obj-m
+= lttng-ftrace.o
214 KERNELDIR ?
= /lib
/modules
/$(shell uname
-r
)/build
216 CFLAGS
= $(EXTCFLAGS
)
219 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
) modules
222 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
) modules_install
226 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
) clean