Instrument x86_irq_vectors
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 23 Oct 2015 21:09:30 +0000 (17:09 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 23 Oct 2015 22:25:39 +0000 (18:25 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/arch/x86/irq_vectors.h [new file with mode: 0644]
probes/Makefile
probes/lttng-probe-x86-irq-vectors.c [new file with mode: 0644]

diff --git a/instrumentation/events/lttng-module/arch/x86/irq_vectors.h b/instrumentation/events/lttng-module/arch/x86/irq_vectors.h
new file mode 100644 (file)
index 0000000..25b95fe
--- /dev/null
@@ -0,0 +1,115 @@
+#if !defined(LTTNG_TRACE_IRQ_VECTORS_H) || defined(TRACE_HEADER_MULTI_READ)
+#define LTTNG_TRACE_IRQ_VECTORS_H
+
+#include "../../../../../probes/lttng-tracepoint-event.h"
+#include <linux/version.h>
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM irq_vectors
+
+LTTNG_TRACEPOINT_EVENT_CLASS(x86_irq_vectors_vector_class,
+       TP_PROTO(int vector),
+       TP_ARGS(vector),
+
+       TP_FIELDS(
+               ctf_integer(int, vector, vector)
+       )
+)
+
+#define LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(name, map)      \
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(x86_irq_vectors_vector_class,      \
+       name##_entry,                                                   \
+       map##_entry,                                                    \
+       TP_PROTO(int vector),                                           \
+       TP_ARGS(vector)                                                 \
+)                                                                      \
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(x86_irq_vectors_vector_class,      \
+       name##_exit,                                                    \
+       map##_exit,                                                     \
+       TP_PROTO(int vector),                                           \
+       TP_ARGS(vector)                                                 \
+)
+
+/*
+ * local_timer - called when entering/exiting a local timer interrupt
+ * vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(local_timer,
+               x86_irq_vectors_local_timer)
+
+/*
+ * reschedule - called when entering/exiting a reschedule vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(reschedule,
+               x86_irq_vectors_reschedule)
+
+/*
+ * spurious_apic - called when entering/exiting a spurious apic vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(spurious_apic,
+               x86_irq_vectors_spurious_apic)
+
+/*
+ * error_apic - called when entering/exiting an error apic vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(error_apic,
+               x86_irq_vectors_error_apic)
+
+/*
+ * x86_platform_ipi - called when entering/exiting a x86 platform ipi interrupt
+ * vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(x86_platform_ipi,
+               x86_irq_vectors_ipi)
+
+/*
+ * irq_work - called when entering/exiting a irq work interrupt
+ * vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(irq_work,
+               x86_irq_vectors_irq_work)
+
+/*
+ * call_function - called when entering/exiting a call function interrupt
+ * vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(call_function,
+               x86_irq_vectors_call_function)
+
+/*
+ * call_function_single - called when entering/exiting a call function
+ * single interrupt vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(call_function_single,
+               x86_irq_vectors_call_function_single)
+
+/*
+ * threshold_apic - called when entering/exiting a threshold apic interrupt
+ * vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(threshold_apic,
+               x86_irq_vectors_threshold_apic)
+
+/*
+ * deferred_error_apic - called when entering/exiting a deferred apic interrupt
+ * vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(deferred_error_apic,
+               x86_irq_vectors_deferred_error_apic)
+
+/*
+ * thermal_apic - called when entering/exiting a thermal apic interrupt
+ * vector handler
+ */
+LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(thermal_apic,
+               x86_irq_vectors_thermal_apic)
+
+#endif /* LTTNG_TRACE_IRQ_VECTORS_H */
+
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH ../instrumentation/events/lttng-module/arch/x86
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_FILE irq_vectors
+
+/* This part must be outside protection */
+#include "../../../../../probes/define_trace.h"
index 9a2558b3312dadceb5b56eb362de0b3e7d6bbea1..9fbae81f9b357f17bfe54f7e73546273b2c64c3a 100644 (file)
@@ -48,6 +48,13 @@ endif
 endif
 endif
 
+ifneq ($(CONFIG_X86),)
+x86_irq_vectors_dep = $(srctree)/arch/x86/include/asm/trace/irq_vectors.h
+ifneq ($(wildcard $(x86_irq_vectors_dep)),)
+obj-m += lttng-probe-x86-irq-vectors.o
+endif
+endif
+
 obj-m +=  $(shell \
        if [ $(VERSION) -ge 3 \
                -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 33 \) ] ; then \
diff --git a/probes/lttng-probe-x86-irq-vectors.c b/probes/lttng-probe-x86-irq-vectors.c
new file mode 100644 (file)
index 0000000..39c9db2
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * probes/lttng-probe-x86-irq-vectors.c
+ *
+ * LTTng x86 irq vectors probes.
+ *
+ * Copyright (C) 2010-2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; only
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <linux/module.h>
+#include "../lttng-tracer.h"
+
+/*
+ * Create the tracepoint static inlines from the kernel to validate that our
+ * trace event macros match the kernel we run on.
+ */
+#include <asm/trace/irq_vectors.h>
+
+#include "../wrapper/tracepoint.h"
+
+#undef TRACE_INCLUDE_PATH
+#undef TRACE_INCLUDE_FILE
+
+/*
+ * Create LTTng tracepoint probes.
+ */
+#define LTTNG_PACKAGE_BUILD
+#define CREATE_TRACE_POINTS
+#define TRACE_INCLUDE_PATH ../instrumentation/events/lttng-module/arch/x86
+
+#include "../instrumentation/events/lttng-module/arch/x86/irq_vectors.h"
+
+MODULE_LICENSE("GPL and additional rights");
+MODULE_AUTHOR("Mathieu Desnoyers <mathieu.desnoyers@efficios.com>");
+MODULE_DESCRIPTION("LTTng x86 irq vectors probes");
+MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION) "."
+       __stringify(LTTNG_MODULES_MINOR_VERSION) "."
+       __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION)
+       LTTNG_MODULES_EXTRAVERSION);
This page took 0.028077 seconds and 4 git commands to generate.