Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2789257lqo; Mon, 20 May 2024 17:57:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVokA0Gz4DVfnykMOCLggogHAjhduVbRjbW/XdBoywlA4qR7HKEfWL2/nz7folKdevO8EzlL508tGaJ3Y2DLshNAndf+cYAnRM19M9PYw== X-Google-Smtp-Source: AGHT+IH8Aao9aku1ZXjUZZFU1bQAyCPiitXkIBrPzww70pFGnMKpDQcMAUJaq3HAoeetCLmbnaPB X-Received: by 2002:a50:9b1e:0:b0:572:4fc3:3a28 with SMTP id 4fb4d7f45d1cf-5734d5ceb22mr20962671a12.23.1716253034621; Mon, 20 May 2024 17:57:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716253034; cv=pass; d=google.com; s=arc-20160816; b=f5xOLT5dw9hQ29zghSgcE+NUj4dzzQiM8YJowqv0YWsvKRAhC3CMyeWWjQjtOE3gnM fwG6/oKS2buCYCEYOIjNtQLcC8TlU5HGX/KCI7TpuW4IIjtWR4o/tjheN2iamfTJq3Sr 7i+Kbpo4XZoc05VKb5vrxKgMgiuZ8FR/usOxL6eiVhAaAT4luuYHEiov9cHtdGuDY2gO fzHeOZBx+L9YfJA/6YZXXR4mAF3EkuFs9wUHlblDhFCqhvzHWxD41T2LK8wzD2XeOwW+ uXJv4tPMak9S3tkbzPJHVbznsjLJe23TVrlrU414BbsdXZ4zK8v4JpSQSlW8i+fnxTP9 K/EA== 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=QfqJQVpwPiVfQKVK4URH4+JlHr4zR067og2Rh3pzYoM=; fh=aK7pPAALcE8WS5JRehl4vvPpZ/9B4BNBeKK+RVqliec=; b=FBm76JXyWUKGgXkqYoIUhVTLoVSBWr1DBy/c0JgyEReUVY16mkfPBfyeatHGaYnrjf /NEqpW7t9ThwgkvTmUO8uAHQRFkq7PuDzTjUhyrw/zE2xCfSuWH1uytDY50FK5/BrZ2s YpsznqanRhrwIN3YfW7SB5h5ul42Dg/HxwSxvzfVqpq5ccW162jIPjP2AJp7Zd8EfWE7 DXhCQqUburvTBRVU9FIeKc7Jo+pTcziQyUGYjw3AWcUIht4IXO5ShdGriIxQ9eroodAU Tl5i8UdRJeqUV44ITFTrgVASr+r5SniCcagbTHd80n3dauKR7SQv3Tjd0ztfWBUWLE3o oIMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-184329-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184329-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-574eced1a7dsi7068982a12.549.2024.05.20.17.57.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 17:57:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184329-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-184329-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184329-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4E20F1F22B87 for ; Tue, 21 May 2024 00:57:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25095C142; Tue, 21 May 2024 00:57:01 +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 988A18F47; Tue, 21 May 2024 00:57:00 +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=1716253020; cv=none; b=oiQYCuzaRLoEknsFteD7SZ/U9ZjYeCM/sa4Bv2WWa0rES8wycmn3t8TolX4H8lTmC2aViKkNso/ZEIk26RMOZDIYxBY0+JflS6qCZfsg04MK09E9GK4grLJUjT8awE3fcEfPp81UBUBR/CWlYKhkqTf8hKshqFm0PRfbsoH3cxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716253020; c=relaxed/simple; bh=i7esZkCJs1i1DFmVbNbK5/OiVj5WUZNLu23G3gYB84Y=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=TaLnjtUHPTbzJ9RNyf/xZpT8qaCF0/1G1ox7/WDZ/PQY8FBNROERAmArRw+8sApYwAB+nAfZITGTIkKMp82SDvgyhW7sbCq2DLfn0swsI+ickQlYDkD446Xd7IV1DhKCV5KFki/OjyRI7Tv6bLquhR4W1ydAoqz74uMs6EEs53c= 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 3FFA1C32786; Tue, 21 May 2024 00:56:59 +0000 (UTC) Date: Mon, 20 May 2024 20:57:37 -0400 From: Steven Rostedt To: LKML , Linux Trace Kernel Cc: Masami Hiramatsu , Mathieu Desnoyers , Shuah Khan , linux-kselftest@vger.kernel.org Subject: [PATCH] tracing/selftests: Fix kprobe event name test for .isra. functions Message-ID: <20240520205737.5085e53a@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (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 kprobe_eventname.tc test checks if a function with .isra. can have a kprobe attached to it. It loops through the kallsyms file for all the functions that have the .isra. name, and checks if it exists in the available_filter_functions file, and if it does, it uses it to attach a kprobe to it. The issue is that kprobes can not attach to functions that are listed more than once in available_filter_functions. With the latest kernel, the function that is found is: rapl_event_update.isra.0 # grep rapl_event_update.isra.0 /sys/kernel/tracing/available_filter_functions rapl_event_update.isra.0 rapl_event_update.isra.0 It is listed twice. This causes the attached kprobe to it to fail which in turn fails the test. Instead of just picking the function function that is found in available_filter_functions, pick the first one that is listed only once in available_filter_functions. Cc: stable@vger.kernel.org Fixes: 604e3548236de ("selftests/ftrace: Select an existing function in kprobe_eventname test") Signed-off-by: Steven Rostedt (Google) --- .../testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc index 1f6981ef7afa..ba19b81cef39 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc @@ -30,7 +30,8 @@ find_dot_func() { fi grep " [tT] .*\.isra\..*" /proc/kallsyms | cut -f 3 -d " " | while read f; do - if grep -s $f available_filter_functions; then + cnt=`grep -s $f available_filter_functions | wc -l`; + if [ $cnt -eq 1 ]; then echo $f break fi -- 2.43.0