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
35 \
) ] ; then \
28 echo
"lttng-probe-signal.o" ; fi
;)
30 ifneq ($(CONFIG_BLOCK
),)
31 ifneq ($(CONFIG_EVENT_TRACING
),) # need blk_cmd_buf_len
33 if
[ $(VERSION
) -ge
3 \
34 -o \
( $(VERSION
) -eq
2 -a
$(PATCHLEVEL
) -ge
6 -a
$(SUBLEVEL
) -ge
38 \
) ] ; then \
35 echo
"lttng-probe-block.o" ; fi
;)
39 ifneq ($(CONFIG_NET
),)
40 obj-m
+= lttng-probe-net.o
41 obj-m
+= lttng-probe-napi.o
42 obj-m
+= lttng-probe-skb.o
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
),)
60 if
[ $(VERSION
) -ge
3 -a
$(PATCHLEVEL
) -ge
1 ] ; then \
61 echo
"lttng-probe-ext3.o" ; fi
;)
64 ifneq ($(CONFIG_GPIOLIB
),)
66 if
[ $(VERSION
) -ge
3 ] ; then \
67 echo
"lttng-probe-gpio.o" ; fi
;)
70 ifneq ($(CONFIG_JBD2
),)
71 obj-m
+= lttng-probe-jbd2.o
74 ifneq ($(CONFIG_JBD
),)
76 if
[ $(VERSION
) -ge
3 -a
$(PATCHLEVEL
) -ge
1 ] ; then \
77 echo
"lttng-probe-jbd.o" ; fi
;)
80 ifneq ($(CONFIG_REGULATOR
),)
82 if
[ $(VERSION
) -ge
3 \
83 -o \
( $(VERSION
) -eq
2 -a
$(PATCHLEVEL
) -ge
6 -a
$(SUBLEVEL
) -ge
38 \
) ] ; then \
84 echo
"lttng-probe-regulator.o" ; fi
;)
87 ifneq ($(CONFIG_SCSI
),)
89 if
[ $(VERSION
) -ge
3 ] ; then \
90 echo
"lttng-probe-scsi.o" ; fi
;)
94 if
[ $(VERSION
) -ge
3 ] ; then \
95 echo
"lttng-probe-vmscan.o" ; fi
;)
96 ifneq ($(CONFIG_SWAP
),)
99 ifneq ($(CONFIG_CGROUP_MEM_RES_CTLR
),)
104 ifneq ($(CONFIG_LOCKDEP
),)
105 obj-m
+= lttng-probe-lock.o
108 ifneq ($(CONFIG_KPROBES
),)
109 obj-m
+= lttng-kprobes.o
113 ifneq ($(CONFIG_KRETPROBES
),)
114 obj-m
+= lttng-kretprobes.o
117 ifneq ($(CONFIG_DYNAMIC_FTRACE
),)
118 obj-m
+= lttng-ftrace.o
124 KERNELDIR ?
= /lib
/modules
/$(shell uname
-r
)/build
126 CFLAGS
= $(EXTCFLAGS
)
129 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
) modules
132 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
) modules_install
136 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
) clean