From d32a57a2d82d7d0a1d447e7052db9795bb0df2f1 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 20 Dec 2010 01:39:19 -0500 Subject: [PATCH] Add block layer trace event support Signed-off-by: Mathieu Desnoyers --- probes/Makefile | 1 + probes/lttng-events-reset.h | 3 +++ probes/lttng-events.h | 14 ++++++++------ probes/lttng-probe-block.c | 23 +++++++++++++++++++++++ 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 probes/lttng-probe-block.c diff --git a/probes/Makefile b/probes/Makefile index 29e114c8..7bc3a51c 100644 --- a/probes/Makefile +++ b/probes/Makefile @@ -11,6 +11,7 @@ obj-m += lttng-types.o obj-m += lttng-probe-sched.o obj-m += lttng-probe-kvm.o obj-m += lttng-probe-irq.o +obj-m += lttng-probe-block.o endif diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h index 2dac9e61..c272aea9 100644 --- a/probes/lttng-events-reset.h +++ b/probes/lttng-events-reset.h @@ -12,6 +12,9 @@ #undef __dynamic_array #define __dynamic_array(_type, _item, _length) +#undef __dynamic_array +#define __dynamic_array_len(_type, _item, _length) + #undef __string #define __string(_item, _src) diff --git a/probes/lttng-events.h b/probes/lttng-events.h index c5eeac28..c6eb2a68 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -20,6 +20,8 @@ lib_ring_buffer_align_ctx(config, &ctx, sizeof(*(src))); \ lib_ring_buffer_write(config, &ctx, &src, len); +/* TODO: tp_memcpy_dyn */ + /* TODO */ #undef tp_strcpy #define tp_strcpy(dest, src) __assign_str(dest, src); @@ -148,12 +150,12 @@ struct lttng_event_desc { #include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ -#undef DECLARE_EVENT_CLASS -#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ - { \ - .fields = __event_fields___##_name, \ - .name = #_name, \ - .nr_fields = ARRAY_SIZE(__event_fields___##_name), \ +#undef DEFINE_EVENT +#define DEFINE_EVENT(_template, _name, _proto, _args) \ + { \ + .fields = __event_fields___##_template, \ + .name = #_name, \ + .nr_fields = ARRAY_SIZE(__event_fields___##_template), \ }, #define TP_ID1(_token, _system) _token##_system diff --git a/probes/lttng-probe-block.c b/probes/lttng-probe-block.c new file mode 100644 index 00000000..7bd5eaf0 --- /dev/null +++ b/probes/lttng-probe-block.c @@ -0,0 +1,23 @@ +/* + * probes/lttng-probe-block.c + * + * Copyright 2010 (c) - Mathieu Desnoyers + * + * LTTng block probes. + */ + +#include +#include + +/* + * Create LTTng tracepoint probes. + */ +#define LTTNG_PACKAGE_BUILD +#define CREATE_TRACE_POINTS +#undef CONFIG_EVENT_TRACING /* Don't create Ftrace probes */ + +#include + +MODULE_LICENSE("GPL and additional rights"); +MODULE_AUTHOR("Mathieu Desnoyers "); +MODULE_DESCRIPTION("LTTng block probes"); -- 2.34.1