Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp338566rwd; Wed, 24 May 2023 19:29:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4x6SxCdTGk85zJ2LEmFyXQMTwRn+nvoTGtJhsI3pPNMAcs/Tah2fxi72pDkzlXsCgmPtgI X-Received: by 2002:a17:903:1c3:b0:1af:bd10:4045 with SMTP id e3-20020a17090301c300b001afbd104045mr97433plh.6.1684981773900; Wed, 24 May 2023 19:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684981773; cv=none; d=google.com; s=arc-20160816; b=BrwUykBpwsXX+qdzMjoqRDZ8dQ3xBpWt6vwTPl9GEOUQ0bT5w3Zgu+QW7GzWbmBeR0 +r8Mm/XJoCxZ2sBvseir6UN/XtoxZ0tpE65h7yU8Rh72EbqP/ioAttyvUpZz1pDBdALp VpG56ty3qib5tFXE+87vHck/PPSgidM0Jd0wG0Wf+zfkuTjaEDfGkQkfLQYLhBBVPuKk bpz8IlTvPPlzYTcfKdpb/u8UOpd8Rj2Jf1LW68/7sIkfSB8jc3bt4/c3cA2TuNAgJSAi ldZUpjKutty85dm5eSS3igXhpFPDtqFA2itqKAdEXuVkqm0Oux7db94DyTh0YgSDcOov ZSMw== 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=6+dSmCkWqNdeRqsyoEnEWlu6MAnR74pbCSJyPDjgx7c=; b=loSlQRt/YQYEmyVcSpgY+ACgleFCTCP95Aj0311uWxCy+HrmmGnU9RZ4m/GF6d9S4v p5UHS/VyBaOO/ikfBYJTZ2YqMtk2RH8nue5NMLEO81BIGpar2Oht1slp30OCqTZr9A6w XoWj0774PZ34br6EWT0u1guPXb8nCdciLfrvQy1HPOc//fEKBe/2i612lgp8sH7ktrNb I3OGTp2NhqDGDIEYrWkH/Lm7N/zUd4ENqwNQd7aHmuTPEIzUZ2tJDabt5xgyJIjwTLXx E8MeempT2M+ht4etNHsDqz/alRaEBBTOCyW7b+0xEzzwp9O/Lo+1QaYjTz6VKg12mY3c 1o6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UDEj8I3O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h24-20020a170902ac9800b0019a71e14c19si304477plr.320.2023.05.24.19.29.18; Wed, 24 May 2023 19:29:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UDEj8I3O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232664AbjEYCYR (ORCPT + 99 others); Wed, 24 May 2023 22:24:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236525AbjEYCYP (ORCPT ); Wed, 24 May 2023 22:24:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68117139; Wed, 24 May 2023 19:24:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 03EB1635A0; Thu, 25 May 2023 02:24:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F0FEC433D2; Thu, 25 May 2023 02:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684981453; bh=1XyJN682bKPmnrFMOUA/Rz8FyBhig9nJpB9ztqCBcMA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UDEj8I3OQISu5wf/9VcTweiPKsdAojV5u/bdpiZ76ZZeRJmm0NuU7d2PHyvTL7njK d8A3DpR/AMg7zrSetNBn/55/5Pza0YtFdIa1gBPMaKMEdDWqnNgTYnRKHLGXjuK7/U WF/mQ7Hj/+wVbSO/gMBsnUPvndFEW5x+k+l0WgzjrO1aoMnDePhaHyLqb9ZKNFUi6G zyZxqHGByC7Ds0cjyCxvWacmZrytuaPkhQ57OjM5fuRl1J7H/DCAdTgNSjDPsF+MBv 6MN1Eqc1YhJud4XYlX5di0PEFunkYoxqOkqg/nn6loUCe8yFTzWo4JECqhvOyaYZWe eAR7Fy5Kq1lMQ== Date: Thu, 25 May 2023 10:24:08 +0800 From: Masami Hiramatsu (Google) To: Steven Rostedt Cc: LKML , Linux trace kernel , Masami Hiramatsu , Tom Zanussi , Mark Rutland , Shuah Khan , Shuah Khan , linux-kselftest@vger.kernel.org Subject: Re: [PATCH] tracing/selftests: Update synthetic event selftest to use common_stacktrace Message-Id: <20230525102408.4b2750621cb1deeb05e58980@kernel.org> In-Reply-To: <20230523225402.55951f2f@rorschach.local.home> References: <20230523225402.55951f2f@rorschach.local.home> X-Mailer: Sylpheed 3.8.0beta1 (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=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 May 2023 22:54:29 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > With the rename of the stacktrace field to common_stacktrace, update the > selftests to reflect this change. Copy the current selftest to test the > backward compatibility "stacktrace" keyword. Also the "requires" of that > test was incorrect, so it would never actually ran before. That is fixed > now. > > Signed-off-by: Steven Rostedt (Google) Looks good to me. Acked-by: Masami Hiramatsu (Google) Thanks, > --- > .../trigger-synthetic-event-stack-legacy.tc | 24 +++++++++++++++++++ > .../trigger-synthetic-event-stack.tc | 5 ++-- > 2 files changed, 26 insertions(+), 3 deletions(-) > create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-stack-legacy.tc > > diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-stack-legacy.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-stack-legacy.tc > new file mode 100644 > index 000000000000..d0cd91a93069 > --- /dev/null > +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-stack-legacy.tc > @@ -0,0 +1,24 @@ > +#!/bin/sh > +# SPDX-License-Identifier: GPL-2.0 > +# description: event trigger - test inter-event histogram trigger trace action with dynamic string param (legacy stack) > +# requires: set_event synthetic_events events/sched/sched_process_exec/hist "long[] stack' >> synthetic_events":README > + > +fail() { #msg > + echo $1 > + exit_fail > +} > + > +echo "Test create synthetic event with stack" > + > +# Test the old stacktrace keyword (for backward compatibility) > +echo 's:wake_lat pid_t pid; u64 delta; unsigned long[] stack;' > dynamic_events > +echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=stacktrace if prev_state == 1||prev_state == 2' >> events/sched/sched_switch/trigger > +echo 'hist:keys=prev_pid:delta=common_timestamp.usecs-$ts,s=$st:onmax($delta).trace(wake_lat,prev_pid,$delta,$s)' >> events/sched/sched_switch/trigger > +echo 1 > events/synthetic/wake_lat/enable > +sleep 1 > + > +if ! grep -q "=>.*sched" trace; then > + fail "Failed to create synthetic event with stack" > +fi > + > +exit 0 > diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-stack.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-stack.tc > index 755dbe94ccf4..8f1cc9a86a06 100644 > --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-stack.tc > +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-stack.tc > @@ -1,7 +1,7 @@ > #!/bin/sh > # SPDX-License-Identifier: GPL-2.0 > # description: event trigger - test inter-event histogram trigger trace action with dynamic string param > -# requires: set_event synthetic_events events/sched/sched_process_exec/hist "long[]' >> synthetic_events":README > +# requires: set_event synthetic_events events/sched/sched_process_exec/hist "can be any field, or the special string 'common_stacktrace'":README > > fail() { #msg > echo $1 > @@ -10,9 +10,8 @@ fail() { #msg > > echo "Test create synthetic event with stack" > > - > echo 's:wake_lat pid_t pid; u64 delta; unsigned long[] stack;' > dynamic_events > -echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=stacktrace if prev_state == 1||prev_state == 2' >> events/sched/sched_switch/trigger > +echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=common_stacktrace if prev_state == 1||prev_state == 2' >> events/sched/sched_switch/trigger > echo 'hist:keys=prev_pid:delta=common_timestamp.usecs-$ts,s=$st:onmax($delta).trace(wake_lat,prev_pid,$delta,$s)' >> events/sched/sched_switch/trigger > echo 1 > events/synthetic/wake_lat/enable > sleep 1 > -- > 2.39.2 > -- Masami Hiramatsu (Google)