From: Mathieu Desnoyers Date: Fri, 23 Oct 2015 21:09:30 +0000 (-0400) Subject: Instrument x86_irq_vectors X-Git-Tag: v2.8.0-rc1~63 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d2507215d183300e9933c68a039f3aa07d5a57a4;p=lttng-modules.git Instrument x86_irq_vectors Signed-off-by: Mathieu Desnoyers --- 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 index 00000000..25b95feb --- /dev/null +++ b/instrumentation/events/lttng-module/arch/x86/irq_vectors.h @@ -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 + +#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" diff --git a/probes/Makefile b/probes/Makefile index 9a2558b3..9fbae81f 100644 --- a/probes/Makefile +++ b/probes/Makefile @@ -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 index 00000000..39c9db22 --- /dev/null +++ b/probes/lttng-probe-x86-irq-vectors.c @@ -0,0 +1,52 @@ +/* + * probes/lttng-probe-x86-irq-vectors.c + * + * LTTng x86 irq vectors probes. + * + * Copyright (C) 2010-2015 Mathieu Desnoyers + * + * 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 +#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 + +#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 "); +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);