tracepoint: Allow livepatch module add trace event
authorJianlin Lv <iecedge@gmail.com>
Wed, 2 Nov 2022 16:02:36 +0000 (16:02 +0000)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Sat, 18 Feb 2023 19:34:36 +0000 (14:34 -0500)
In the case of keeping the system running, the preferred method for
tracing the kernel is dynamic tracing (kprobe), but the drawback of
this method is that events are lost, especially when tracing packages
in the network stack.

Livepatching provides a potential solution, which is to reimplement the
function you want to replace and insert a static tracepoint.
In such a way, custom stable static tracepoints can be expanded without
rebooting the system.

Link: https://lkml.kernel.org/r/20221102160236.11696-1-iecedge@gmail.com
Signed-off-by: Jianlin Lv <iecedge@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/tracepoint.c

index f23144af5743048ead3c3c800ce596f4cb050ae9..8d1507dd072469b283463b408254858668e374a7 100644 (file)
@@ -571,8 +571,8 @@ static void for_each_tracepoint_range(
 bool trace_module_has_bad_taint(struct module *mod)
 {
        return mod->taints & ~((1 << TAINT_OOT_MODULE) | (1 << TAINT_CRAP) |
-                              (1 << TAINT_UNSIGNED_MODULE) |
-                              (1 << TAINT_TEST));
+                               (1 << TAINT_UNSIGNED_MODULE) | (1 << TAINT_TEST) |
+                               (1 << TAINT_LIVEPATCH));
 }
 
 static BLOCKING_NOTIFIER_HEAD(tracepoint_notify_list);