Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1578593rwr; Fri, 5 May 2023 17:00:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60BYbiURZPzLgqhUGPcNm1KkaBl6x9CYJNK56m0oSMmuCPoyxI1Ypq+KIXB9LXR2dL96WW X-Received: by 2002:a05:6a20:9148:b0:f0:a283:4854 with SMTP id x8-20020a056a20914800b000f0a2834854mr3899700pzc.13.1683331205936; Fri, 05 May 2023 17:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683331205; cv=none; d=google.com; s=arc-20160816; b=zvQaDWInHrjF7KBYd89OcWbDqrirdryidaYiiDELN7jEVTDfUIkxrbNxhLWMwB/5dH q+c6TbxtHow2GX+YhGJSB83gKbcrK1nRqgRp9TJi0zVqXib2BpxbBFaTz6Gxcs++xRO3 rCujYpfX9JmDT1reZm7siZ9/UJLHO56E3PdqgTyAUQZVWBFIGwEcbuLLVOoJP0llUF9y OcqnaMtghKnWSN6MyZcS7c9slXT/JvaQpTtPE/hV2S1gIj86GOv8VjW+GuwyQzqgXyFt /bp17VFPxGNVHU8HaUT9v0eUMbn7N+W9Fq2E3ygQkxnrtbNdughlQitAD1eWulA39Y6p rd6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=rzCAksvS+losKg+7MKztwUpEzi0wXJ48Pd67HAezFTg=; b=MUqztrM3PSIQavp5doYxrwSTdaHCByl1XdJXqJmkUjRGaMiXOa6tZ6RmqyPbXuGVj9 lg4wzdT6ZOfQESIhwAf16AAsEX6r5anAsUjb+2EsB+4Is9cgv2iLsE3sriSoYTU1dfDi QVofBl6vYKNOvDXwJcEZ7UZ7nftaygRkVX5cgrsTg9IZYRskNmLP6HuILvhaX4jFWUfS jZ/PaKX8EaBfSpVYp8jigdlTGOwojTYZJWJKsLwQj29Ubtm0o9c+mbwWSwSYDesEcVHW BX9dP1NRiZoXI+dgJ1eVftOWwklhCA3rMbrBfErTvTxPFomVKyPyr6UHkxfddvQ+QRZ4 x8cA== 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=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 g24-20020a633758000000b0052c842e5185si3166757pgn.96.2023.05.05.16.59.53; Fri, 05 May 2023 17:00:05 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232785AbjEEXoH convert rfc822-to-8bit (ORCPT + 99 others); Fri, 5 May 2023 19:44:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbjEEXoF (ORCPT ); Fri, 5 May 2023 19:44:05 -0400 Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA5585FE0; Fri, 5 May 2023 16:44:03 -0700 (PDT) Received: by mail-yb1-f182.google.com with SMTP id 3f1490d57ef6-b9a6f17f2b6so16535570276.1; Fri, 05 May 2023 16:44:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683330243; x=1685922243; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0VWVwxZIs17EWQgN1pMsqtqITHwPVpRT/J8MlrKIuf0=; b=C2MUZgswslksx+JUOU1qPojPDLZMWut1Kkg0eQCooDH5b2YNyEpUBUda4UDAzkBSBq ZdNttltoCOZ4pq3Iyv9erC0ipGaJ8d+9kY8AzbclJgjM+DM5jerVzYGAyd0HydFHrcWJ 3Wk0EiytStcGohcv5bs/SxCYBuj9QyWxJFkcQNNqwKityZ6KQEkbp6jBv1bu9jPkaHkL fQaApvZGR+Z27ICj464baUERG/SGkkaYzwtpE/HRNz9jgLeGHAXtMliF/IE9Uzxx4seL eo0gHHkikiQBCbHMaT8rUSUEaEU1oXuhSieYAo0PlekonPoVTaQMnweHPFGDgXt8Y4OU +H+A== X-Gm-Message-State: AC+VfDzbpiqv3tTWWhtogazfgklKCemcVJY+olWzamZKV22ljg7h2NMj Io0f42jVZijgIqHsg1WAk46yKoZ03u676yAzLOM= X-Received: by 2002:a25:4f57:0:b0:b9e:2ef0:de90 with SMTP id d84-20020a254f57000000b00b9e2ef0de90mr5369318ybb.17.1683330242744; Fri, 05 May 2023 16:44:02 -0700 (PDT) MIME-Version: 1.0 References: <83d6c6c05c54bf00c5a9df32ac160718efca0c7a.1683280603.git.sandipan.das@amd.com> <6a5429879764e3dac984cbb11ee2d95cc1604161.1683280603.git.sandipan.das@amd.com> In-Reply-To: <6a5429879764e3dac984cbb11ee2d95cc1604161.1683280603.git.sandipan.das@amd.com> From: Namhyung Kim Date: Fri, 5 May 2023 16:43:51 -0700 Message-ID: Subject: Re: [PATCH 2/2] perf test: Add stat test for record and script To: Sandipan Das Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, acme@kernel.org, peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, terrelln@fb.com, ravi.bangoria@amd.com, ananth.narayan@amd.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, May 5, 2023 at 3:03 AM Sandipan Das wrote: > > When using the global aggregation mode, running perf script after perf > stat record can result in a segmentation fault as seen with commit > 8b76a3188b85 ("perf stat: Remove unused perf_counts.aggr field"). Add a > basic test to the existing suite of stat-related tests for checking if > that workflow runs without erroring out. > > Signed-off-by: Sandipan Das Acked-by: Namhyung Kim Thanks, Namhyung > --- > tools/perf/tests/shell/stat.sh | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/tools/perf/tests/shell/stat.sh b/tools/perf/tests/shell/stat.sh > index 2c1d3f704995..b154fbb15d54 100755 > --- a/tools/perf/tests/shell/stat.sh > +++ b/tools/perf/tests/shell/stat.sh > @@ -28,6 +28,18 @@ test_stat_record_report() { > echo "stat record and report test [Success]" > } > > +test_stat_record_script() { > + echo "stat record and script test" > + if ! perf stat record -o - true | perf script -i - 2>&1 | \ > + grep -E -q "CPU[[:space:]]+THREAD[[:space:]]+VAL[[:space:]]+ENA[[:space:]]+RUN[[:space:]]+TIME[[:space:]]+EVENT" > + then > + echo "stat record and script test [Failed]" > + err=1 > + return > + fi > + echo "stat record and script test [Success]" > +} > + > test_stat_repeat_weak_groups() { > echo "stat repeat weak groups test" > if ! perf stat -e '{cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles}' \ > @@ -93,6 +105,7 @@ test_topdown_weak_groups() { > > test_default_stat > test_stat_record_report > +test_stat_record_script > test_stat_repeat_weak_groups > test_topdown_groups > test_topdown_weak_groups > -- > 2.34.1 >