Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5010289rdb; Tue, 12 Dec 2023 16:40:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEweEXYiccIdg8z1KylY6YjVzrmdFx0N0UnrD6Kc09ZyOUi9za3qekyjta+sKQB8QDE80uv X-Received: by 2002:a05:6870:c0f:b0:1fb:75b:2fce with SMTP id le15-20020a0568700c0f00b001fb075b2fcemr9044814oab.101.1702428053373; Tue, 12 Dec 2023 16:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702428053; cv=none; d=google.com; s=arc-20160816; b=zvhNWAV61Wv2VugVgKrQo+rhJXKa4cPoSOrL6GFZaLF/Hf5XZIUxURaEytVcu4YHNz v1d3QRSR6UtMSB00lz0/MHvLAOlyCGetihwZehwQAY6ZIoKewonqtXGqG2InuhziCbzA e3R4i+xr4PcUbkdYFBOszG3bKTqFjFV1qfoHnxkblNDKCMlKta1rgrjNDxQLqq8Zn4rL o2kkKcZWN5IoWrhMY5cXNcjkExOKRyXcQ5Q1kW9MYppcrM83xAgyPsPGttzw7TOJMDt8 y/Jiy9AgqnZiqEEJQ+7dFVtk34RBcDaHUBThkos6tLZb4+r7YUWeaQQf0l3S1ZPc2b2D /S4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=CsbvumOvkaZvbrP/oXOxULpuK+ErO5sr0VhS9IL93NE=; fh=egPY+NW2iGsDWzZwMaWh2aZv2fzK/f3Nf0KWzXb9fSU=; b=kW1eLtPlu+AULjVFH2hgzzWw6Tc+HCtiPbDMqZ0mJ+XiZxbpf5c067Kv2nyLfmsYsz KZlZN9keo/Y1Eutt9uej0juarblAScc4/bf8BaCvspi+kuVBdsM/nNI7K3nzPXYyJJ8y ngon2gYVXRftJZjNfdwGDS6t9vLqwkCmjJjVaWl1au6W7CW9D4AoNnEKUBOsIrWv6oO8 ZaHOUjLoOL0nYCCECxf6+CPephNnNx6TdCGOij6Dm5T5UQ2iP0CGf/3Tt2D++ZsBxT7F 5tr9IyuOsV7UOtFElH8NStTiNidOi6hn1OyHe79YI6W8g1Vma+txS15Pdr4Xe83bo0Df iJdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Yj1K/lmw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id bk2-20020a056a02028200b005b18b5da51asi3977241pgb.346.2023.12.12.16.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 16:40:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Yj1K/lmw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DA1C78048D85; Tue, 12 Dec 2023 16:40:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377885AbjLMAkh (ORCPT + 99 others); Tue, 12 Dec 2023 19:40:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377870AbjLMAkg (ORCPT ); Tue, 12 Dec 2023 19:40:36 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E28EEAC for ; Tue, 12 Dec 2023 16:40:42 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE4A1C433C7; Wed, 13 Dec 2023 00:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702428042; bh=yaOwyRdIE6NOk7geX4K1Pt2wgBpMW9U+4MntbxQURCg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Yj1K/lmw3/ETwXTyAQSKFVJX2kJMUqhNhBGdxKl6cdMPT2LkbWQBAFima855XXjIU F8XcRe+llUb+ob2bgnSv/EQps95hU5ddAvcJSL+XdKJDtbutXD3utC80d6xkVGn77m xFgIv49utMavdx0BC6nvK7KyrtpqPP7Q78/ifBWh0e9Xh5kG62w0WGYsjHMTXIKtSL UQAiYUJdUPaGlXDDgtVLCU1GxBJn1x5rAZvQq54PBUxnN4xOy2XUDxQmUA5FAQrKuy XoHoJ8gd+zYnbEi9RIQ71imytOLyKR/hKF1n4E/l+8S6sKzdMaKto4bPUN4IrSsxQf n4YuThzp87x1Q== Date: Wed, 13 Dec 2023 09:40:38 +0900 From: Masami Hiramatsu (Google) To: Naveen N Rao Cc: , , Steven Rostedt , Masami Hiramatsu , Shuah Khan , Michael Ellerman Subject: Re: [PATCH] selftests/ftrace: Add test to exercize function tracer across cpu hotplug Message-Id: <20231213094038.6c9518a2042b84c8388ec6ae@kernel.org> In-Reply-To: <20231212085607.1213210-1-naveen@kernel.org> References: <20231212085607.1213210-1-naveen@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Dec 2023 16:40:51 -0800 (PST) Hi Naveen, On Tue, 12 Dec 2023 14:26:07 +0530 Naveen N Rao wrote: > Add a test to exercize cpu hotplug with the function tracer active to > ensure that sensitive functions in idle path are excluded from being > traced. This helps catch issues such as the one fixed by commit > 4b3338aaa74d ("powerpc/ftrace: Fix stack teardown in ftrace_no_trace"). > > Signed-off-by: Naveen N Rao > --- > .../ftrace/test.d/ftrace/func_hotplug.tc | 30 +++++++++++++++++++ > 1 file changed, 30 insertions(+) > create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc > > diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc > new file mode 100644 > index 000000000000..49731a2b5c23 > --- /dev/null > +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc > @@ -0,0 +1,30 @@ > +#!/bin/sh > +# SPDX-License-Identifier: GPL-2.0 > +# description: ftrace - function trace across cpu hotplug > +# requires: function:tracer > + > +if ! which nproc ; then > + nproc() { > + ls -d /sys/devices/system/cpu/cpu[0-9]* | wc -l > + } > +fi > + > +NP=`nproc` > + > +if [ $NP -eq 1 ] ;then > + echo "We can not test cpu hotplug in UP environment" > + exit_unresolved > +fi This looks good, but can you find the 2nd online CPU before this test? I mean, there is a case that cpu1 is already offlined and others like cpu2 is onlined. So we need to use the 2nd online cpu. Thank you, > + > +echo 0 > tracing_on > +echo > trace > +: "Set CPU1 offline/online with function tracer enabled" > +echo function > current_tracer > +echo 1 > tracing_on > +(echo 0 > /sys/devices/system/cpu/cpu1/online) > +(echo "forked"; sleep 1) > +(echo 1 > /sys/devices/system/cpu/cpu1/online) > +echo 0 > tracing_on > + > +: "Check CPU1 events are recorded" > +grep -q -e "\[001\]" trace > > base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86 > -- > 2.43.0 > -- Masami Hiramatsu (Google)