Allow building on kernels < 2.6.33 (without perf event support)
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 24 Jun 2011 02:36:45 +0000 (22:36 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 24 Jun 2011 02:36:45 +0000 (22:36 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Makefile
ltt-events.h

index 517d1f7502f49476be05c95c2b78b94d77d59b0c..9a0effcfc483d605a19547f8b488f64296772f10 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,9 @@ ltt-relay-objs :=  ltt-events.o ltt-debugfs-abi.o \
                        lttng-context-vppid.o
 
 ifneq ($(CONFIG_PERF_EVENTS),)
-ltt-relay-objs += lttng-context-perf-counters.o
+ltt-relay-objs += $(shell \
+       if [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 33 ] ; then \
+               echo "lttng-context-perf-counters.o" ; fi;)
 endif
 
 obj-m += probes/
index 4d4eea935aa6ab62c12063d1ab9c593f9d66eae4..10015ad6150cb7404b9bfe39797e3848c969d7a2 100644 (file)
@@ -296,10 +296,21 @@ int lttng_add_tid_to_ctx(struct lttng_ctx **ctx);
 int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx);
 int lttng_add_ppid_to_ctx(struct lttng_ctx **ctx);
 int lttng_add_vppid_to_ctx(struct lttng_ctx **ctx);
+#ifdef CONFIG_PERF_EVENTS
 int lttng_add_perf_counter_to_ctx(uint32_t type,
                                  uint64_t config,
                                  const char *name,
                                  struct lttng_ctx **ctx);
+#else
+static inline
+int lttng_add_perf_counter_to_ctx(uint32_t type,
+                                 uint64_t config,
+                                 const char *name,
+                                 struct lttng_ctx **ctx)
+{
+       return -ENOSYS;
+}
+#endif
 
 #ifdef CONFIG_KPROBES
 int lttng_kprobes_register(const char *name,
This page took 0.026864 seconds and 4 git commands to generate.