wrapper: remove tracepoint wrapper
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Apr 2020 16:39:24 +0000 (12:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Apr 2020 16:46:44 +0000 (12:46 -0400)
25 files changed:
lttng-events.c
lttng-statedump-impl.c
lttng-syscalls.c
lttng-tracepoint.c
lttng-tracker-id.c
probes/lttng-probe-block.c
probes/lttng-probe-ext4.c
probes/lttng-probe-irq.c
probes/lttng-probe-jbd2.c
probes/lttng-probe-kmem.c
probes/lttng-probe-kvm-x86-mmu.c
probes/lttng-probe-kvm-x86.c
probes/lttng-probe-kvm.c
probes/lttng-probe-lock.c
probes/lttng-probe-module.c
probes/lttng-probe-napi.c
probes/lttng-probe-power.c
probes/lttng-probe-sched.c
probes/lttng-probe-skb.c
probes/lttng-probe-timer.c
probes/lttng-probe-workqueue.c
probes/lttng-probe-x86-exceptions.c
probes/lttng-probe-x86-irq-vectors.c
tests/probes/lttng-test.c
wrapper/tracepoint.h [deleted file]

index 61439ec7c788efa49b3a4c910fe2d9c0a2cf79d6..c16cff803d94d3ef0b0fec1717a2dcb452682054 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/vmalloc.h>
 
 #include <wrapper/random.h>
-#include <wrapper/tracepoint.h>
 #include <wrapper/list.h>
 #include <wrapper/types.h>
 #include <lttng-kernel-version.h>
@@ -40,6 +39,7 @@
 #include <lttng-abi-old.h>
 #include <lttng-endian.h>
 #include <lttng-string-utils.h>
+#include <lttng-tracepoint.h>
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/ringbuffer/frontend.h>
 
@@ -822,9 +822,9 @@ void register_event(struct lttng_event *event)
        desc = event->desc;
        switch (event->instrumentation) {
        case LTTNG_KERNEL_TRACEPOINT:
-               ret = lttng_wrapper_tracepoint_probe_register(desc->kname,
-                                                 desc->probe_callback,
-                                                 event);
+               ret = lttng_tracepoint_probe_register(desc->kname,
+                                               desc->probe_callback,
+                                               event);
                break;
        case LTTNG_KERNEL_SYSCALL:
                ret = lttng_syscall_filter_enable(event->chan,
@@ -858,7 +858,7 @@ int _lttng_event_unregister(struct lttng_event *event)
        desc = event->desc;
        switch (event->instrumentation) {
        case LTTNG_KERNEL_TRACEPOINT:
-               ret = lttng_wrapper_tracepoint_probe_unregister(event->desc->kname,
+               ret = lttng_tracepoint_probe_unregister(event->desc->kname,
                                                  event->desc->probe_callback,
                                                  event);
                break;
@@ -2937,9 +2937,6 @@ static int __init lttng_events_init(void)
 {
        int ret;
 
-       ret = wrapper_lttng_fixup_sig(THIS_MODULE);
-       if (ret)
-               return ret;
        ret = wrapper_get_pfnblock_flags_mask_init();
        if (ret)
                return ret;
index ebe7655635cee4ec2913fd7bff77fc0d1a790b39..eefc0b8fb2f11525d5c9befad3a7d2ba5f3c0e01 100644 (file)
@@ -38,7 +38,6 @@
 #include <lttng-tracer.h>
 #include <wrapper/namespace.h>
 #include <wrapper/irq.h>
-#include <wrapper/tracepoint.h>
 #include <wrapper/genhd.h>
 #include <wrapper/file.h>
 
@@ -615,13 +614,6 @@ EXPORT_SYMBOL_GPL(lttng_statedump_start);
 static
 int __init lttng_statedump_init(void)
 {
-       /*
-        * Allow module to load even if the fixup cannot be done. This
-        * will allow seemless transition when the underlying issue fix
-        * is merged into the Linux kernel, and when tracepoint.c
-        * "tracepoint_module_notify" is turned into a static function.
-        */
-       (void) wrapper_lttng_fixup_sig(THIS_MODULE);
        return 0;
 }
 
index 3d2025eb35525f9a2f601e7379e7899aaf24179a..e1f1809808573367b701b62cfe9a90d4af8e075c 100644 (file)
 #include <asm/syscall.h>
 
 #include <lib/bitfield.h>
-#include <wrapper/tracepoint.h>
 #include <wrapper/file.h>
 #include <wrapper/rcu.h>
 #include <wrapper/syscall.h>
 #include <lttng-events.h>
+#include "lttng-tracepoint.h"
 
 #ifndef CONFIG_COMPAT
 # ifndef is_compat_task
@@ -883,7 +883,7 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
                return ret;
 #endif
        if (!chan->sys_enter_registered) {
-               ret = lttng_wrapper_tracepoint_probe_register("sys_enter",
+               ret = lttng_tracepoint_probe_register("sys_enter",
                                (void *) syscall_entry_probe, chan);
                if (ret)
                        return ret;
@@ -894,10 +894,10 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
         * conflict with sys_exit syscall entry.
         */
        if (!chan->sys_exit_registered) {
-               ret = lttng_wrapper_tracepoint_probe_register("sys_exit",
+               ret = lttng_tracepoint_probe_register("sys_exit",
                                (void *) syscall_exit_probe, chan);
                if (ret) {
-                       WARN_ON_ONCE(lttng_wrapper_tracepoint_probe_unregister("sys_enter",
+                       WARN_ON_ONCE(lttng_tracepoint_probe_unregister("sys_enter",
                                (void *) syscall_entry_probe, chan));
                        return ret;
                }
@@ -916,14 +916,14 @@ int lttng_syscalls_unregister(struct lttng_channel *chan)
        if (!chan->sc_table)
                return 0;
        if (chan->sys_enter_registered) {
-               ret = lttng_wrapper_tracepoint_probe_unregister("sys_enter",
+               ret = lttng_tracepoint_probe_unregister("sys_enter",
                                (void *) syscall_entry_probe, chan);
                if (ret)
                        return ret;
                chan->sys_enter_registered = 0;
        }
        if (chan->sys_exit_registered) {
-               ret = lttng_wrapper_tracepoint_probe_unregister("sys_exit",
+               ret = lttng_tracepoint_probe_unregister("sys_exit",
                                (void *) syscall_exit_probe, chan);
                if (ret)
                        return ret;
index 42bae9ae0eeb6868b73394226b0cc22b7c10cc2e..a01cbc402e56472685c263440f91fa2b1dda3031 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <lttng-tracepoint.h>
 #include <wrapper/list.h>
-#include <wrapper/tracepoint.h>
 
 /*
  * Protect the tracepoint table. lttng_tracepoint_mutex nests within
@@ -229,7 +228,7 @@ int lttng_tracepoint_coming(struct tp_module *tp_mod)
                struct tracepoint_entry *e;
                struct lttng_tp_probe *p;
 
-               tp = lttng_tracepoint_ptr_deref(&tp_mod->mod->tracepoints_ptrs[i]);
+               tp = tracepoint_ptr_deref(&tp_mod->mod->tracepoints_ptrs[i]);
                e = get_tracepoint(tp->name);
                if (!e) {
                        e = add_tracepoint(tp->name);
@@ -270,7 +269,7 @@ int lttng_tracepoint_going(struct tp_module *tp_mod)
                struct tracepoint_entry *e;
                struct lttng_tp_probe *p;
 
-               tp = lttng_tracepoint_ptr_deref(&tp_mod->mod->tracepoints_ptrs[i]);
+               tp = tracepoint_ptr_deref(&tp_mod->mod->tracepoints_ptrs[i]);
                e = get_tracepoint(tp->name);
                if (!e || !e->tp)
                        continue;
index 2248acd6d49148fa140a6a94e21f8d2e39ffb400..55d8cef1bf15ba12f1d86e6983f573b9a7e203dd 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/hash.h>
 #include <linux/rcupdate.h>
 
-#include <wrapper/tracepoint.h>
 #include <wrapper/rcu.h>
 #include <wrapper/list.h>
 #include <lttng-events.h>
index 1838491b2c1b40673b16f5ab9ed15af0d3b46710..f6e9aa948185b6476c3a775a1f60faebf1874699 100644 (file)
@@ -18,7 +18,7 @@
  */
 #include <trace/events/block.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 7b6f02e467efe9c04f96dea5faf85438b381a8e6..a8f1795bb1ced9d8f1f570cfbf714b91b23556b8 100644 (file)
@@ -23,7 +23,7 @@
 #include <trace/events/ext4.h>
 
 #include <lttng-kernel-version.h>
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 7f95fd61b10ed1f48021e3b12b4cda152b4a33d9..15b029ddc25f2d5a6d639d070d2e6738f68c7269 100644 (file)
@@ -17,7 +17,7 @@
  */
 #include <trace/events/irq.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 4688279af0ff38b4eaf042abe22da6ad37fb2e5a..095043c42d2bbf2de9eaa85cb3e019491e529135 100644 (file)
@@ -17,7 +17,7 @@
  */
 #include <trace/events/jbd2.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 9573018fbbb8a103c10a5e2006e87db9db50dcc7..afd418d939dabcb06a4d1dc2eaac6ff84600053d 100644 (file)
@@ -23,7 +23,7 @@
  */
 #include <trace/events/kmem.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 03e9929f574f8a2295b727b596fb36cf21e2d6a2..d8cc5e5e01c9541258a8aa92c5ea17ddf94b21c5 100644 (file)
@@ -22,7 +22,7 @@
  * Create the tracepoint static inlines from the kernel to validate that our
  * trace event macros match the kernel we run on.
  */
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 #include <../../arch/x86/kvm/mmutrace.h>
 
index a2f3ec693a4a21b640570ac60442c04ad18eaf18..b77040762b59d7eb57f3731054c9db0c070e66c3 100644 (file)
@@ -29,7 +29,7 @@
  */
 #include <trace/events/kvm.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 38603d80a2a056cff68a97db61f19127afc777a7..4c6d04c10e314d81274d812b2bceeb659deb6e19 100644 (file)
@@ -17,7 +17,7 @@
  */
 #include <trace/events/kvm.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 12e0194b6ed7ce0544eaa62db28b2fb84e9711f9..3d0a68d6e1311ec0ca0b9b4ce642912831620911 100644 (file)
@@ -17,7 +17,7 @@
  * trace event macros match the kernel we run on.
  */
 #include <trace/events/lock.h>
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index b422e0e85a2c0aff7426eea51b2827f9705f4e2c..e99ee48250a37351effb8ee64987fec7d806ea7f 100644 (file)
@@ -17,7 +17,7 @@
  */
 #include <trace/events/module.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index c0c208522b9240c25502618a2bf6aa7c14b64e95..c53003bd76074e7134644d815a93bf97e0fbac87 100644 (file)
@@ -17,7 +17,7 @@
  */
 #include <trace/events/napi.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 8d806b814f04798e58807305ebaa797b54f39829..6133e52f819f56c6bc84805fb24934e6e5732035 100644 (file)
@@ -17,7 +17,7 @@
  */
 #include <trace/events/power.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 577cb4088a9d8406d35029a3f7593f00eb362043..495374d8578ec352b2669d92e7475f9504f143f2 100644 (file)
@@ -16,7 +16,7 @@
  */
 #include <trace/events/sched.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index d8d88f268fc44481ede39186ae1ed965ebbb92a8..ec0469ab9a73c028f42b43677a19fca0b2178f24 100644 (file)
@@ -17,7 +17,7 @@
  */
 #include <trace/events/skb.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 60e5a0f2348559a262c6c52c81eb5820af8933fd..ef036a6496f4f8e488ac6bbd6abcbe52c5036213 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/sched.h>
 #include <trace/events/timer.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 6a365300559153611068955377a99b64b17a15cc..66b19f7451e0b5c1d3d11865ceac6110eff95c56 100644 (file)
@@ -21,7 +21,7 @@ struct pool_workqueue;
  */
 #include <trace/events/workqueue.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 /*
  * Create LTTng tracepoint probes.
index 5428798f5205df32aa29c354113037fc417d8fdb..92603b9540d29f28cc7b4991dd4f0ea7ae7f1c97 100644 (file)
@@ -16,7 +16,7 @@
  */
 #include <asm/trace/exceptions.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
index 3c760c1c2bc9905a0f932844d8ee3bad0977a493..a7c8c2a0f65a724c41e892a2bc1049f68ba026d9 100644 (file)
@@ -16,7 +16,7 @@
  */
 #include <asm/trace/irq_vectors.h>
 
-#include <wrapper/tracepoint.h>
+#include "lttng-tracepoint.h"
 
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
index 2219f86d399b8e395fefe126dac02923a9d03445..97677714a6b24360481d9c674d14b4cd7b62491e 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <lttng-events.h>
 #include <lttng-tracer.h>
-#include <wrapper/tracepoint.h>
 
 #define TP_MODULE_NOAUTOLOAD
 #define LTTNG_PACKAGE_BUILD
@@ -96,7 +95,6 @@ int __init lttng_test_init(void)
 {
        int ret = 0;
 
-       (void) wrapper_lttng_fixup_sig(THIS_MODULE);
        lttng_test_filter_event_dentry =
                        proc_create_data(LTTNG_TEST_FILTER_EVENT_FILE,
                                S_IRUGO | S_IWUGO, NULL,
diff --git a/wrapper/tracepoint.h b/wrapper/tracepoint.h
deleted file mode 100644 (file)
index 7b31906..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
- *
- * wrapper/tracepoint.h
- *
- * wrapper around DECLARE_EVENT_CLASS.
- *
- * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_TRACEPOINT_H
-#define _LTTNG_WRAPPER_TRACEPOINT_H
-
-#include <linux/version.h>
-#include <linux/tracepoint.h>
-#include <linux/module.h>
-
-#ifndef HAVE_KABI_2635_TRACEPOINT
-
-#define kabi_2635_tracepoint_probe_register tracepoint_probe_register
-#define kabi_2635_tracepoint_probe_unregister tracepoint_probe_unregister
-
-#endif /* HAVE_KABI_2635_TRACEPOINT */
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
-
-#include <lttng-tracepoint.h>
-
-#define lttng_wrapper_tracepoint_probe_register lttng_tracepoint_probe_register
-#define lttng_wrapper_tracepoint_probe_unregister lttng_tracepoint_probe_unregister
-
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
-
-#define lttng_wrapper_tracepoint_probe_register kabi_2635_tracepoint_probe_register
-#define lttng_wrapper_tracepoint_probe_unregister kabi_2635_tracepoint_probe_unregister
-
-static inline
-int lttng_tracepoint_init(void)
-{
-       return 0;
-}
-
-static inline
-void lttng_tracepoint_exit(void)
-{
-}
-
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG))
-
-#include <linux/kallsyms.h>
-#include <wrapper/kallsyms.h>
-
-static inline
-int wrapper_tracepoint_module_notify(struct notifier_block *nb,
-               unsigned long val, struct module *mod)
-{
-       int (*tracepoint_module_notify_sym)(struct notifier_block *nb,
-                       unsigned long val, struct module *mod);
-
-       tracepoint_module_notify_sym =
-               (void *) kallsyms_lookup_funcptr("tracepoint_module_notify");
-       if (tracepoint_module_notify_sym) {
-               return tracepoint_module_notify_sym(nb, val, mod);
-       } else {
-               printk_once(KERN_WARNING "LTTng: tracepoint_module_notify symbol lookup failed. It probably means you kernel don't need this work-around. Please consider upgrading LTTng modules to make this warning go away.\n");
-               return -ENOSYS;
-       }
-}
-
-#endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG)) */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG) && defined(MODULE))
-
-static inline
-int wrapper_lttng_fixup_sig(struct module *mod)
-{
-       int ret = 0;
-
-       /*
-        * This is for module.c confusing force loaded modules with
-        * unsigned modules.
-        */
-       if (!THIS_MODULE->sig_ok &&
-                       THIS_MODULE->taints & (1U << TAINT_FORCED_MODULE)) {
-               THIS_MODULE->taints &= ~(1U << TAINT_FORCED_MODULE);
-               ret = wrapper_tracepoint_module_notify(NULL,
-                               MODULE_STATE_COMING, mod);
-               THIS_MODULE->taints |= (1U << TAINT_FORCED_MODULE);
-       }
-       return ret;
-}
-
-#else /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG) && defined(MODULE)) */
-
-static inline
-int wrapper_lttng_fixup_sig(struct module *mod)
-{
-       return 0;
-}
-
-#endif /* #else #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG) && defined(MODULE)) */
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
-static inline struct tracepoint *lttng_tracepoint_ptr_deref(tracepoint_ptr_t *p)
-{
-       return tracepoint_ptr_deref(p);
-}
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) */
-static inline struct tracepoint *lttng_tracepoint_ptr_deref(struct tracepoint * const *p)
-{
-       return *p;
-}
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) */
-
-#endif /* _LTTNG_WRAPPER_TRACEPOINT_H */
This page took 0.038732 seconds and 4 git commands to generate.