Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3104311lqo; Tue, 14 May 2024 22:36:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVH24FQgvcRjklrHJG4Uyr9OXJoGo6sSPZy4qTAGKU+nrGl6tszHZdCJHnJmHz+ZvvWuMVBvdC7c01GX3WYM8YvQQIwcctjyFLBEBi/Kg== X-Google-Smtp-Source: AGHT+IE3L8jzRjIfeNwbvyCyp/mSCmHRplWpJLfO4ETU3vjRLtthZxyDGjT9s49B701LnyYpIXRz X-Received: by 2002:a05:620a:2591:b0:792:b938:7769 with SMTP id af79cd13be357-792c75787d3mr2073474585a.11.1715751391553; Tue, 14 May 2024 22:36:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715751391; cv=pass; d=google.com; s=arc-20160816; b=sjSeVxCrNZF8fFtT92SP2ZyDbp5xOLlQNzzPknJRMQyWa2HPbR6h2LVhCEnToYX9re Q6G9DTRek8uOL2DJ3MbXLLrGpUNaYAbGZe7cjnqMdRP4DXIc83Oan9nIGUtn7iOGgDzz MgATTtxZWW54un0p3ppGDCE2mI25zYGL6V6fOu45bIf4yte1qfM25yNSBFGCWDaBnJoZ IqR9R2AkQOA+6xfu4E1yGt9pPjt1IFPDl5HB3kSsMR5tNVP9DDp8NGGzdbO57LeibpAF PO5n6VPl1Y0slOAMhHDz/AE5VQKmeokQRb+FCKT6gv+lY60OvP5Fow3vPbO0ZFvWbUki 1O9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date; bh=k3dsvM0jDksjCNNi9b7yS0jfV69FguW+x7C3pCI0HSQ=; fh=nD5kxsbDKCZnqwjz9OyAylJDBKGDSN0etw6d49DpHKQ=; b=cWbte3yraBGR3AiF45d4dAJjjEnjCzO6zmV83VTuH1KhPINKru1rj0t03mj/vDPZc9 pStnqZggDiIs80pewS7tAiOlUTY0md1ZodqXVPw1kmcTzxuGEeSxA3GdOdsZw4wktM1/ ae9nCRCdp9JcujmD9U9CJjN+xEWmYboy/ae/vpLuMACXE9pikFQKLw0X0oVcvJBPINNs fNSh9MmlUa0IsffVUP4605RDDl3tn3PpaEtTwBLXoERwhYweoPWujmyIFSXZvSEaDJT5 3Mrm++L0cs+16Mq2R+2wsuhYE+d8LSDb84S4kdDHcyiHYeUi5cb0WMPWv1RdUNZEFlow cB1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-179461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179461-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf277398si1440371385a.86.2024.05.14.22.36.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 22:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-179461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179461-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 206851C20ABD for ; Wed, 15 May 2024 05:36:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 74AC23A8E4; Wed, 15 May 2024 05:36:28 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD4013A1B0; Wed, 15 May 2024 05:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715751388; cv=none; b=LY4fQZoJIIlUVDi/apEmEwo9ecQuOwh943GzTjdpXI0KXzRzQqlIaAuY2wcGnnhEwwR3psJAYsdXs3NsUJTFNeB3Ewh4UNwt7AKS/Gu9lKmpZBBnrOMLKd1oSBlS9diWgjnjBLN4UfPv+sZQRSV07emm2BssSugQyAoYzMs1Awc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715751388; c=relaxed/simple; bh=c94//jp1PE5EDDwmY7Ielx198lHnxvyElpsaJQ+yI+M=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=YAesdkDnf+LudqI901xPrHeTZVtCtg2AMjPl6TTlvuddbauFmRifTW4EILN5EMqX9CiqBX2TMG6T+t29pdbAMKMtttosxrVEsyLV1MMKdFHFpxm2SZmsz3TiU2Wx8IvrYZsbOe9t+y3KQcwuZsV9WZTa076V8VtpTr2qbA5nixA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B008C116B1; Wed, 15 May 2024 05:36:27 +0000 (UTC) Date: Wed, 15 May 2024 01:36:20 -0400 From: Steven Rostedt To: LKML , Linux trace kernel Cc: Masami Hiramatsu , Mathieu Desnoyers , Ingo Molnar , Shuah Khan , Shuah Khan , linux-kselftest@vger.kernel.org Subject: [PATCH] selftests/ftrace: Fix test to handle both old and new kernels Message-ID: <20240515013620.098cb37a@rorschach.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit From: "Steven Rostedt (Google)" The function "scheduler_tick" was renamed to "sched_tick" and a selftest that used that function for testing function trace filtering used that function as part of the test. But the change causes it to fail when run on older kernels. As tests should not fail on older kernels, add a check to see which name is available before testing. Fixes: 86dd6c04ef9f2 ("sched/balancing: Rename scheduler_tick() => sched_tick()") Signed-off-by: Steven Rostedt (Google) --- .../ftrace/test.d/ftrace/func_set_ftrace_file.tc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc index 073a748b9380..263f6b798c85 100644 --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc @@ -19,7 +19,14 @@ fail() { # mesg FILTER=set_ftrace_filter FUNC1="schedule" -FUNC2="sched_tick" +if grep '^sched_tick\b' available_filter_functions; then + FUNC2="sched_tick" +elif grep '^scheduler_tick\b' available_filter_functions; then + FUNC2="scheduler_tick" +else + exit_unresolved +fi + ALL_FUNCS="#### all functions enabled ####" -- 2.43.0