From 6d61b34dfbcb172174d8b95f27462bd192ed2674 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 9 Dec 2010 16:36:18 -0500 Subject: [PATCH] Add basic lttng probes generation from TRACE_EVENT (only build code) Signed-off-by: Mathieu Desnoyers --- Makefile | 2 ++ probes/Makefile | 28 ++++++++++++++++++++++++++++ probes/lttng.h | 2 ++ probes/sched.c | 21 +++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 probes/Makefile create mode 100644 probes/lttng.h create mode 100644 probes/sched.c diff --git a/Makefile b/Makefile index 109b8060..19acdbb6 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ obj-m += ltt-ring-buffer-client-overwrite.o obj-m += ltt-relay.o ltt-relay-objs := ltt-events.o ltt-event-header.o ltt-debugfs-abi.o +obj-m += probes/ + #ltt-type-serializer.o #ltt-serialize.o #obj-m += ltt-marker-control.o diff --git a/probes/Makefile b/probes/Makefile new file mode 100644 index 00000000..31255675 --- /dev/null +++ b/probes/Makefile @@ -0,0 +1,28 @@ +# +# Makefile for the LTT probes. +# + +ifneq ($(KERNELRELEASE),) +ifneq ($(CONFIG_TRACEPOINTS),) + +ccflags-y += -I$(PWD)/probes +obj-m += sched.o + +endif + +else + KERNELDIR ?= /lib/modules/$(shell uname -r)/build + PWD := $(shell pwd) + CFLAGS = $(EXTCFLAGS) + +default: + $(MAKE) -C $(KERNELDIR) M=$(PWD) modules + +modules_install: + $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install + /sbin/depmod -a + +clean: + $(MAKE) -C $(KERNELDIR) M=$(PWD) clean + +endif diff --git a/probes/lttng.h b/probes/lttng.h new file mode 100644 index 00000000..22ebd90d --- /dev/null +++ b/probes/lttng.h @@ -0,0 +1,2 @@ + +#error "blah" diff --git a/probes/sched.c b/probes/sched.c new file mode 100644 index 00000000..98bf5176 --- /dev/null +++ b/probes/sched.c @@ -0,0 +1,21 @@ +/* + * probes/sched.c + * + * Copyright 2010 (c) - Mathieu Desnoyers + * + * LTTng sched probes. + */ + +#include + +/* + * Create LTTng tracepoint probes. + */ +#define LTTNG_PACKAGE_BUILD +#define CREATE_TRACE_POINTS + +#include + +MODULE_LICENSE("GPL and additional rights"); +MODULE_AUTHOR("Mathieu Desnoyers "); +MODULE_DESCRIPTION("LTTng sched probes"); -- 2.34.1