From patchwork Mon Mar 13 21:17:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Zwisler X-Patchwork-Id: 13173346 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBE41C6FD1C for ; Mon, 13 Mar 2023 21:18:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DBC3A6B0075; Mon, 13 Mar 2023 17:18:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D6D7F6B0078; Mon, 13 Mar 2023 17:18:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B49F36B007B; Mon, 13 Mar 2023 17:18:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A28536B0075 for ; Mon, 13 Mar 2023 17:18:22 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7E50D1C5AC9 for ; Mon, 13 Mar 2023 21:18:22 +0000 (UTC) X-FDA: 80565138444.27.3868375 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf14.hostedemail.com (Postfix) with ESMTP id 57E89100012 for ; Mon, 13 Mar 2023 21:18:19 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SALdwbEY; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf14.hostedemail.com: domain of zwisler@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=zwisler@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678742301; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=IOO43sHRl/2M6me+poMZyNICNO2ESqb6aoYHnTQBQW4=; b=Ewx5eU1RT3rVUBFBDcVL1UVN8zxGEPGG/y8eXYQGsLzcAd9wJ6RQDwtorBrmnBEFjtbyvR BQcT0tYHQncq6ia6xKzjARukV/GEN7slnRWhcMx4NorE+VdAAkErOOBoTJQdIvvuFbn0aS OPk7hgY6ykc5J4zqIoYcMjuAEYYfRtg= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SALdwbEY; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf14.hostedemail.com: domain of zwisler@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=zwisler@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678742301; a=rsa-sha256; cv=none; b=siDREjm4db2KiRoIyDdPGzGZwgH79rY9yjeA8orAwKWm3+unvz+JdX3FjFrh8XSwom/9F/ wCqYz1BpZc9eTlH8mzGCFrOIUSsI0YbW5Z232gVDbjWpWVjiLNffcu++d3man2sypfeJqO Uf3lkrYgvj9cwZQ9Bm+9hDh5jmLACzs= 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 sin.source.kernel.org (Postfix) with ESMTPS id 4EF31CE1234; Mon, 13 Mar 2023 21:18:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93956C433EF; Mon, 13 Mar 2023 21:18:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678742295; bh=6mjt9yhry9OZrGSoFR8oPMv/MhGYAYm5/QiZHqwgr3Q=; h=From:To:Cc:Subject:Date:From; b=SALdwbEY67uvSj2NKIONHf4FyVXtnGDxNlObLGFUagGwVN6ayhPWsXf3i4zYs8RFv UH3MjeVdE4evNvqVpwAGOpINbdEBSnoUfb80mWBjePkoqSH7RA3/e6vk5zo5UOSADS y8Kmpr6hzjYvbFcaKD0cx8dwZ9k4BUWJryD0iaVSKQ4YBXRqZDyGiCPFkgrhgSTu4/ IhdPoofNqzzGwVim6/IrdXd/mO/KiEhwfMlYv6Et70EBQ1hcMG+++5wcaUKDwLd0rD vO47Vf0yxE7NdcPT/1qbCcqmsIebO+im14pbhnuNDFtG9SUKQCMLksghODxr9lhtWo 8K7ROvfOyUd0w== From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Tobin C. Harding" , Andrew Morton , Mark Rutland , Masami Hiramatsu , Paolo Bonzini , Shuah Khan , Steven Rostedt , Tycho Andersen , kvm@vger.kernel.org, linux-hardening@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, Mukesh Ojha Subject: [PATCH v4 1/3] selftests: use canonical ftrace path Date: Mon, 13 Mar 2023 15:17:43 -0600 Message-Id: <20230313211746.1541525-1-zwisler@kernel.org> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 57E89100012 X-Stat-Signature: i9fw3r99czqcxygtmuk4y99t31cn69dp X-HE-Tag: 1678742299-62502 X-HE-Meta: U2FsdGVkX1+rtO3mzpaFU1Xoe9+PG+aWAkKlB6wMo1SJG5UlYDqnl6PNJ5Pduk8JHZyswe+JEgBAeherw0F3lg/2XEAZYCRw+9PJF3jAQT3Ujpn2uUfMNNI+F3XDJGj0YkS16xcT8b7TimpfODolVc8qBG8gFHxsOi2Nx6li+we/m5O907YZQ/gT89Zx4TiHF3csr3RF7Weo726xHUMDywCtaWuUUaDg8+PeyoLrEcr5+8RojwPukY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hVZ0vyJH40W9kR/PAYF1jHmkaPiTkdW4Yr0HgJL7fUryB/dW9bCPzpmZzWnn3+L1ZcecTz6VIKhBhSt2wvviNVgzwKGBQ5ThWPFDhqzIz64DLl1remX9CKRM6obmqU1MAhvZFeHlbVg/5NU4SXt7+kgITT+6IRUep+L6ojPwvwpp0uw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 A few spots in tools/testing/selftests still refer to this older debugfs path, so let's update them to avoid confusion. Reviewed-by: Steven Rostedt (Google) Reviewed-by: Mukesh Ojha Signed-off-by: Ross Zwisler --- v3 here: https://lore.kernel.org/all/20230310192050.4096886-1-zwisler@kernel.org/ Changes from v3: * Added Reviwed-by from Steven to patch 2 * Rebased onto the current linux/master tools/testing/selftests/mm/protection_keys.c | 4 ++-- 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 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) base-commit: fc89d7fb499b0162e081f434d45e8d1b47e82ece diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c index 95f403a0c46d..0381c34fdd56 100644 --- a/tools/testing/selftests/mm/protection_keys.c +++ b/tools/testing/selftests/mm/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]; 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 } 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 @@ #include "../kselftest_harness.h" -const char *dyn_file = "/sys/kernel/debug/tracing/dynamic_events"; +const char *dyn_file = "/sys/kernel/tracing/dynamic_events"; const char *clear = "!u:__test_event"; static int Append(const char *value) diff --git a/tools/testing/selftests/user_events/ftrace_test.c b/tools/testing/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 @@ #include "../kselftest_harness.h" -const char *data_file = "/sys/kernel/debug/tracing/user_events_data"; -const char *status_file = "/sys/kernel/debug/tracing/user_events_status"; -const char *enable_file = "/sys/kernel/debug/tracing/events/user_events/__test_event/enable"; -const char *trace_file = "/sys/kernel/debug/tracing/trace"; -const char *fmt_file = "/sys/kernel/debug/tracing/events/user_events/__test_event/format"; +const char *data_file = "/sys/kernel/tracing/user_events_data"; +const char *status_file = "/sys/kernel/tracing/user_events_status"; +const char *enable_file = "/sys/kernel/tracing/events/user_events/__test_event/enable"; +const char *trace_file = "/sys/kernel/tracing/trace"; +const char *fmt_file = "/sys/kernel/tracing/events/user_events/__test_event/format"; static inline int status_check(char *status_page, int status_bit) { diff --git a/tools/testing/selftests/user_events/perf_test.c b/tools/testing/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 @@ #include "../kselftest_harness.h" -const char *data_file = "/sys/kernel/debug/tracing/user_events_data"; -const char *status_file = "/sys/kernel/debug/tracing/user_events_status"; -const char *id_file = "/sys/kernel/debug/tracing/events/user_events/__test_event/id"; -const char *fmt_file = "/sys/kernel/debug/tracing/events/user_events/__test_event/format"; +const char *data_file = "/sys/kernel/tracing/user_events_data"; +const char *status_file = "/sys/kernel/tracing/user_events_status"; +const char *id_file = "/sys/kernel/tracing/events/user_events/__test_event/id"; +const char *fmt_file = "/sys/kernel/tracing/events/user_events/__test_event/format"; struct event { __u32 index;