Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp353985imn; Thu, 28 Jul 2022 02:46:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s0E1iwi3tUHZnt/MPET3Gh4fxM1Imhquh+XzzMHM0mFjCz62a73n0ob4ua9cxD9GvWX0S9 X-Received: by 2002:a17:907:8687:b0:72e:e524:1803 with SMTP id qa7-20020a170907868700b0072ee5241803mr20098391ejc.411.1659001586863; Thu, 28 Jul 2022 02:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659001586; cv=none; d=google.com; s=arc-20160816; b=OxT5rqFhlHmWA0gi29o/XGl6HTbMT0SMW8OJ77p64cp3G+HTNUuFDUcY3kGw/ixE8a Zx28iGdGA2pKqHieVEcOO4dd4JzapjI2Lm7JYaJusH3zm9TyWTg+9GS/jYLuayqsDA3M QCcrQER+4C3mAUd/aTWPnUnNaCPRyUDNJIFo7x4nIa5/O8V4T42mtAFLucjMCGeAuRkD E1q0BgoFqDI36lK35e8dTUOkQf8hGsQ7vgj+VTHbllCCVmuD6GDeTTP5tmZCtVi6pbJN oENCqJQapwtb2jZKDAADfb7JGRN2oeOv6E4hQoAZaRhJxzmyy3s9bIvKJnYfyr4qTGAt nNLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=NnZxtJQGEbfr07Q64xZCrIg5VhETZgvhegHySm66YF4=; b=B6NaV6rHK5w4PnauFr7ICT40gb+XF990kYcVdKH2dE5GfnU4+P0ORc5fV/T4c2Ywch AfEer4y1+PqdB7Gfquv0ncyNmHSOQmChmSeGptC0lM5pxzFNdrAd7jQjfIwMzOjZ7YhA 8NrchUJP1Z0zwGWL0aNenrt/k+K7BTZJwAxN64Td+1e8g8hj0topdT0WZv5irnzYp/Ea nj8uR5Ys7qEZMygccxMvd1sKxS9CATHXFvgczbfxq6dcvcjOrPi7VLQKFDbzWud59i54 PJOv2CslSVGPbEo5v1+BueYh0+vJIztBWV+oFPmaY4I03TjkDz0r5QEA+yIxoBk3LaHI khZw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he11-20020a1709073d8b00b0072ee57126e9si400900ejc.166.2022.07.28.02.46.02; Thu, 28 Jul 2022 02:46:26 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231260AbiG1JZ2 (ORCPT + 99 others); Thu, 28 Jul 2022 05:25:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234702AbiG1JZ1 (ORCPT ); Thu, 28 Jul 2022 05:25:27 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C29EA2AE4; Thu, 28 Jul 2022 02:25:25 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E5654106F; Thu, 28 Jul 2022 02:25:25 -0700 (PDT) Received: from [10.1.31.137] (e127744.cambridge.arm.com [10.1.31.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 408FA3F73B; Thu, 28 Jul 2022 02:25:23 -0700 (PDT) Subject: Re: [PATCH] perf/tests: Fix test case 95 on s390 and use same event To: Thomas Richter , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, james.clark@arm.com Cc: svens@linux.ibm.com, gor@linux.ibm.com, sumanthk@linux.ibm.com, hca@linux.ibm.com, Namhyung Kim , Jiri Olsa References: <20220727141439.712582-1-tmricht@linux.ibm.com> From: German Gomez Message-ID: <3dc28d5e-46ce-fd33-82c1-4e27b60dfef0@arm.com> Date: Thu, 28 Jul 2022 10:25:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20220727141439.712582-1-tmricht@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE 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 Thanks for the fix, Thomas On 27/07/2022 15:14, Thomas Richter wrote: > On linux-next tree perf test 95 was added recently. > s390 does not support branch sampling at all and the test case fails > despite for checking branch support before hand. > The check for support of branching > uses the software event named dummy, as seen in the line: > > perf record -b -o- -e dummy -B true > /dev/null 2>&1 || exit 2 Just curious, do you know why the command succeeds in this platform (and potentially others)? I got the idea of using "dummy" from [1] but only tested on arm64 and x86. I thought the platforms would reject it if -b was not implemented regardless of the event. Did I misunderstand the use of dummy? Thanks, German [1] https://lore.kernel.org/all/20220617073840.GA45710@leoy-ThinkPad-X240s/ > > However when the branch recording is actually done, a different > event is used, as seen in the line: > > perf record -o $TMPDIR/... --branch-filter any,save_type,u -- ... > > The event is omitted and for perf record the default event is > cycles, which is not supported by s390 and this fails when executed > on s390: > > # perf record --branch-filter any,save_type,u -- \ > /tmp/__perf_test.program.iDSmQ/a.out > Error: > cycles: PMU Hardware or event type doesn't support branch stack sampling. > # > > Therefore fix this and use the same event cycles for testing support > and actually running the test. > > Output before: > # ./perf test -Fv 95 > 95: Check branch stack sampling : > --- start --- > Testing user branch stack sampling > ---- end ---- > Check branch stack sampling: FAILED! > # > > Output after: > # ./perf test -Fv 95 > 95: Check branch stack sampling : > --- start --- > ---- end ---- > Check branch stack sampling: Skip > # > > Fixes: b55878c90ab9 ("perf test: Add test for branch stack sampling") > Signed-off-by: Thomas Richter > --- > tools/perf/tests/shell/test_brstack.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/tests/shell/test_brstack.sh b/tools/perf/tests/shell/test_brstack.sh > index 113ccd17bf03..c644f94a6500 100755 > --- a/tools/perf/tests/shell/test_brstack.sh > +++ b/tools/perf/tests/shell/test_brstack.sh > @@ -12,7 +12,7 @@ if ! [ -x "$(command -v cc)" ]; then > fi > > # skip the test if the hardware doesn't support branch stack sampling > -perf record -b -o- -e dummy -B true > /dev/null 2>&1 || exit 2 > +perf record -b -o- -B true > /dev/null 2>&1 || exit 2 > > TMPDIR=$(mktemp -d /tmp/__perf_test.program.XXXXX) >