From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF457C433FE for ; Fri, 6 May 2022 18:15:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350883AbiEFSTf (ORCPT ); Fri, 6 May 2022 14:19:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233843AbiEFSTf (ORCPT ); Fri, 6 May 2022 14:19:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B084A4D9FE; Fri, 6 May 2022 11:15:50 -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 ams.source.kernel.org (Postfix) with ESMTPS id D03B1B83882; Fri, 6 May 2022 18:15:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52452C385A8; Fri, 6 May 2022 18:15:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651860947; bh=HZhuEiXqbxhd9fR3VaMws+c8YgJggiG/REZXjlbhj18=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SbmKMuE4NMYBwSFmCjQO0fmQYNuHL4sHqBwee1oxEcLsDZ/hLL8UAq2s3MUOr5Z8w y565I0qstxIOWuzcW428eNk1WunYU+neAu+5eCwcn0oKMEZZo6lVrQddWyqoYal8Hg umu5w8HFMKhvDtlMucA3qqav0ZNVhO9KWViRPaUreU4K9ZfQOu5H+/2IGJmUw5D1qs p9mdDlhuBa3He8mklEiSWFIP0VCuEyRo2MVwKKNdgpWYzsYm/w0tO/Jr/mUW/rQfrU LctRvFwD3/xgvQ/l5sF5TU4e/ORTOmmDLQE5Uup1xLrrvqGemKRykhaJYPGtxuKPLo 9OOjWq+J5IJRg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 8796F400B1; Fri, 6 May 2022 15:15:44 -0300 (-03) Date: Fri, 6 May 2022 15:15:44 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Thomas Richter , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Jiri Olsa , Namhyung Kim , svens@linux.ibm.com, gor@linux.ibm.com, sumanthk@linux.ibm.com, hca@linux.ibm.com Subject: Re: [PATCH v3] perf test: Add skip to --per-thread test Message-ID: References: <20220505182505.3313191-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220505182505.3313191-1-irogers@google.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Em Thu, May 05, 2022 at 11:25:05AM -0700, Ian Rogers escreveu: > As reported in: > https://lore.kernel.org/linux-perf-users/20220428122821.3652015-1-tmricht@linux.ibm.com/ > the 'instructions:u' event may not be supported. Add a skip using 'perf > record'. > > Switch some code away from pipe to make the failures clearer. Thanks, applied. - Arnaldo > Reported-by: Thomas Richter > Tested-by: Thomas Richter > Signed-off-by: Ian Rogers > --- > tools/perf/tests/shell/record.sh | 46 ++++++++++++++++++++++++++++---- > 1 file changed, 41 insertions(+), 5 deletions(-) > > diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh > index d98f4d4a00e1..00c7285ce1ac 100755 > --- a/tools/perf/tests/shell/record.sh > +++ b/tools/perf/tests/shell/record.sh > @@ -5,11 +5,43 @@ > set -e > > err=0 > +perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX) > + > +cleanup() { > + rm -f ${perfdata} > + rm -f ${perfdata}.old > + trap - exit term int > +} > + > +trap_cleanup() { > + cleanup > + exit 1 > +} > +trap trap_cleanup exit term int > + > test_per_thread() { > echo "Basic --per-thread mode test" > - perf record -e instructions:u --per-thread -o- true 2> /dev/null \ > - | perf report -i- -q \ > - | egrep -q true > + if ! perf record -e instructions:u -o ${perfdata} --quiet true 2> /dev/null > + then > + echo "Per-thread record [Skipped instructions:u not supported]" > + if [ $err -ne 1 ] > + then > + err=2 > + fi > + return > + fi > + if ! perf record -e instructions:u --per-thread -o ${perfdata} true 2> /dev/null > + then > + echo "Per-thread record of instructions:u [Failed]" > + err=1 > + return > + fi > + if ! perf report -i ${perfdata} -q | egrep -q true > + then > + echo "Per-thread record [Failed missing output]" > + err=1 > + return > + fi > echo "Basic --per-thread mode test [Success]" > } > > @@ -18,6 +50,10 @@ test_register_capture() { > if ! perf list | egrep -q 'br_inst_retired.near_call' > then > echo "Register capture test [Skipped missing instruction]" > + if [ $err -ne 1 ] > + then > + err=2 > + fi > return > fi > if ! perf record --intr-regs=\? 2>&1 | egrep -q 'available registers: AX BX CX DX SI DI BP SP IP FLAGS CS SS R8 R9 R10 R11 R12 R13 R14 R15' > @@ -37,8 +73,8 @@ test_register_capture() { > echo "Register capture test [Success]" > } > > -# Test for platform support and return TEST_SKIP > -[ $(uname -m) = s390x ] && exit 2 > test_per_thread > test_register_capture > + > +cleanup > exit $err > -- > 2.36.0.512.ge40c2bad7a-goog -- - Arnaldo