From patchwork Fri Feb 17 18:39:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 58745 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp7658wrn; Fri, 17 Feb 2023 10:42:06 -0800 (PST) X-Google-Smtp-Source: AK7set/Z6tz34LN+rFKPGnONMMtSAxvzyIQ4/IVFHKbX+u/RsMGjpCNY2vwTeg5yzVuAVQg5X5wA X-Received: by 2002:a17:907:c085:b0:8b1:ce91:a413 with SMTP id st5-20020a170907c08500b008b1ce91a413mr3764033ejc.24.1676659326322; Fri, 17 Feb 2023 10:42:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676659326; cv=none; d=google.com; s=arc-20160816; b=XQL8UkqiZmISQU4b6MVnTQwkqmLXxscNox4HCfh5GG7kPEqrFOrpLmR79apJed62/g lNgeS6TRZX9RIzpZWdm6UJoefoWtWmNCnLAGj+c06Hdh56cXvA4HCUUKiEQbYyNkN/ru Y6q48iVZUdk6qGQX1nMTwtj9j3RYyfF8x3TR4IG8GGBHidl8w7IICSudWrCLit8DiAwl hX3ocW7gnPBJtQVBdj+9R/upkQgFVJmhlYMzIBQLSnlqBANDQZSJCZPpX+pMAzHNbG0e ek94qWPn5hRj41I5T1Qbnn14q8kJr5I0yFw1K7xRAJ6N/qUVn86zbvzuHPhhV0pZuviM T3AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=fTzq3N93ERvNPK9ONLQB64kkCk2+tsjfVY89Iy42E9E=; b=Wc9oFzNVC8Rn0cuHEQhEvEFt7PBXYQcNu/dYvvxVVfG0RK9Ak5WKOh8ciVplMGx/z4 C2/7s6Kty9ZqQi20Pv/d2wRqDnRN7lfKwigoXPNJgJv2Bwh7axPgZ4wPCWiI7S8uuig2 iqMsvgpNJAlKSwh0dzkBeiCw+KiqSwhXTbA4T19EI/v2i1TecdRGO2EQPR1bf38AV6qi BH5EnxNFITbkOWR1a9Cpyf+d8kXPV8KKqYwyORUgCu+fiu/jHg1Pz/+oTmociKj84xHx 2yes/zYNKnEr1HIdAzES385klPweIeR/8Ba6SKkpDok4a5KqI9Y86vI4ksjmFoVb1Vag XTyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o2-20020aa7d3c2000000b004acc29f65absi5869877edr.452.2023.02.17.10.41.43; Fri, 17 Feb 2023 10:42:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbjBQSju (ORCPT + 99 others); Fri, 17 Feb 2023 13:39:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbjBQSjo (ORCPT ); Fri, 17 Feb 2023 13:39:44 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6BA21498D for ; Fri, 17 Feb 2023 10:39:41 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5A179B82D56 for ; Fri, 17 Feb 2023 18:39:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE4FFC433EF; Fri, 17 Feb 2023 18:39:38 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1pT5dx-000sn6-2A; Fri, 17 Feb 2023 13:39:37 -0500 Message-ID: <20230217183937.487119824@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 17 Feb 2023 13:39:12 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Andrew Morton , Ross Zwisler Subject: [for-next][PATCH 1/3] tracing: Always use canonical ftrace path References: <20230217183911.775065402@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758104729646121773?= X-GMAIL-MSGID: =?utf-8?q?1758104729646121773?= From: Ross Zwisler The canonical location for the tracefs filesystem is at /sys/kernel/tracing. But, from Documentation/trace/ftrace.rst: Before 4.1, all ftrace tracing control files were within the debugfs file system, which is typically located at /sys/kernel/debug/tracing. For backward compatibility, when mounting the debugfs file system, the tracefs file system will be automatically mounted at: /sys/kernel/debug/tracing Many comments and Kconfig help messages in the tracing code still refer to this older debugfs path, so let's update them to avoid confusion. Link: https://lore.kernel.org/linux-trace-kernel/20230215223350.2658616-2-zwisler@google.com Signed-off-by: Ross Zwisler Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- include/linux/kernel.h | 2 +- include/linux/tracepoint.h | 4 ++-- kernel/trace/Kconfig | 20 ++++++++++---------- kernel/trace/kprobe_event_gen_test.c | 2 +- kernel/trace/ring_buffer.c | 2 +- kernel/trace/synth_event_gen_test.c | 2 +- kernel/trace/trace.c | 2 +- samples/user_events/example.c | 4 ++-- scripts/tracing/draw_functrace.py | 6 +++--- tools/lib/api/fs/tracing_path.c | 4 ++-- tools/tracing/latency/latency-collector.c | 2 +- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index fe6efb24d151..40bce7495af8 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -297,7 +297,7 @@ bool mac_pton(const char *s, u8 *mac); * * Use tracing_on/tracing_off when you want to quickly turn on or off * tracing. It simply enables or disables the recording of the trace events. - * This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on + * This also corresponds to the user space /sys/kernel/tracing/tracing_on * file, which gives a means for the kernel and userspace to interact. * Place a tracing_off() in the kernel where you want tracing to end. * From user space, examine the trace, and then echo 1 > tracing_on diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 4b33b95eb8be..fa1004fcf810 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -471,7 +471,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) * * This is how the trace record is structured and will * * be saved into the ring buffer. These are the fields * * that will be exposed to user-space in - * * /sys/kernel/debug/tracing/events/<*>/format. + * * /sys/kernel/tracing/events/<*>/format. * * * * The declared 'local variable' is called '__entry' * * @@ -531,7 +531,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) * tracepoint callback (this is used by programmatic plugins and * can also by used by generic instrumentation like SystemTap), and * it is also used to expose a structured trace record in - * /sys/kernel/debug/tracing/events/. + * /sys/kernel/tracing/events/. * * A set of (un)registration functions can be passed to the variant * TRACE_EVENT_FN to perform any (un)registration work. diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index d7043043f59c..5f5e64f9e715 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -239,7 +239,7 @@ config DYNAMIC_FTRACE enabled, and the functions not enabled will not affect performance of the system. - See the files in /sys/kernel/debug/tracing: + See the files in /sys/kernel/tracing: available_filter_functions set_ftrace_filter set_ftrace_notrace @@ -299,7 +299,7 @@ config STACK_TRACER select KALLSYMS help This special tracer records the maximum stack footprint of the - kernel and displays it in /sys/kernel/debug/tracing/stack_trace. + kernel and displays it in /sys/kernel/tracing/stack_trace. This tracer works by hooking into every function call that the kernel executes, and keeping a maximum stack depth value and @@ -339,7 +339,7 @@ config IRQSOFF_TRACER disabled by default and can be runtime (re-)started via: - echo 0 > /sys/kernel/debug/tracing/tracing_max_latency + echo 0 > /sys/kernel/tracing/tracing_max_latency (Note that kernel size and overhead increase with this option enabled. This option and the preempt-off timing option can be @@ -363,7 +363,7 @@ config PREEMPT_TRACER disabled by default and can be runtime (re-)started via: - echo 0 > /sys/kernel/debug/tracing/tracing_max_latency + echo 0 > /sys/kernel/tracing/tracing_max_latency (Note that kernel size and overhead increase with this option enabled. This option and the irqs-off timing option can be @@ -515,7 +515,7 @@ config TRACER_SNAPSHOT Allow tracing users to take snapshot of the current buffer using the ftrace interface, e.g.: - echo 1 > /sys/kernel/debug/tracing/snapshot + echo 1 > /sys/kernel/tracing/snapshot cat snapshot config TRACER_SNAPSHOT_PER_CPU_SWAP @@ -527,7 +527,7 @@ config TRACER_SNAPSHOT_PER_CPU_SWAP full swap (all buffers). If this is set, then the following is allowed: - echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot + echo 1 > /sys/kernel/tracing/per_cpu/cpu2/snapshot After which, only the tracing buffer for CPU 2 was swapped with the main tracing buffer, and the other CPU buffers remain the same. @@ -574,7 +574,7 @@ config PROFILE_ANNOTATED_BRANCHES This tracer profiles all likely and unlikely macros in the kernel. It will display the results in: - /sys/kernel/debug/tracing/trace_stat/branch_annotated + /sys/kernel/tracing/trace_stat/branch_annotated Note: this will add a significant overhead; only turn this on if you need to profile the system's use of these macros. @@ -587,7 +587,7 @@ config PROFILE_ALL_BRANCHES taken in the kernel is recorded whether it hit or miss. The results will be displayed in: - /sys/kernel/debug/tracing/trace_stat/branch_all + /sys/kernel/tracing/trace_stat/branch_all This option also enables the likely/unlikely profiler. @@ -638,8 +638,8 @@ config BLK_DEV_IO_TRACE Tracing also is possible using the ftrace interface, e.g.: echo 1 > /sys/block/sda/sda1/trace/enable - echo blk > /sys/kernel/debug/tracing/current_tracer - cat /sys/kernel/debug/tracing/trace_pipe + echo blk > /sys/kernel/tracing/current_tracer + cat /sys/kernel/tracing/trace_pipe If unsure, say N. diff --git a/kernel/trace/kprobe_event_gen_test.c b/kernel/trace/kprobe_event_gen_test.c index c736487fc0e4..4850fdfe27f1 100644 --- a/kernel/trace/kprobe_event_gen_test.c +++ b/kernel/trace/kprobe_event_gen_test.c @@ -21,7 +21,7 @@ * Then: * * # insmod kernel/trace/kprobe_event_gen_test.ko - * # cat /sys/kernel/debug/tracing/trace + * # cat /sys/kernel/tracing/trace * * You should see many instances of the "gen_kprobe_test" and * "gen_kretprobe_test" events in the trace buffer. diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 45d4a23d6044..071184324d18 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -2886,7 +2886,7 @@ rb_check_timestamp(struct ring_buffer_per_cpu *cpu_buffer, sched_clock_stable() ? "" : "If you just came from a suspend/resume,\n" "please switch to the trace global clock:\n" - " echo global > /sys/kernel/debug/tracing/trace_clock\n" + " echo global > /sys/kernel/tracing/trace_clock\n" "or add trace_clock=global to the kernel command line\n"); } diff --git a/kernel/trace/synth_event_gen_test.c b/kernel/trace/synth_event_gen_test.c index 8d77526892f4..8dfe85499d4a 100644 --- a/kernel/trace/synth_event_gen_test.c +++ b/kernel/trace/synth_event_gen_test.c @@ -22,7 +22,7 @@ * Then: * * # insmod kernel/trace/synth_event_gen_test.ko - * # cat /sys/kernel/debug/tracing/trace + * # cat /sys/kernel/tracing/trace * * You should see several events in the trace buffer - * "create_synth_test", "empty_synth_test", and several instances of diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 97c88711f270..fbb602a8b64b 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1187,7 +1187,7 @@ void tracing_snapshot_instance(struct trace_array *tr) * * Note, make sure to allocate the snapshot with either * a tracing_snapshot_alloc(), or by doing it manually - * with: echo 1 > /sys/kernel/debug/tracing/snapshot + * with: echo 1 > /sys/kernel/tracing/snapshot * * If the snapshot buffer is not allocated, it will stop tracing. * Basically making a permanent snapshot. diff --git a/samples/user_events/example.c b/samples/user_events/example.c index d06dc24156ec..18e34c9d708e 100644 --- a/samples/user_events/example.c +++ b/samples/user_events/example.c @@ -23,8 +23,8 @@ #endif /* Assumes debugfs is mounted */ -const char *data_file = "/sys/kernel/debug/tracing/user_events_data"; -const char *status_file = "/sys/kernel/debug/tracing/user_events_status"; +const char *data_file = "/sys/kernel/tracing/user_events_data"; +const char *status_file = "/sys/kernel/tracing/user_events_status"; static int event_status(long **status) { diff --git a/scripts/tracing/draw_functrace.py b/scripts/tracing/draw_functrace.py index 438516bdfb3c..42fa87300941 100755 --- a/scripts/tracing/draw_functrace.py +++ b/scripts/tracing/draw_functrace.py @@ -12,9 +12,9 @@ calls. Only the functions's names and the call time are provided. Usage: Be sure that you have CONFIG_FUNCTION_TRACER - # mount -t debugfs nodev /sys/kernel/debug - # echo function > /sys/kernel/debug/tracing/current_tracer - $ cat /sys/kernel/debug/tracing/trace_pipe > ~/raw_trace_func + # mount -t tracefs nodev /sys/kernel/tracing + # echo function > /sys/kernel/tracing/current_tracer + $ cat /sys/kernel/tracing/trace_pipe > ~/raw_trace_func Wait some times but not too much, the script is a bit slow. Break the pipe (Ctrl + Z) $ scripts/tracing/draw_functrace.py < ~/raw_trace_func > draw_functrace diff --git a/tools/lib/api/fs/tracing_path.c b/tools/lib/api/fs/tracing_path.c index b8e457c841ab..7ba3e81274e8 100644 --- a/tools/lib/api/fs/tracing_path.c +++ b/tools/lib/api/fs/tracing_path.c @@ -14,8 +14,8 @@ #include "tracing_path.h" static char tracing_mnt[PATH_MAX] = "/sys/kernel/debug"; -static char tracing_path[PATH_MAX] = "/sys/kernel/debug/tracing"; -static char tracing_events_path[PATH_MAX] = "/sys/kernel/debug/tracing/events"; +static char tracing_path[PATH_MAX] = "/sys/kernel/tracing"; +static char tracing_events_path[PATH_MAX] = "/sys/kernel/tracing/events"; static void __tracing_path_set(const char *tracing, const char *mountpoint) { diff --git a/tools/tracing/latency/latency-collector.c b/tools/tracing/latency/latency-collector.c index 59a7f2346eab..0fd9c747d396 100644 --- a/tools/tracing/latency/latency-collector.c +++ b/tools/tracing/latency/latency-collector.c @@ -1584,7 +1584,7 @@ static void *do_printloop(void *arg) /* * Toss a coin to decide if we want to sleep before printing * out the backtrace. The reason for this is that opening - * /sys/kernel/debug/tracing/trace will cause a blackout of + * /sys/kernel/tracing/trace will cause a blackout of * hundreds of ms, where no latencies will be noted by the * latency tracer. Thus by randomly sleeping we try to avoid * missing traces systematically due to this. With this option From patchwork Fri Feb 17 18:39:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 58744 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp7145wrn; Fri, 17 Feb 2023 10:40:50 -0800 (PST) X-Google-Smtp-Source: AK7set+/iwUzcklmG9d03GqcTQ40XpPqEQ4FKV673ervuh6sD58hCVG1MwiDgr3yjE+tpTczxxjc X-Received: by 2002:a17:906:328a:b0:8b1:293a:ef21 with SMTP id 10-20020a170906328a00b008b1293aef21mr9468749ejw.64.1676659250624; Fri, 17 Feb 2023 10:40:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676659250; cv=none; d=google.com; s=arc-20160816; b=OXRAwF0aMcnl9JBF0vHeK5s1mv83vFhKR03Yeg0MUv/T+nI2nGovpdi5nOAVFce2gM pz1Fv0nK8gNOwAwgtyD3I3ERNtuisBplSIlrl+OTS65CTxfzPM8vfM0VkOtU36DmDgol ShDv8Kv6zVLT8Jyait0zjGgGWLTV3BYue9Q1l0eZDfFFnyCxCVt0tAYSDZ/s5jcqgvDu 4AymKZaz4jBKKKXfaPpXmC06fz+DWndWxcelM0b7XFhEDAdxNGooCwWLTVsLX0QvlUHE FS7XGSxsOiuSSoyNTsb1sHGyKVGmvzXTTP8xY2PtluQK4muNehkn/tc7zHOWm9VS3934 g2XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=0hZIGbKnE+cjjQHI8ZcgCZrqok38xdyPnn+BwDJ55Uw=; b=kInanI5yXMbpdCjiGMaIvoLb5+r0/Pr/TmiyJvQ5ARzHinTsj2ts5wFRh4cMMdRElt kBDtP+spsWq1cyAqWCqwfbuKzp33nBPOdtmqT96fLHQG9upFLl31v9s5I+VP2Iu+BvQD a1e+PV+mPdrK2tTjMz9JuWfyFI7O5UUJhEAg+nRBI2o2CXXS1isI5XTmRtbbDnocoMnQ MBuCGS9Nl5UJbFggQ3iqx9adl33Y4LkJvTOQKKmSYzDbO154ReJaVhBk5ZTlh9FcNKPm ujVIfx8ZBaITUizWyJAF1/9M2DfP6z3Tb1ounPU5ozZPe9xcvF8ck3g4ZfWynQSJeikK PS3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fu19-20020a170907b01300b008b147d7b4bbsi4801789ejc.581.2023.02.17.10.40.27; Fri, 17 Feb 2023 10:40:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229603AbjBQSjq (ORCPT + 99 others); Fri, 17 Feb 2023 13:39:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbjBQSjn (ORCPT ); Fri, 17 Feb 2023 13:39:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B391A5C0 for ; Fri, 17 Feb 2023 10:39:41 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4B7C0B82D54 for ; Fri, 17 Feb 2023 18:39:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E09FBC4339C; Fri, 17 Feb 2023 18:39:38 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1pT5dx-000snf-2q; Fri, 17 Feb 2023 13:39:37 -0500 Message-ID: <20230217183937.692994896@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 17 Feb 2023 13:39:13 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Andrew Morton , Jianlin Lv Subject: [for-next][PATCH 2/3] tracepoint: Allow livepatch module add trace event References: <20230217183911.775065402@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758104650150779064?= X-GMAIL-MSGID: =?utf-8?q?1758104650150779064?= From: Jianlin Lv 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 Signed-off-by: Steven Rostedt (Google) --- kernel/tracepoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index f23144af5743..8d1507dd0724 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c @@ -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); From patchwork Fri Feb 17 18:39:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 58743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp7029wrn; Fri, 17 Feb 2023 10:40:32 -0800 (PST) X-Google-Smtp-Source: AK7set8R5p8RfEhvOKWvBoCxMfEM7TzMMVK2DcTF/aH/59VhF4p2Hq3U9D89bVXan4GLRTP5ypWZ X-Received: by 2002:a17:906:474c:b0:889:7781:f62e with SMTP id j12-20020a170906474c00b008897781f62emr9498756ejs.22.1676659231981; Fri, 17 Feb 2023 10:40:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676659231; cv=none; d=google.com; s=arc-20160816; b=hNC1Z84M0JzmrBOZ9UeBrmUDwugcRxl6h5cFWgICQUpE7hCVF3Oezz6cWpDa3RD0QN oR9uPFGQIQCfGl5qbB8w0oc/ke7UKW3jZ6Wm7Nfa6/n9hM/mcjV9uXTAhLL4OMYm4y2d dO+H5rE2Xbed2FYHESIY9h5MeBkqwqQAsR+qfhIsPHaCsqUo7xYFae8RYbvW1tR/9IlL Ny0AR7dL6AWOMsMVK7Q6LleEoOacweKWVzxFTkEapbKYsFIFqYTagmBXcmIBuCQmfFv5 e868BXOvU0guYwXUNDKH+LYi4Ml9aQ+S63rWOzaih35/90AV3F20/ndpmwK+/0tBr5kf rWJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=6LvtKpagoLU6lboqQrMrY4xWNPx82J9C0hAHJVIJnZc=; b=Zyw4UNVtlDmuCzdmnLRUtU3nHjmsVA7rCyF5RiHzShG4Cc40eU2dM4M8aCQFYzQ80m L8G7F5t/3vdDd6OT+DmsftMDzWP4ceOzzdIWHfX4xKVga7dxyFRKYg8D9nL0HZkRuUu6 45ydFdFvguNHEx+OjQlsB4ah1jNpxkfcRiszoxQkoCh6lZb9D06xm9wVcnZ8FIkTKFFm e9Im5P9l5tag3H2B08Y6C1R0eaEi6jvad5x07cupnrsrp1SvfP/N/ncXu38geckB5Jwa WBh80w8dO6VrwVRe2iDYZGfe147snRCaYcPcnEf2KD4xVcpMjNBhcAYN6tu2aaq72oCp 369g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qn19-20020a170907871300b008b130840d29si5417406ejc.1008.2023.02.17.10.40.07; Fri, 17 Feb 2023 10:40:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229508AbjBQSjm (ORCPT + 99 others); Fri, 17 Feb 2023 13:39:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjBQSjl (ORCPT ); Fri, 17 Feb 2023 13:39:41 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54DC73C2F for ; Fri, 17 Feb 2023 10:39:40 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B89C561F22 for ; Fri, 17 Feb 2023 18:39:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23C40C433A0; Fri, 17 Feb 2023 18:39:39 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1pT5dy-000soD-0H; Fri, 17 Feb 2023 13:39:38 -0500 Message-ID: <20230217183937.902030316@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 17 Feb 2023 13:39:14 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Andrew Morton , Wang ShaoBo Subject: [for-next][PATCH 3/3] tracing: Remove unnecessary NULL assignment References: <20230217183911.775065402@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758104630899468809?= X-GMAIL-MSGID: =?utf-8?q?1758104630899468809?= From: Wang ShaoBo Remove unnecessary NULL assignment int create_new_subsystem(). Link: https://lkml.kernel.org/r/20221123065124.3982439-1-bobo.shaobowang@huawei.com Signed-off-by: Wang ShaoBo Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index cf3fd74fa675..b52c4d79eb78 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2261,8 +2261,6 @@ create_new_subsystem(const char *name) if (!system->name) goto out_free; - system->filter = NULL; - system->filter = kzalloc(sizeof(struct event_filter), GFP_KERNEL); if (!system->filter) goto out_free;