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 X-Spam-Level: X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7988BC2B9F4 for ; Tue, 22 Jun 2021 18:06:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54DE3611CE for ; Tue, 22 Jun 2021 18:06:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232730AbhFVSIa (ORCPT ); Tue, 22 Jun 2021 14:08:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:58892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232649AbhFVSHc (ORCPT ); Tue, 22 Jun 2021 14:07:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D9CE361002; Tue, 22 Jun 2021 18:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624385116; bh=M7SN4cyE6lxKrJXsUW54uqcvWeAJ7zpSgHeOVCwz/Dw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BJ8F5u1A/4DRyluQ5RnCIPhyE4eD+Ny8LaEoU+VcF/RnOrbi21oZcfq7LFHpGkA7Z seOKSs784LpdxoBPlLJ06k17CzwZgFX9vYq+YE/bgiRqJ24Fc5+dR3AcTjQaatavls Yye33XMvlCGyekm+4DuEaU5a0vg3sS50ztoJzAdzi1t/CjJVqD6BY7nUfKCKToW94n 4Ib+YZnGfV9UgkEj09A9riDH/lSqsZduFBQ0wLpslcG1JIdlv7OYtl8Qj3sDUYZlbZ VOPO7w4ytBwVW+34dZYJhPx4aEKG3dTdjPEzQoyEewKDwe3kbtD8d1e2SnHTcCFu8i ObmctWPVIOWMg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id CE9B440B1A; Tue, 22 Jun 2021 15:05:12 -0300 (-03) Date: Tue, 22 Jun 2021 15:05:12 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Song Liu , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH v2 3/3] perf test: Make stat bpf counters test more robust Message-ID: References: <20210621215648.2991319-1-irogers@google.com> <20210621215648.2991319-3-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210621215648.2991319-3-irogers@google.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Jun 21, 2021 at 02:56:48PM -0700, Ian Rogers escreveu: > If the test is run on a hypervisor then the cycles event may not be > counted, skip the test in this situation. Fail the test if cycles are > not counted in the subsequent bpf counter run. This one was already in, - Arnaldo > Signed-off-by: Ian Rogers > --- > tools/perf/tests/shell/stat_bpf_counters.sh | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/tools/perf/tests/shell/stat_bpf_counters.sh b/tools/perf/tests/shell/stat_bpf_counters.sh > index 85eb689fe202..6b156dd85469 100755 > --- a/tools/perf/tests/shell/stat_bpf_counters.sh > +++ b/tools/perf/tests/shell/stat_bpf_counters.sh > @@ -31,7 +31,15 @@ if ! perf stat --bpf-counters true > /dev/null 2>&1; then > fi > > base_cycles=$(perf stat --no-big-num -e cycles -- perf bench sched messaging -g 1 -l 100 -t 2>&1 | awk '/cycles/ {print $1}') > +if [ "$base_cycles" == " + echo "Skipping: cycles event not counted" > + exit 2 > +fi > bpf_cycles=$(perf stat --no-big-num --bpf-counters -e cycles -- perf bench sched messaging -g 1 -l 100 -t 2>&1 | awk '/cycles/ {print $1}') > +if [ "$bpf_cycles" == " + echo "Failed: cycles not counted with --bpf-counters" > + exit 1 > +fi > > compare_number $base_cycles $bpf_cycles > exit 0 > -- > 2.32.0.288.g62a8d224e6-goog > -- - Arnaldo