From nobody Thu Sep 11 21:07:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02087C636D4 for ; Wed, 15 Feb 2023 22:34:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229962AbjBOWeQ (ORCPT ); Wed, 15 Feb 2023 17:34:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbjBOWeD (ORCPT ); Wed, 15 Feb 2023 17:34:03 -0500 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F185F37556 for ; Wed, 15 Feb 2023 14:33:59 -0800 (PST) Received: by mail-il1-x12c.google.com with SMTP id c6so111554iln.3 for ; Wed, 15 Feb 2023 14:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KRiIylVtHLM7M15bsUbIunpslIeQnzNkiL62MB+UIyE=; b=XDrTWczdWtWaoFMsyxlLVwbPoQdmxEcpRJz8GQEWwI4ccFUfl2v4C8mxYu1m5tIV9N TG+TcjrZLqOfuvf95ggXwSj8/yudyG0CglTYncr55dcrtosjtDHyzohqf0vR7Yg97M1O jOsVnHpSdwpT5fJhRgPlu2bPmANuNnJKXUEjc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KRiIylVtHLM7M15bsUbIunpslIeQnzNkiL62MB+UIyE=; b=rD9EpUEoX0Wfqd8W2ou4Q7rofUohCj47rgLngX70vQpjbbKicAP1Kj+VFGVOqlQ6d3 Y4J+xhGxcW3KffRXdZEHed7CcYEYA4D60jpQ0TgCADRPoM86T5wVuqGLsIzpn5rdPe7T 9zday8T4dlKnXwIQqLv3IjMMoz1w1ifmRMUk0S4mZpu3gamgfaH9BF5W6uzl5+hDeHR7 KVvioWAMd3pr/NQGHj9KeiBWRCGL2nuKq9GuKKyDcTLy5CxVo0CBc+zOKKfKEt1CBpBl W1FYbkSWLzevjs88tmBwBuopkp+k641+xHvDWboXmfUP6cv+G3NfaMG1ZSOmtyDSCris xLNg== X-Gm-Message-State: AO0yUKW+nFDBiwv7qbNA/XN06FLU35tdQLGl0MTUD4iGwPw/z7b/WgnG 822Py77VRuG4XSJZj0K9E3/TcrYUZMxH5Rrc X-Google-Smtp-Source: AK7set+st368XsFs7KuhNnjJJxjSkTp+ehPsvZjpomFKZjaSs7keJycjfj1LQ7Z2YQJHHx4GupN8Hw== X-Received: by 2002:a05:6e02:1605:b0:315:2b7d:d2d8 with SMTP id t5-20020a056e02160500b003152b7dd2d8mr4248678ilu.4.1676500438753; Wed, 15 Feb 2023 14:33:58 -0800 (PST) Received: from ravnica.bld.corp.google.com ([2620:15c:183:200:6299:179b:a6e4:be59]) by smtp.gmail.com with ESMTPSA id b15-20020a92c14f000000b003141eddd283sm1131489ilh.22.2023.02.15.14.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 14:33:58 -0800 (PST) From: Ross Zwisler X-Google-Original-From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , Steven Rostedt , Masami Hiramatsu , linux-trace-kernel@vger.kernel.org Subject: [PATCH v2 1/6] tracing: always use canonical ftrace path Date: Wed, 15 Feb 2023 15:33:45 -0700 Message-Id: <20230215223350.2658616-2-zwisler@google.com> X-Mailer: git-send-email 2.39.1.637.g21b0678d19-goog In-Reply-To: <20230215223350.2658616-1-zwisler@google.com> References: <20230215223350.2658616-1-zwisler@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Ross Zwisler Acked-by: Masami Hiramatsu (Google) Acked-by: Michael S. Tsirkin Reviewed-by: Mukesh Ojha Reviewed-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 event= s. - * This also corresponds to the user space /sys/kernel/debug/tracing/traci= ng_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(t= racepoint_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(t= racepoint_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. =20 - 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. =20 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: =20 - echo 0 > /sys/kernel/debug/tracing/tracing_max_latency + echo 0 > /sys/kernel/tracing/tracing_max_latency =20 (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: =20 - echo 0 > /sys/kernel/debug/tracing/tracing_max_latency + echo 0 > /sys/kernel/tracing/tracing_max_latency =20 (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.: =20 - echo 1 > /sys/kernel/debug/tracing/snapshot + echo 1 > /sys/kernel/tracing/snapshot cat snapshot =20 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: =20 - echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot + echo 1 > /sys/kernel/tracing/per_cpu/cpu2/snapshot =20 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: =20 - /sys/kernel/debug/tracing/trace_stat/branch_annotated + /sys/kernel/tracing/trace_stat/branch_annotated =20 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: =20 - /sys/kernel/debug/tracing/trace_stat/branch_all + /sys/kernel/tracing/trace_stat/branch_all =20 This option also enables the likely/unlikely profiler. =20 @@ -638,8 +638,8 @@ config BLK_DEV_IO_TRACE Tracing also is possible using the ftrace interface, e.g.: =20 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 =20 If unsure, say N. =20 diff --git a/kernel/trace/kprobe_event_gen_test.c b/kernel/trace/kprobe_eve= nt_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 c366a0a9ddba..4cdb2feccff3 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_bu= ffer, 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=3Dglobal to the kernel command line\n"); } =20 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 c9e40f692650..1101220052b3 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1142,7 +1142,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 =20 /* Assumes debugfs is mounted */ -const char *data_file =3D "/sys/kernel/debug/tracing/user_events_data"; -const char *status_file =3D "/sys/kernel/debug/tracing/user_events_status"; +const char *data_file =3D "/sys/kernel/tracing/user_events_data"; +const char *status_file =3D "/sys/kernel/tracing/user_events_status"; =20 static int event_status(long **status) { diff --git a/scripts/tracing/draw_functrace.py b/scripts/tracing/draw_funct= race.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 p= rovided. =20 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_pat= h.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" =20 static char tracing_mnt[PATH_MAX] =3D "/sys/kernel/debug"; -static char tracing_path[PATH_MAX] =3D "/sys/kernel/debug/tracing"; -static char tracing_events_path[PATH_MAX] =3D "/sys/kernel/debug/tracing/e= vents"; +static char tracing_path[PATH_MAX] =3D "/sys/kernel/tracing"; +static char tracing_events_path[PATH_MAX] =3D "/sys/kernel/tracing/events"; =20 static void __tracing_path_set(const char *tracing, const char *mountpoint) { diff --git a/tools/tracing/latency/latency-collector.c b/tools/tracing/late= ncy/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 --=20 2.39.1.637.g21b0678d19-goog From nobody Thu Sep 11 21:07:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90597C6379F for ; Wed, 15 Feb 2023 22:34:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbjBOWeG (ORCPT ); Wed, 15 Feb 2023 17:34:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbjBOWeB (ORCPT ); Wed, 15 Feb 2023 17:34:01 -0500 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CBF92E826 for ; Wed, 15 Feb 2023 14:34:00 -0800 (PST) Received: by mail-il1-x12c.google.com with SMTP id u8so152722ilq.13 for ; Wed, 15 Feb 2023 14:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lP7i4Vg5vCi45+1jZsWESpRSmXH35ZniV9m1/+tW+Hk=; b=nkZL9fJ4DuIlF/CtEtVuUWG1NHpyIExHBSMUpvG++W5Ao+0jTazceFPQ+qafDgTzZN P+qX432q5PjnU01ridwbkLLkiU0rTtSZdXZEQd/FetfZiE1KzwwCeQCqOizI8U6m/CdR qCDN90d6J3zjeKTJ5KEfh+qukVjCgjja+cIZM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lP7i4Vg5vCi45+1jZsWESpRSmXH35ZniV9m1/+tW+Hk=; b=09LQ4je8v3nt3la7ns+XHK7WOhqI0zvvHd71MHF3MHsMYdcJTAV4KWrPXpI4tZiqsH W+xEWCO781DmEuyhzTIOvPud5R2XhhwdZsGoXUcwtgegjzR1VZZUssqRtUZ3Li3OXSuD X4zfz6qKgimGXt1m7oOIYZXLTySHk3PerEVxo4TDUmH5gBmWtVBzAMWP9TTTqPUhhKga zUkVdgX2EDe0Dayew2NjGT3zcMndCDqX+AkaC9GPUHv6bUJV8S0kckWYIuetDk9i0a75 oBJp4z+UUzM9p3lnTHS56GsfSG50LAHnd0WLGa0hzReqaXYn5yJPep4mal8IeB+rHDmZ ftIg== X-Gm-Message-State: AO0yUKWfwqYq2NJeUlbiucj5jV3R851d44NkSpj9pf8mQOp/qnHJ0M5n BvL+RGcprx+9K29W/u0XJCi5Di9uZnQ1PR/c X-Google-Smtp-Source: AK7set/iT57WkSxfAxsAOUoPZU2et6o/KodiZpe6LUgEgddn6Z+TYNMWbr3f09Z6/v0pnuZZ8Xenpg== X-Received: by 2002:a05:6e02:1d91:b0:315:7004:3e6c with SMTP id h17-20020a056e021d9100b0031570043e6cmr3354878ila.23.1676500439322; Wed, 15 Feb 2023 14:33:59 -0800 (PST) Received: from ravnica.bld.corp.google.com ([2620:15c:183:200:6299:179b:a6e4:be59]) by smtp.gmail.com with ESMTPSA id b15-20020a92c14f000000b003141eddd283sm1131489ilh.22.2023.02.15.14.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 14:33:59 -0800 (PST) From: Ross Zwisler X-Google-Original-From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , Shuah Khan , Andrew Morton , linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, Steven Rostedt Subject: [PATCH v2 2/6] selftests: use canonical ftrace path Date: Wed, 15 Feb 2023 15:33:46 -0700 Message-Id: <20230215223350.2658616-3-zwisler@google.com> X-Mailer: git-send-email 2.39.1.637.g21b0678d19-goog In-Reply-To: <20230215223350.2658616-1-zwisler@google.com> References: <20230215223350.2658616-1-zwisler@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 A few spots in tools/testing/selftests still refer to this older debugfs path, so let's update them to avoid confusion. Signed-off-by: Ross Zwisler Acked-by: Michael S. Tsirkin Reviewed-by: Mukesh Ojha Reviewed-by: Steven Rostedt (Google) --- tools/testing/selftests/user_events/dyn_test.c | 2 +- tools/testing/selftests/user_events/ftrace_test.c | 10 +++++----- tools/testing/selftests/user_events/perf_test.c | 8 ++++---- tools/testing/selftests/vm/protection_keys.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/user_events/dyn_test.c b/tools/testing= /selftests/user_events/dyn_test.c index d6265d14cd51..8879a7b04c6a 100644 --- a/tools/testing/selftests/user_events/dyn_test.c +++ b/tools/testing/selftests/user_events/dyn_test.c @@ -16,7 +16,7 @@ =20 #include "../kselftest_harness.h" =20 -const char *dyn_file =3D "/sys/kernel/debug/tracing/dynamic_events"; +const char *dyn_file =3D "/sys/kernel/tracing/dynamic_events"; const char *clear =3D "!u:__test_event"; =20 static int Append(const char *value) diff --git a/tools/testing/selftests/user_events/ftrace_test.c b/tools/test= ing/selftests/user_events/ftrace_test.c index 404a2713dcae..a0b2c96eb252 100644 --- a/tools/testing/selftests/user_events/ftrace_test.c +++ b/tools/testing/selftests/user_events/ftrace_test.c @@ -16,11 +16,11 @@ =20 #include "../kselftest_harness.h" =20 -const char *data_file =3D "/sys/kernel/debug/tracing/user_events_data"; -const char *status_file =3D "/sys/kernel/debug/tracing/user_events_status"; -const char *enable_file =3D "/sys/kernel/debug/tracing/events/user_events/= __test_event/enable"; -const char *trace_file =3D "/sys/kernel/debug/tracing/trace"; -const char *fmt_file =3D "/sys/kernel/debug/tracing/events/user_events/__t= est_event/format"; +const char *data_file =3D "/sys/kernel/tracing/user_events_data"; +const char *status_file =3D "/sys/kernel/tracing/user_events_status"; +const char *enable_file =3D "/sys/kernel/tracing/events/user_events/__test= _event/enable"; +const char *trace_file =3D "/sys/kernel/tracing/trace"; +const char *fmt_file =3D "/sys/kernel/tracing/events/user_events/__test_ev= ent/format"; =20 static inline int status_check(char *status_page, int status_bit) { diff --git a/tools/testing/selftests/user_events/perf_test.c b/tools/testin= g/selftests/user_events/perf_test.c index 8b4c7879d5a7..31505642aa9b 100644 --- a/tools/testing/selftests/user_events/perf_test.c +++ b/tools/testing/selftests/user_events/perf_test.c @@ -18,10 +18,10 @@ =20 #include "../kselftest_harness.h" =20 -const char *data_file =3D "/sys/kernel/debug/tracing/user_events_data"; -const char *status_file =3D "/sys/kernel/debug/tracing/user_events_status"; -const char *id_file =3D "/sys/kernel/debug/tracing/events/user_events/__te= st_event/id"; -const char *fmt_file =3D "/sys/kernel/debug/tracing/events/user_events/__t= est_event/format"; +const char *data_file =3D "/sys/kernel/tracing/user_events_data"; +const char *status_file =3D "/sys/kernel/tracing/user_events_status"; +const char *id_file =3D "/sys/kernel/tracing/events/user_events/__test_eve= nt/id"; +const char *fmt_file =3D "/sys/kernel/tracing/events/user_events/__test_ev= ent/format"; =20 struct event { __u32 index; diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/s= elftests/vm/protection_keys.c index 95f403a0c46d..0381c34fdd56 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -98,7 +98,7 @@ int tracing_root_ok(void) void tracing_on(void) { #if CONTROL_TRACING > 0 -#define TRACEDIR "/sys/kernel/debug/tracing" +#define TRACEDIR "/sys/kernel/tracing" char pidstr[32]; =20 if (!tracing_root_ok()) @@ -124,7 +124,7 @@ void tracing_off(void) #if CONTROL_TRACING > 0 if (!tracing_root_ok()) return; - cat_into_file("0", "/sys/kernel/debug/tracing/tracing_on"); + cat_into_file("0", "/sys/kernel/tracing/tracing_on"); #endif } =20 --=20 2.39.1.637.g21b0678d19-goog From nobody Thu Sep 11 21:07:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96FF6C636D4 for ; Wed, 15 Feb 2023 22:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229988AbjBOWeY (ORCPT ); Wed, 15 Feb 2023 17:34:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbjBOWeD (ORCPT ); Wed, 15 Feb 2023 17:34:03 -0500 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C79B030295 for ; Wed, 15 Feb 2023 14:34:00 -0800 (PST) Received: by mail-il1-x132.google.com with SMTP id b9so197748ila.0 for ; Wed, 15 Feb 2023 14:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=glq2V86DV/XIT2xAdhHc3LZ7W3YqMn+eHqv8u2YnMs8=; b=jafmjIUSQwdQGTkpdGWZZjLCzunKS2ryf5YEJI/DkWCeRLKgq8RyQv+/2tSq6zDttr rNoW4TRxgKUpe54vqM9AmNg/j0o3A4bx6wyEwYY3ExHKfOb2x3hOjUSA1EotT0Ja27nr XbLB7Oz5APUOQyujdvvGe/cLKSqUWM0d9BXho= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=glq2V86DV/XIT2xAdhHc3LZ7W3YqMn+eHqv8u2YnMs8=; b=Kn32FdGg1xphPCLpSI0oQw9BaZIoxfgHkOAEVPWgekSl0TNagTPG4XC6K84MbZ7q3l AVwd4YW4gTGFF3hqcuSaTyypquQcvUYEu35eWDVx6ZtyS1BuyLXmbNrBZ3SIeKG3Wa2H lVQUj0tU2/fP/bhTKyMaHXaBkrdSlGkBBNmQ6vac3yFXCHcCK7J3W07/wEut2hieUgqU rowhssCOscGWBGM9lms2Qf6nmye2rJ4xNTQHWBtIwG+wCn/PZL1NiohJPTHKutwgkRdO zQkU1PdObBA0rBkvBF6NhyPzKphSYuBkXuL2+W/ji1YQNIhuz10dAwoQtgojADt8Bg8W sVKg== X-Gm-Message-State: AO0yUKW0orjjUe079YdBZL9mfb6IzBQ5UzrutTYkVtJTGjtnmb0Bj7ie wY6YnrYxeZhN9bICKFYj3OngoY+xfeod3CII X-Google-Smtp-Source: AK7set9qLvATTMAF3X5InVYtcDXlTGsbfdkd029j3+Afaa3eJzjf8D8MQHpdxM9eNj5oz98WH5ot0A== X-Received: by 2002:a05:6e02:1b08:b0:314:1aec:c7a9 with SMTP id i8-20020a056e021b0800b003141aecc7a9mr3730923ilv.23.1676500440035; Wed, 15 Feb 2023 14:34:00 -0800 (PST) Received: from ravnica.bld.corp.google.com ([2620:15c:183:200:6299:179b:a6e4:be59]) by smtp.gmail.com with ESMTPSA id b15-20020a92c14f000000b003141eddd283sm1131489ilh.22.2023.02.15.14.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 14:33:59 -0800 (PST) From: Ross Zwisler X-Google-Original-From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Tobin C. Harding" , Tycho Andersen , linux-hardening@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Steven Rostedt Subject: [PATCH v2 3/6] leaking_addresses: also skip canonical ftrace path Date: Wed, 15 Feb 2023 15:33:47 -0700 Message-Id: <20230215223350.2658616-4-zwisler@google.com> X-Mailer: git-send-email 2.39.1.637.g21b0678d19-goog In-Reply-To: <20230215223350.2658616-1-zwisler@google.com> References: <20230215223350.2658616-1-zwisler@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 scripts/leaking_addresses.pl only skipped this older debugfs path, so let's add the canonical path as well. Signed-off-by: Ross Zwisler Acked-by: Tycho Andersen Acked-by: Michael S. Tsirkin Reviewed-by: Steven Rostedt (Google) --- scripts/leaking_addresses.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index 8f636a23bc3f..e695634d153d 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl @@ -61,6 +61,7 @@ my @skip_abs =3D ( '/proc/device-tree', '/proc/1/syscall', '/sys/firmware/devicetree', + '/sys/kernel/tracing/trace_pipe', '/sys/kernel/debug/tracing/trace_pipe', '/sys/kernel/security/apparmor/revision'); =20 --=20 2.39.1.637.g21b0678d19-goog From nobody Thu Sep 11 21:07:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B82E8C636CC for ; Wed, 15 Feb 2023 22:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229913AbjBOWeU (ORCPT ); Wed, 15 Feb 2023 17:34:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbjBOWeD (ORCPT ); Wed, 15 Feb 2023 17:34:03 -0500 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D06B3A851 for ; Wed, 15 Feb 2023 14:34:01 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id d16so2120ioz.12 for ; Wed, 15 Feb 2023 14:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mnWb0/c3SYq7VOjFth5MeHXAYmHB31VnBFWZUTQPvpw=; b=kC+gHfVdbRJlKuA2eO3yNTVt7DH6c/TA0/kfK1ldKXFTz8jF7IfNK0GsqoCDlFaey+ Ot5LcebAIg2SwBu3bz6JxTwqg50CJu1GANhWz5aFxR+pABZYHwDTNFIl1ylVCSJBriro ftvYlS/DyAxzJSjMvhjrfJadtr3Xe/GVoDQlg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mnWb0/c3SYq7VOjFth5MeHXAYmHB31VnBFWZUTQPvpw=; b=GBpoTZT5GpfKauIwe8jb36YVg+FkahpMDv1L5Sj+rZew9UCkPq2a/uwt8c7Qql6pNq Fhapj2C398Klhz59kGaNhtp9Ely5eHmQW8gTwUVRH5PAF+aKl8ear2HtevaEtBeUm7bw jh9mEzS91ZfTKbE9xCzY5NeBH9vDpzD0LTDsnDna3as/YqzvkATcdGsjmL9FTf7EHmgb uqP1AzK6/v1RxhiDxsT2i9BKOqdmso85nih1tLNZQgJzE/xHl5kV+8FV84p3WMdtOLUr pQoawUvz4odW2FsuAQDYHvB+wdKyJ5CXFvlVJ0Hovoo/sgaQ1sJ48ud7xJCg/uL7OJIm l4Xw== X-Gm-Message-State: AO0yUKVxbOGBRXskP+y5PG/YHouzBYPJBhAZlpYSkIl2/7nEoOs/ZL8d anErj3uaZKl3x84qKqOTf00jG/wmK2ot2PIP X-Google-Smtp-Source: AK7set+LWFNoW1FRruwyMQqPtFjjrfVj8AiheRpZcLSgqEnBWe2webNydnur3ykK3IxtsLkMcuwgOQ== X-Received: by 2002:a6b:7118:0:b0:734:2621:58e2 with SMTP id q24-20020a6b7118000000b00734262158e2mr3155532iog.20.1676500440593; Wed, 15 Feb 2023 14:34:00 -0800 (PST) Received: from ravnica.bld.corp.google.com ([2620:15c:183:200:6299:179b:a6e4:be59]) by smtp.gmail.com with ESMTPSA id b15-20020a92c14f000000b003141eddd283sm1131489ilh.22.2023.02.15.14.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 14:34:00 -0800 (PST) From: Ross Zwisler X-Google-Original-From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , Paolo Bonzini , kvm@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Steven Rostedt Subject: [PATCH v2 4/6] tools/kvm_stat: use canonical ftrace path Date: Wed, 15 Feb 2023 15:33:48 -0700 Message-Id: <20230215223350.2658616-5-zwisler@google.com> X-Mailer: git-send-email 2.39.1.637.g21b0678d19-goog In-Reply-To: <20230215223350.2658616-1-zwisler@google.com> References: <20230215223350.2658616-1-zwisler@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 A comment in kvm_stat still refers to this older debugfs path, so let's update it to avoid confusion. Signed-off-by: Ross Zwisler Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Reviewed-by: Mukesh Ojha Reviewed-by: Steven Rostedt (Google) --- tools/kvm/kvm_stat/kvm_stat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat index 6f28180ffeea..15bf00e79e3f 100755 --- a/tools/kvm/kvm_stat/kvm_stat +++ b/tools/kvm/kvm_stat/kvm_stat @@ -627,7 +627,7 @@ class TracepointProvider(Provider): name)'. =20 All available events have directories under - /sys/kernel/debug/tracing/events/ which export information + /sys/kernel/tracing/events/ which export information about the specific event. Therefore, listing the dirs gives us a list of all available events. =20 --=20 2.39.1.637.g21b0678d19-goog From nobody Thu Sep 11 21:07:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4003DC636D4 for ; Wed, 15 Feb 2023 22:34:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjBOWe2 (ORCPT ); Wed, 15 Feb 2023 17:34:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbjBOWeD (ORCPT ); Wed, 15 Feb 2023 17:34:03 -0500 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E16893433C for ; Wed, 15 Feb 2023 14:34:01 -0800 (PST) Received: by mail-il1-x12b.google.com with SMTP id l7so153815ilj.12 for ; Wed, 15 Feb 2023 14:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h+WvHGj+U9hKhpX1MO7CbT0bAOa+eFHb7XRSNPNylZ8=; b=nQZZwoOAYpjgtW8gOVskWl1KV7dhHa7P+KU0NTAeSzYeCbd4NkPHKC92/aJKS1V+Am RCLr9IRTt50cDY8azwnYsOUdGAAuCop3Q5tJoOPqlpZN38n8FaI9/CsX5tWF7rbkVew9 faXxQZYh9z2g6xsVrP7Vr51SLummS4/+kG4pA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h+WvHGj+U9hKhpX1MO7CbT0bAOa+eFHb7XRSNPNylZ8=; b=Gmy9xhx5cpuJBaQQnOT25IYgh/7LwTdNNf0Ris0Dhv0hRO1Amn37ecXAdOwnluN5my uvuAklgjP1ui9KD74N0lfdBwL7Yn88O5gjFEhBHd65t8xG0FoeZcSCCUWM7N9Kt6T7gV OW5MtACNPO+/ai6T4wpPh/GS5rsw/yQMyoZGGDQDEtpdwRp1Tx/ilvWOWbwfJFBWDagL GCaqfLSjjtJhOdYBkVy0q8RwfOZQ9VH/eomEjYXv99r2/gZUSOxi59EmzcGP1fKatm5F I0MjgMQoqPia5wPuQdda6q4Fs689geQN8SUJSDMDrqbQrrg1mcyD1PIVecZuDi0Ztb2U jocw== X-Gm-Message-State: AO0yUKWSiEuL/V8wRzZN5wxst0gMOPhxjOfbqirCa4bHBwzJEHb/mIda FTzaDsqTkehsvooUmLT2zHy4PYQnL5RKCFB+ X-Google-Smtp-Source: AK7set+EMfXkBaB31iKQyYe/+Wg5XHQlwKLorA+RovqRpO3jD7TgVAfAJEZ+djN0XoHF3I5aIbY59w== X-Received: by 2002:a05:6e02:214c:b0:310:f912:5a68 with SMTP id d12-20020a056e02214c00b00310f9125a68mr121487ilv.3.1676500441191; Wed, 15 Feb 2023 14:34:01 -0800 (PST) Received: from ravnica.bld.corp.google.com ([2620:15c:183:200:6299:179b:a6e4:be59]) by smtp.gmail.com with ESMTPSA id b15-20020a92c14f000000b003141eddd283sm1131489ilh.22.2023.02.15.14.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 14:34:00 -0800 (PST) From: Ross Zwisler X-Google-Original-From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Michael S. Tsirkin" , Jason Wang , virtualization@lists.linux-foundation.org, linux-trace-kernel@vger.kernel.org, Steven Rostedt Subject: [PATCH v2 5/6] tools/virtio: use canonical ftrace path Date: Wed, 15 Feb 2023 15:33:49 -0700 Message-Id: <20230215223350.2658616-6-zwisler@google.com> X-Mailer: git-send-email 2.39.1.637.g21b0678d19-goog In-Reply-To: <20230215223350.2658616-1-zwisler@google.com> References: <20230215223350.2658616-1-zwisler@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 A few spots in tools/virtio still refer to this older debugfs path, so let's update them to avoid confusion. Signed-off-by: Ross Zwisler Acked-by: Michael S. Tsirkin Reviewed-by: Mukesh Ojha Reviewed-by: Steven Rostedt (Google) --- tools/virtio/virtio-trace/README | 2 +- tools/virtio/virtio-trace/trace-agent.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/virtio/virtio-trace/README b/tools/virtio/virtio-trace/R= EADME index b64845b823ab..cea29a2a4c0a 100644 --- a/tools/virtio/virtio-trace/README +++ b/tools/virtio/virtio-trace/README @@ -95,7 +95,7 @@ Run =20 1) Enable ftrace in the guest - # echo 1 > /sys/kernel/debug/tracing/events/sched/enable + # echo 1 > /sys/kernel/tracing/events/sched/enable =20 2) Run trace agent in the guest This agent must be operated as root. diff --git a/tools/virtio/virtio-trace/trace-agent.c b/tools/virtio/virtio-= trace/trace-agent.c index cdfe77c2b4c8..7e2d9bbf0b84 100644 --- a/tools/virtio/virtio-trace/trace-agent.c +++ b/tools/virtio/virtio-trace/trace-agent.c @@ -18,8 +18,9 @@ #define PIPE_DEF_BUFS 16 #define PIPE_MIN_SIZE (PAGE_SIZE*PIPE_DEF_BUFS) #define PIPE_MAX_SIZE (1024*1024) -#define READ_PATH_FMT \ - "/sys/kernel/debug/tracing/per_cpu/cpu%d/trace_pipe_raw" +#define TRACEFS "/sys/kernel/tracing" +#define DEBUGFS "/sys/kernel/debug/tracing" +#define READ_PATH_FMT "%s/per_cpu/cpu%d/trace_pipe_raw" #define WRITE_PATH_FMT "/dev/virtio-ports/trace-path-cpu%d" #define CTL_PATH "/dev/virtio-ports/agent-ctl-path" =20 @@ -120,9 +121,12 @@ static const char *make_path(int cpu_num, bool this_is= _write_path) if (this_is_write_path) /* write(output) path */ ret =3D snprintf(buf, PATH_MAX, WRITE_PATH_FMT, cpu_num); - else + else { /* read(input) path */ - ret =3D snprintf(buf, PATH_MAX, READ_PATH_FMT, cpu_num); + ret =3D snprintf(buf, PATH_MAX, READ_PATH_FMT, TRACEFS, cpu_num); + if (ret > 0 && access(buf, F_OK) !=3D 0) + ret =3D snprintf(buf, PATH_MAX, READ_PATH_FMT, DEBUGFS, cpu_num); + } =20 if (ret <=3D 0) { pr_err("Failed to generate %s path(CPU#%d):%d\n", --=20 2.39.1.637.g21b0678d19-goog From nobody Thu Sep 11 21:07:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C24D6C636CC for ; Wed, 15 Feb 2023 22:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230020AbjBOWea (ORCPT ); Wed, 15 Feb 2023 17:34:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbjBOWeD (ORCPT ); Wed, 15 Feb 2023 17:34:03 -0500 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8556C43935 for ; Wed, 15 Feb 2023 14:34:02 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id j4so8573iog.8 for ; Wed, 15 Feb 2023 14:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9UkAnigxc8vfiP/xy4xUkyYLWp1v2oMPjYmrZI7ozKg=; b=fNhSR/DpdhPdDoI56A3EhCdY7JWbS58+aiEICYVlA7gl+AWkUTNbIG/atjNRcl+sje lyIqK6JaonmY3oxhEbmQPSEmpM0sQJdCA79+tz5MYxEs4BBI4xZSHObsXn9o/f+ekcvK +jiV7lGBfGkDEmPwMzlaSo6sNkVwuy9caydNo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9UkAnigxc8vfiP/xy4xUkyYLWp1v2oMPjYmrZI7ozKg=; b=VHVHVPY9KdaKW5r5rcxOc/DJ2nKyjnEpe+FKURkbqRm9d3UPdpAo57iuZC/jsB9sr6 8P8ruTxl15+xcPT7YuVyJwZJkd1V0VRKLLdg9PPwMwdd3PHM0VeUNQv8BkxDBenJnZnW dtEd/gdaGD6FIY/1VTAFrRqc2BkEsgiRlBMSIGGuXEWDLsh9EUOnETblkeGG6tYVKCYc SJ84abZVOMKOe7Hbnw8cycg2ZvaE/ITESEJ47FWMiufhraAW3mXugLRGbVH15vjN1lkv 1ilXOubkyICW1HNXtnznkQey9fCwA1PemvdwtaeClLmbFVAXIkUjRYpTq9J+MSJ8QTTq ukUw== X-Gm-Message-State: AO0yUKXn3WGylQ7iRvqzR74bl6mzDft3gW6gtfCV0C/3qPXEei4DE9lo GytEtKTDCRLHQqGSOPaFvjWJ4nMsJOU0sEc1 X-Google-Smtp-Source: AK7set/e91kNoaIzB6xxvRfuTyHdyHPXybCM8qCEGiQAIuXpdlJLh2rV23A7rHMn8ApT6OzRpPB0MQ== X-Received: by 2002:a5d:890d:0:b0:71c:cf2e:92ec with SMTP id b13-20020a5d890d000000b0071ccf2e92ecmr3047559ion.0.1676500441795; Wed, 15 Feb 2023 14:34:01 -0800 (PST) Received: from ravnica.bld.corp.google.com ([2620:15c:183:200:6299:179b:a6e4:be59]) by smtp.gmail.com with ESMTPSA id b15-20020a92c14f000000b003141eddd283sm1131489ilh.22.2023.02.15.14.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 14:34:01 -0800 (PST) From: Ross Zwisler X-Google-Original-From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Michael S. Tsirkin" , Jason Wang , virtualization@lists.linux-foundation.org, linux-trace-kernel@vger.kernel.org, Steven Rostedt Subject: [PATCH v2 6/6] tools/virtio: fix typo in README instructions Date: Wed, 15 Feb 2023 15:33:50 -0700 Message-Id: <20230215223350.2658616-7-zwisler@google.com> X-Mailer: git-send-email 2.39.1.637.g21b0678d19-goog In-Reply-To: <20230215223350.2658616-1-zwisler@google.com> References: <20230215223350.2658616-1-zwisler@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" We need to have a unique chardev for each data path, else the chardevs will collide and qemu will die with this message: qemu-system-x86_64: -device virtserialport,bus=3Dvirtio-serial0.0,nr=3D2,chardev=3Dcharchannel0, id=3Dchannel1,name=3Dtrace-path-cpu0: Property 'virtserialport.chardev' can't take value 'charchannel0': Device 'charchannel0' is in use Signed-off-by: Ross Zwisler Acked-by: Michael S. Tsirkin Reviewed-by: Steven Rostedt (Google) --- tools/virtio/virtio-trace/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtio/virtio-trace/README b/tools/virtio/virtio-trace/R= EADME index cea29a2a4c0a..0127ff0c54b0 100644 --- a/tools/virtio/virtio-trace/README +++ b/tools/virtio/virtio-trace/README @@ -61,7 +61,7 @@ and id=3Dchannel0,name=3Dagent-ctl-path\ ##data path## -chardev pipe,id=3Dcharchannel1,path=3D/tmp/virtio-trace/trace-path-c= pu0\ - -device virtserialport,bus=3Dvirtio-serial0.0,nr=3D2,chardev=3Dcharch= annel0,\ + -device virtserialport,bus=3Dvirtio-serial0.0,nr=3D2,chardev=3Dcharch= annel1,\ id=3Dchannel1,name=3Dtrace-path-cpu0\ ... =20 --=20 2.39.1.637.g21b0678d19-goog