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