Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4201161rwb; Tue, 8 Nov 2022 13:39:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf7cbe+s/09bqTcVsFPyVaIr3K1yEnHd2mqhf6m/ZKqGPtCw+ueAGFnFpYPairVeIPMAWiHG X-Received: by 2002:a17:907:9555:b0:7ae:5471:379c with SMTP id ex21-20020a170907955500b007ae5471379cmr17394167ejc.123.1667943543779; Tue, 08 Nov 2022 13:39:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667943543; cv=none; d=google.com; s=arc-20160816; b=pGp+lkj7AU69QLgMxTJ6434y9o/Ba3S0KiJ3ptxvf2ILbpdOKDlD/HmOJglLFF9PcO VY9Wt6dIog7o/8MxvQ6c/eH0l2hvsf/Un8jdW6oJgxdkhRi/0JbZsXHWfBKZnFE3SO4G ZOs8eS3QoIbMN2lxqqYPlo0bA73bp/euNIalKNalYvJ5aFC8jR+LkOrwN3zkWH5o/NL/ i+vAvwOqBOrF4nM6nvVigkFdpzjCie+cRb+ylv6rLqpr+dt8bHiXE8V7GzrHfXq/oYbY Z7E/xAK3yWXa8zfYRx+eP3g4rYAjITyZ7JhzCmAEZl/aIEAYCBosYx/XnbplYmRkAbcB 8G0A== 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=SG6XfJXV3oRrhE3bHSaeM2pZ/enacffgJxBngyOxH7E=; b=KrE/eqWtzz8AKc30M6emmKkmzCBsrKcZdyLsx7Mog7zBowKkL+LQf98GsmeSRxgwwJ DdE9TtjRZvgn3qFsYoygiYg4dev60s8FdATISwd/0a68JOiG/XyNy4rPH3OAcbIV9n4C 1KynKuiMuZK5gXjTIbarkzywrsCMlYmgTAOLOKkWyU/tvhxV6nFPv14ERWlSHxlnMk3Q EsN2aag7p7dUbcs9IcYHFw88x1ViyS5eVlKLZXlfZVWa2EfFam+mb/czgd2+DOgqxxyD ZO9EWg2ojIVjspZ1rXZUwInBE7f0697/2xTLMQppqSzPB7LoZev+Z111lpdNkPhR528C l4rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aKgCKTgU; 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 hq23-20020a1709073f1700b0078d1faeb619si15233772ejc.777.2022.11.08.13.38.29; Tue, 08 Nov 2022 13:39:03 -0800 (PST) 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=aKgCKTgU; 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 S229986AbiKHVBB (ORCPT + 92 others); Tue, 8 Nov 2022 16:01:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbiKHVA7 (ORCPT ); Tue, 8 Nov 2022 16:00:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58E3A6069C; Tue, 8 Nov 2022 13:00:58 -0800 (PST) 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 EAD686178B; Tue, 8 Nov 2022 21:00:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32294C433D6; Tue, 8 Nov 2022 21:00:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667941257; bh=TbBcZqlA9hZFZiK0znBTp3l6Bdf+6JHPlXaM56tzaKU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aKgCKTgU7ie+MzsF6DWCsZpUD2ScDZUag5Njqwow4yXbpmn9SUX4LfDt1MZy2QiPO zHDl6Oe9NzmhyaZgN4nTtwbmqvw0ZmikDjKDtD/suwTes1/Y45WLZVF2as/LZVbZz2 QCBlmT+P8LULdn8Gut7KKw2QsLlA8I+YfcSFGGgJZSJoBIoZwU3of49K2n7lYXAwL9 dXTlPevHC//WO4txEJ/PsCDc/owiQ9n7H+/WBnT3PrAhdjck7iIqpK6j9A865U2tAE Z4rtskjdhF0aMkg9WQFoM63evwRvDYuSFjuz4wjhZXHflL1qvYSpJ7Tzq2OEOAhbks skwsp3K0wPyKg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id DEA3A4034E; Tue, 8 Nov 2022 18:00:54 -0300 (-03) Date: Tue, 8 Nov 2022 18:00:54 -0300 From: Arnaldo Carvalho de Melo To: Athira Rajeev Cc: James Clark , LKML , Anshuman.Khandual@arm.com, Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kajol Jain , linux-perf-users@vger.kernel.org Subject: Re: [PATCH] perf test: Fix skipping branch stack sampling test Message-ID: References: <20221028121913.745307-1-james.clark@arm.com> <2265e166-da9c-f540-a108-0d0b133f7da9@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Em Wed, Nov 02, 2022 at 12:21:11PM +0530, Athira Rajeev escreveu: > > > > On 28-Oct-2022, at 5:52 PM, James Clark wrote: > > > > > > > > On 28/10/2022 13:19, James Clark wrote: > >> Commit f4a2aade6809 ("perf tests powerpc: Fix branch stack sampling test > >> to include sanity check for branch filter") added a skip if certain > >> branch options aren't available. But the change added both -b > >> (--branch-any) and --branch-filter options at the same time, which will > >> always result in a failure on any platform because the arguments can't > >> be used together. > >> > >> Fix this by removing -b (--branch-any) and leaving --branch-filter which > >> already specifies 'any'. Also add warning messages to the test and perf > >> tool. > >> > > > > Hi Athira, > > > > Are you able to check if this still skips for you on PowerPC with this > > new change? > > > > Hi James, > > Sorry for the late response. I was out on vacation couple of days. > > I tested with the new change and verified it skips on powerpc. > > Tested-by: Athira Rajeev Thanks, applied. - Arnaldo > Thanks > Athira > > Thanks > > James > > > >> Output on x86 before this fix: > >> > >> $ sudo ./perf test branch > >> 108: Check branch stack sampling : Skip > >> > >> After: > >> > >> $ sudo ./perf test branch > >> 108: Check branch stack sampling : Ok > >> > >> Fixes: f4a2aade6809 ("perf tests powerpc: Fix branch stack sampling test to include sanity check for branch filter") > >> Signed-off-by: James Clark > >> --- > >> tools/perf/tests/shell/test_brstack.sh | 5 ++++- > >> tools/perf/util/parse-branch-options.c | 4 +++- > >> 2 files changed, 7 insertions(+), 2 deletions(-) > >> > >> diff --git a/tools/perf/tests/shell/test_brstack.sh b/tools/perf/tests/shell/test_brstack.sh > >> index ec801cffae6b..d7ff5c4b4da4 100755 > >> --- a/tools/perf/tests/shell/test_brstack.sh > >> +++ b/tools/perf/tests/shell/test_brstack.sh > >> @@ -13,7 +13,10 @@ fi > >> > >> # skip the test if the hardware doesn't support branch stack sampling > >> # and if the architecture doesn't support filter types: any,save_type,u > >> -perf record -b -o- -B --branch-filter any,save_type,u true > /dev/null 2>&1 || exit 2 > >> +if ! perf record -o- --no-buildid --branch-filter any,save_type,u -- true > /dev/null 2>&1 ; then > >> + echo "skip: system doesn't support filter types: any,save_type,u" > >> + exit 2 > >> +fi > >> > >> TMPDIR=$(mktemp -d /tmp/__perf_test.program.XXXXX) > >> > >> diff --git a/tools/perf/util/parse-branch-options.c b/tools/perf/util/parse-branch-options.c > >> index 00588b9db474..31faf2bb49ff 100644 > >> --- a/tools/perf/util/parse-branch-options.c > >> +++ b/tools/perf/util/parse-branch-options.c > >> @@ -102,8 +102,10 @@ parse_branch_stack(const struct option *opt, const char *str, int unset) > >> /* > >> * cannot set it twice, -b + --branch-filter for instance > >> */ > >> - if (*mode) > >> + if (*mode) { > >> + pr_err("Error: Can't use --branch-any (-b) with --branch-filter (-j).\n"); > >> return -1; > >> + } > >> > >> return parse_branch_str(str, mode); > >> } -- - Arnaldo