Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2805997lqo; Mon, 20 May 2024 18:49:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxAUfkl5svmOJXYUELneJTBCELMCYsX2o/lHFyGSgZleV4wpRAXWJsggXVfProbkTEymtuMAYS+MfAxcZ7FYxWUlTp2cD7waYq9JtuAQ== X-Google-Smtp-Source: AGHT+IFITgPp7w3ieO7DzuGh673Of02A5esN2Kn1P63fw7fXXuD6CxtQLli1S40U07mgTlDZ3MD1 X-Received: by 2002:ac2:4905:0:b0:515:9ee7:ce45 with SMTP id 2adb3069b0e04-5221016b5cemr26248535e87.49.1716256173380; Mon, 20 May 2024 18:49:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716256173; cv=pass; d=google.com; s=arc-20160816; b=MAlEmtJrpwK1ajdfE2zYJ1vn5xzouyiBQXT/tpFwizcSUCv364c+1pgZRT2t7cOI33 NWoc3Dv03s4yBNzLhgrSB/pIuwgmhinvrKsPzZIaG+zvQbt+xMvQRj5rd9m1RQiNtn8C jrYGnigs83UvvGFu20sZw5bWK8z4Jh+Bw2Z9z1kwlQCFrxD2w2ggUpA0/jdMG2pe6j5p 3Bb8UDg66v7tMei+8vGsNWMXW30EILkVAPKegW6QPnnjyckaj46b6DO2lPUlF5VZr3kj J2j9Yj+kvf6sUq61xF5HWFPhvbql5LK4/hnUAXYY3b+H+uBU/o31E4HSlOxAnrQPR9sm azuw== 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:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=zg1v8mPDz3Yxb+e0Bfo1KsxIv/NxNOU9DxDRaQv81S8=; fh=V5EO+quGV5eULexEPdJEMOy7KVnhiBv16pd92N+/1Fo=; b=UoZ/pe/klrprKgmkAPj2pJ51aI7pjKGfQbcrk7IKGg918izFW4QbUn7SxN5sCAF0Qg F9tNxq1AyDKwnZdFTu+857k0IuhFL6VNEAx9nlPJ9lhf4CRRyP38hzI0vBv9zeDpeDSO /ahyf8LrbG8qH/TMWKfRmepp+2IbiPuoAC6IwwOW9mJIo4rsVsbELxtu6D1hdniLse6V LW5CNgVVmNNYBHKI8DR0EBWCrefcNheFaBA6TrW31REb0WrnUFxf1TZkK33CEywXgaBp m/p8XcDJcXagpqUeGWSF++pf1EKTNsBeYxpjsvnjLGjDyAvKisWxzayXJxKkxim/wX7D 11QQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hAG9M4aM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184352-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184352-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17bffe61si1330187966b.886.2024.05.20.18.49.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 18:49:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184352-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hAG9M4aM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184352-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184352-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 1EA3E1F21860 for ; Tue, 21 May 2024 01:49:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C82FAD51E; Tue, 21 May 2024 01:49:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hAG9M4aM" 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 D8477134A9; Tue, 21 May 2024 01:49:23 +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=1716256164; cv=none; b=W89mSbR9rn64J8gsSc8QX4lK3DL/oCheX0w/NKA4FYK3Bc9tw+KLgEqZMsaUwmu3AjNkJrVTlYZBSVat8EPcejgSupcyictFCgD3WOblS70G2b99baIrghTG8L6i5p1q1u5VAxTvsksjYKbMPOM3H7iNpmenHqErrIdZhgnABgY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716256164; c=relaxed/simple; bh=6AoE8JrRf/P2Kp0T9FcUF8+twx+EGC02wSh/BOevY7c=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=F/4BbOPNsM7L80+vJeaGvC/vnBUJ0LN7Pixf5NShx12ipyKfnnbgpFWXH29fhksWQlcWdm8jEsweKL7QXL0u2dKB/50dxFA74S9+GrHNAZG6LTA5gn8x1psxjR6dhUUgXOnTi2fjL+7FLSgcTShAxjQRsApZXkogSAf3Kvi4GCE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hAG9M4aM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C44BC2BD10; Tue, 21 May 2024 01:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716256163; bh=6AoE8JrRf/P2Kp0T9FcUF8+twx+EGC02wSh/BOevY7c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hAG9M4aMDyFTI9gkzPQ9lsVer3t+/x+zzxo2s+B5leazONUK9lv+B24U/aIUrb9NP y498FfWhHbVtU+IHh/b1apxA6NBMUGnaTq9/sEJJd8S7R25GIltcUBNXSLDLw30ZRI nMK7162iHL566J/vX8JlQwGTXRgOt/FPbXhtROdUt7Y4Pk8Z6lgRMgwjurxcF/ZzgC bouY8lkIstj4h4HRx3SviNGOUEDThbKU7hXjoOrRlF+pEcCShh+UzKPFvuEEkvGyQa 8DdINs0a5ClV80tAB6wLOSJMjvI/J4qMGJz0DksPM3tprAVlXceFEVmlsdzEKCC4xI 9xUsOOV7Qn36w== Date: Tue, 21 May 2024 10:49:19 +0900 From: Masami Hiramatsu (Google) To: Steven Rostedt Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mathieu Desnoyers , Shuah Khan , linux-kselftest@vger.kernel.org Subject: Re: [PATCH] tracing/selftests: Fix kprobe event name test for .isra. functions Message-Id: <20240521104919.c8fd7a91b4a9c0435d17017b@kernel.org> In-Reply-To: <20240520205737.5085e53a@gandalf.local.home> References: <20240520205737.5085e53a@gandalf.local.home> X-Mailer: Sylpheed 3.7.0 (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 On Mon, 20 May 2024 20:57:37 -0400 Steven Rostedt wrote: > 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. > Looks good to me. Acked-by: Masami Hiramatsu (Google) Thanks! > 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 > -- Masami Hiramatsu (Google)