From acd614cc4d30407efd46a528e29dadb403d25ffb Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 20 May 2011 19:17:48 -0400 Subject: [PATCH] Fix !CONFIG_KPROBES config Signed-off-by: Mathieu Desnoyers --- ltt-events.h | 18 +++++++++++++++++- probes/Makefile | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ltt-events.h b/ltt-events.h index e10c66c8..1419fb67 100644 --- a/ltt-events.h +++ b/ltt-events.h @@ -241,12 +241,28 @@ void ltt_event_put(const struct lttng_event_desc *desc); int ltt_probes_init(void); void ltt_probes_exit(void); +#ifdef CONFIG_KPROBES int lttng_kprobes_register(const char *name, const char *symbol_name, uint64_t offset, uint64_t addr, struct ltt_event *event); void lttng_kprobes_unregister(struct ltt_event *event); +#else +static inline +int lttng_kprobes_register(const char *name, + const char *symbol_name, + uint64_t offset, + uint64_t addr, + struct ltt_event *event) +{ + return -ENOSYS; +} + +void lttng_kprobes_unregister(struct ltt_event *event) +{ +} +#endif #ifdef CONFIG_DYNAMIC_FTRACE int lttng_ftrace_register(const char *name, @@ -259,7 +275,7 @@ int lttng_ftrace_register(const char *name, const char *symbol_name, struct ltt_event *event) { - return 0; + return -ENOSYS; } static inline diff --git a/probes/Makefile b/probes/Makefile index 14a7c93b..7129e979 100644 --- a/probes/Makefile +++ b/probes/Makefile @@ -16,7 +16,9 @@ obj-m += lttng-probe-irq.o obj-m += lttng-probe-block.o obj-m += lttng-probe-syscalls.o +ifneq ($(CONFIG_KPROBES),) obj-m += lttng-kprobes.o +endif ifneq ($(CONFIG_DYNAMIC_FTRACE),) obj-m += lttng-ftrace.o -- 2.34.1