1 /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
3 * probes/lttng-probe-kvm.c
7 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 #include <linux/module.h>
11 #include <linux/kvm_host.h>
12 #include <lttng-tracer.h>
13 #include <lttng-kernel-version.h>
15 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0))
16 #include <kvm_emulate.h>
19 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0))
20 #include <kvm/iodev.h>
21 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) */
22 #include <../../virt/kvm/iodev.h>
23 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) */
26 * Create the tracepoint static inlines from the kernel to validate that our
27 * trace event macros match the kernel we run on.
29 #include <trace/events/kvm.h>
31 #include <wrapper/tracepoint.h>
34 * Create LTTng tracepoint probes.
36 #define LTTNG_PACKAGE_BUILD
37 #define CREATE_TRACE_POINTS
39 #define TRACE_INCLUDE_PATH instrumentation/events/lttng-module/arch/x86/kvm
40 #include <instrumentation/events/lttng-module/arch/x86/kvm/trace.h>
42 MODULE_LICENSE("GPL and additional rights");
43 MODULE_AUTHOR("Mathieu Desnoyers <mathieu.desnoyers@efficios.com>");
44 MODULE_DESCRIPTION("LTTng kvm probes");
45 MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION
) "."
46 __stringify(LTTNG_MODULES_MINOR_VERSION
) "."
47 __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION
)
48 LTTNG_MODULES_EXTRAVERSION
);