Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5250865rdb; Wed, 13 Dec 2023 03:36:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSoJEUV8yEC41QeYP0H3c1eB8U6cT3o5OoH6JVP0Kiq0y9kbJ6l3MVsnRXTeD+2hLL/H7V X-Received: by 2002:a05:6e02:17c6:b0:35f:71a9:19a5 with SMTP id z6-20020a056e0217c600b0035f71a919a5mr1724449ilu.8.1702467363193; Wed, 13 Dec 2023 03:36:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702467363; cv=none; d=google.com; s=arc-20160816; b=Cinzb3znKn/NQpDMmNruqptUkEUK+XlqeqOQQrSDyK5bxkfoF+Sbr9ynrLJDHnOR7I hJGmexxgHLm+Rl9/8hGjIcepRVxMHwaGLqASQt+sm08WT+bgK/nhg2P3Z81UI7WvtWZI LFmy+t33QElqIHXvmNZ1UgJzY90Smmn3oevoyQsJroTS95fCkVHJGXDIKwE1L/S0GQ2K DB5ufel8zAlQSHkFN/etQNQbJKaE6cQQNLdezvECzikHKpQTXGOH8vF2wP4swtdTbmpT WwMZAtXF5UwZNLiHtzASHV3rZRdCKzyROVKAdbmz0b9EEFJtE80HHFvDQ98B8q92197q 0j0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bbI20ubAHqKAo3I+3HLopbk6vWmx0r3Qt4JD0NtJl4Y=; fh=9So90lM7BHGpd7cey24e0Cp2Kd5jwpG4eSyF2POm8Dw=; b=jiHRk6U0qy3pE11IQf6rPmO1LCxnDFagI1f2M52MFVFDWbyrYKKZxWDN/RNcSZejAG lAOpkmnnFYHA6cNafpCd862Di7oKgzlSBL0eHC7LBMp9dTJrqI30yfHVkieFhxTzEz3/ ZFVe3wgOc4l68iZIB+wnJqooICO6alVDpQtckXo9ixJREqb687i08B6FvjMtkVzXH1fw epMw8llHs3EuicdeAx7+90oRX2/E8p/IMH4saLZKZeBEZlteeDf7Avq5EfOq0eVwGTDK DWSLHc9xUpOiRkUgmZB/z2cOSH4I0zNNyPRfDr1VvPhrzmaMamK9WtjN0pZs3PYUACeu 6+jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WZfPU5Fv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id u1-20020a170902e5c100b001d08f1a5c70si9667742plf.405.2023.12.13.03.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 03:36:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WZfPU5Fv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id ADA0F807FD6D; Wed, 13 Dec 2023 03:35:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235395AbjLMLfd (ORCPT + 99 others); Wed, 13 Dec 2023 06:35:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235386AbjLMLfU (ORCPT ); Wed, 13 Dec 2023 06:35:20 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5647113 for ; Wed, 13 Dec 2023 03:34:35 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5BC4C433C8; Wed, 13 Dec 2023 11:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702467275; bh=FB61QkUhmBBoX1jpL4t7zTF9O9cz5293f+BUjVdgdW8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WZfPU5FvnLlC/I+TJW5gUU7zyoV7MBTQNtaFpkzsj9VeRiWrvdq3CMH1h0BOJ5ml0 ufGA/f2+2nG3H/hNi4amKJKC2qJURsxYeCEWvdlxtSHxyQgQEWewxgH3erTU4pQraO TPqkNJJAnDB8/XdGC45i77mi+WDlVo4BEfsDIsbiOUsuX2rC1rFXDSZuBNUxLlLaom kcxWAn5+d/VFlIgUCxD6mP95YE/SYWqmxwiy0nMFMHDQTjhJrrbZk+W9MI05EvAO/E 6K6E+gWBIz4RY99wpKrxQxQyypgrGzucaetlxwkVwNnWBEZqrENkTFf8Yby2AmbaFB XwybkoATIv6sw== Date: Wed, 13 Dec 2023 17:00:40 +0530 From: Naveen N Rao To: Masami Hiramatsu Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Shuah Khan , Michael Ellerman Subject: Re: [PATCH] selftests/ftrace: Add test to exercize function tracer across cpu hotplug Message-ID: <3juxoqz7kal42uowxfqvahtjpcla6mm6wv4dmoq7pxvjzg6f62@cwhzmibrqur4> References: <20231212085607.1213210-1-naveen@kernel.org> <20231213094038.6c9518a2042b84c8388ec6ae@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231213094038.6c9518a2042b84c8388ec6ae@kernel.org> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 13 Dec 2023 03:36:00 -0800 (PST) On Wed, Dec 13, 2023 at 09:40:38AM +0900, Masami Hiramatsu wrote: > 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. Good point, thanks. I will send a v2. - Naveen