I would like to have all source files in one place, so my goal is building lttng-probe-xxx module outside of lttng-modules directory. I've created simple Makefile but durring compilation and next at when I try to loading modules I got message that "lttng_probe_register" and "lttng_probe_unregister" are undefined (the same durring compilation).
Makefile:
INCLUDES = -I. -I$(LTTNGDIR)/probes -I$(ROOTPWD)/include -I$(KERNELDIR)/include
KBUILD_CFLAGS += -g $(INCLUDES)
all: kernel_modules
obj-m += lttng-probe-hello.o
PWD := $(shell pwd)
kernel_modules:
$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) modules`
KERNELDIR is exported variable where is src of Linux kernel.
LTTNGDIR is exported variable where is src of lttng-modules.
Is it possible to link these two from lttng-probes.c to my lttng-probe-hello.ko?
EXPORT_SYMBOL_GPL(lttng_probe_register);
EXPORT_SYMBOL_GPL(lttng_probe_unregister);