Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6440322rwr; Mon, 24 Apr 2023 21:00:18 -0700 (PDT) X-Google-Smtp-Source: AKy350b6CX58MavOOTyYgzMYKtV8SJodoLr+g+Zk4SHu//VVFZpv567Ux0fJblPoDYB60ABPXP/5 X-Received: by 2002:a05:6a20:158d:b0:e6:f7e8:1e4d with SMTP id h13-20020a056a20158d00b000e6f7e81e4dmr19950510pzj.33.1682395217906; Mon, 24 Apr 2023 21:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682395217; cv=none; d=google.com; s=arc-20160816; b=hOYfPxj9KsTZzFr6CgoDsSxcegy3W60/lKH2BX3Hvjhc1Sxu8O8W1UKaqA8HNHaZFF NDDb93u7AoQrCAV1Rt95GB8IgtY0XSNNwy4VHHhsbsIzaldTfX7UmDMhfsF+yh2F/iL6 st7a8t89SRVlm+nzU+k+Kg43b85WMbu/vch+Znqm+7bnpJG7j1hTyZWMxkWMBNtuUGBW dcCUPEXmGnmB3qCHSY6pTij2Z6uvesFs063e0m161/iNpWjeB339uPSpFt4NHwp99evC oCF2Pf8Ybgzf+Y1vx2h8baM53fc+NDr06f6QO24bEBYYy05MnElLFk/bAZDEJtFY5QY+ Boew== 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=O3brXiF/4Azi6by8FBgv0Tg9bzuDSPg82Q0aph/vY1w=; b=wdGds3vfzoxYLumgF1SU1yCKRhqh+Tf5jEKWx9ONKVDMnNQqdlLlmcsSp9Jisae5A2 C7pUoYqq9HsNETBtLvqOJQDd0CLK/rRPlM/4wjbBfXnulKd023Xhnu8JXNCFz5y8gLvc RIGQMDRlJOPuGmImSpAbIi4I7XZx4xT0qoM78IufVHxfRmfr8WyYK2xJHNt3iJ/si5Wv mWmlTHzpoHwK1+115Wwh890el8RrGdm0C8QKhIvuRab/9Ax9bSSWJOrxXsUZtYlcLqQd dh4R7ggMGy+dpDC90nmK4YnZNH23rm7FuO/3T4vFIdqHPfPzENVZ9IL2G4t4syy9oZXH ugAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bhJgaQg0; 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 y10-20020a655a0a000000b004fbffa7d04dsi12894114pgs.863.2023.04.24.21.00.02; Mon, 24 Apr 2023 21:00:17 -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=bhJgaQg0; 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 S232430AbjDYDzR (ORCPT + 99 others); Mon, 24 Apr 2023 23:55:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjDYDzO (ORCPT ); Mon, 24 Apr 2023 23:55:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C13634EC0; Mon, 24 Apr 2023 20:55:10 -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 5B8FC62269; Tue, 25 Apr 2023 03:55:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB284C433EF; Tue, 25 Apr 2023 03:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682394909; bh=uVme7c/++qsefUV47B4cdTguxdMoQe4SjR4FK0ZWBuE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bhJgaQg0jONknwAgfyUZsJd86mofpx1fv6cGEYRensyGZ+mdutXYDxFJcXvnEprz/ 5YyfplT28AC/idDSHd2E0GuZ1TDCm64l/nt/0luZ9Dwz3T7tbjj7udX/wOc3dPS6dy GbgaTyMSN1YVKyHp9tOYKdro0VPpwjPnsepNwSwabfrDHbYL/2w8kc2HC6r22NMSJl h6XfSvQdYVcka76l7JiVyOgkKzR1kEvBTzmmY6ualZL3nDu/wdIeFU0yq/i9i0+9ts lX57+vBOZXjP3iewDcAmNOs48zGMobA1Em4xGAzl9iIA58CodQbXhxJ/s0Av06E/iw Ok8Q/bY7tRZkQ== Date: Tue, 25 Apr 2023 12:55:02 +0900 From: Masami Hiramatsu (Google) To: Donglin Peng Cc: rostedt@goodmis.org, linux@armlinux.org.uk, mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com, rmk+kernel@armlinux.org.uk, palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, tglx@linutronix.de, dave.hansen@linux.intel.com, x86@kernel.org, bp@alien8.de, hpa@zytor.com, chenhuacai@kernel.org, zhangqing@loongson.cn, kernel@xen0n.name, mingo@redhat.com, peterz@infradead.org, xiehuan09@gmail.com, dinghui@sangfor.com.cn, huangcun@sangfor.com.cn, dolinux.peng@gmail.com, linux-trace-kernel@vger.kernel.org, loongarch@lists.linux.dev, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v11 8/8] selftests/ftrace: Add funcgraph-retval test case Message-Id: <20230425125502.074e098a6ecf8fc3a9f19dd0@kernel.org> In-Reply-To: <9fedbd25e63f012cade5dad13be21225fec2fb5d.1680954589.git.pengdonglin@sangfor.com.cn> References: <9fedbd25e63f012cade5dad13be21225fec2fb5d.1680954589.git.pengdonglin@sangfor.com.cn> 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=-5.8 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_MED,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 Sat, 8 Apr 2023 05:42:22 -0700 Donglin Peng wrote: > Add a test case for the funcgraph-retval and funcgraph-retval-hex > trace options. > This looks good to me. Acked-by: Masami Hiramatsu (Google) Thank you! > Signed-off-by: Donglin Peng > --- > v11: > - Fix selftest issues > > v10: > - Fix issues in selftest > > v8: > - Fix issues in selftest > --- > .../ftrace/test.d/ftrace/fgraph-retval.tc | 44 +++++++++++++++++++ > 1 file changed, 44 insertions(+) > create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/fgraph-retval.tc > > diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-retval.tc b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-retval.tc > new file mode 100644 > index 000000000000..e34c0bdef3ed > --- /dev/null > +++ b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-retval.tc > @@ -0,0 +1,44 @@ > +#!/bin/sh > +# SPDX-License-Identifier: GPL-2.0 > +# description: ftrace - function graph print function return value > +# requires: options/funcgraph-retval options/funcgraph-retval-hex function_graph:tracer > + > +# Make sure that funcgraph-retval works > + > +fail() { # msg > + echo $1 > + exit_fail > +} > + > +disable_tracing > +clear_trace > + > +# get self PID, can not use $$, because it is PPID > +read PID _ < /proc/self/stat > + > +[ -f set_ftrace_filter ] && echo proc_reg_write > set_ftrace_filter > +[ -f set_ftrace_pid ] && echo ${PID} > set_ftrace_pid > +echo function_graph > current_tracer > +echo 1 > options/funcgraph-retval > + > +set +e > +enable_tracing > +echo > /proc/interrupts > +disable_tracing > +set -e > + > +: "Test printing the error code in signed decimal format" > +echo 0 > options/funcgraph-retval-hex > +count=`cat trace | grep 'proc_reg_write' | grep '= -5' | wc -l` > +if [ $count -eq 0 ]; then > + fail "Return value can not be printed in signed decimal format" > +fi > + > +: "Test printing the error code in hexadecimal format" > +echo 1 > options/funcgraph-retval-hex > +count=`cat trace | grep 'proc_reg_write' | grep 'fffffffb' | wc -l` > +if [ $count -eq 0 ]; then > + fail "Return value can not be printed in hexadecimal format" > +fi > + > +exit 0 > -- > 2.25.1 > -- Masami Hiramatsu (Google)