Message ID | 20221130111521.334152-2-james.clark@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp863328wrr; Wed, 30 Nov 2022 03:19:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf7nm6YKczalPGkQr01NjQYpZhRR/bW+hJ1Kwjk/LkluCrm1sQghuLF8Q35S6W04o5E8N4CU X-Received: by 2002:a17:907:a803:b0:7ae:bfeb:f484 with SMTP id vo3-20020a170907a80300b007aebfebf484mr28642427ejc.174.1669807192720; Wed, 30 Nov 2022 03:19:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669807192; cv=none; d=google.com; s=arc-20160816; b=oHUprhc00fMZq04REvkO1ovGevY9Bi8VvmT22QGIGHF1/4b7NL+UmItQ0jVn2xEJbb 712UtnNbxxi6uN2CCI6fn66aB/Qum2/Jxx0Z+KkJJ3m4g27D2mHPShkceDWIOTn5yLBZ wHIuB68HWV1/SxM7S0PTvM6LJ3JFx2Poximf+Aux9nAdaQkBkOAtmf7FGkpLgEXtBcoE 6qDlgyGaaoU1GnjR6xGXyQzyqNt/qdRYOkBPJUdyeM8jEQwKEi7qgOv9xldARec5Mk18 UYlWvZEcSrwsgevtEf4aTpO23P9xnbg+dFstRXqaA0BJ5/mZpZaO4bTypALqaG6LAQQW PoSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JvypBLClmMaOEIo9JKaoxD2KCu08R+d0I3iBqRu5enw=; b=ZbiBULOfIPI3jlo2+qPq4utI6++jiGVON9Dq51HfdbbxyDCCYu0gNzFx2A5iIrI9Pm 3tG0bKrXycBjuXo1+VrtOIg2M6MOw9a/Syqk5OZ1zwnwxobDWHz7JhxZx1eFI4BLwBkm bTaZouH4ruiC2MkFOAeVQqGizr1a4rO43G+B5n1aKPWJV976+RhIv7M3MGCjW0bxpzfY hfFU+ixS/kjulpeWMjtrs3b8Qo9rY14nN+7uFbwkWF7eXfoplfZqhBasXhgYqc+Sog7b wdHMOINRBT2NCWTgr3OUWkAMvPPqyyLEq5F9IgHot3ajio6XT99nVWJvNxd6U3Ea+HjG FvjQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n24-20020a056402515800b004634dd8b6edsi975179edd.296.2022.11.30.03.19.29; Wed, 30 Nov 2022 03:19:52 -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; 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 S234034AbiK3LPy (ORCPT <rfc822;heyuhang3455@gmail.com> + 99 others); Wed, 30 Nov 2022 06:15:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233889AbiK3LPh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 30 Nov 2022 06:15:37 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 959EE2791F; Wed, 30 Nov 2022 03:15:36 -0800 (PST) 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 F1F8B1042; Wed, 30 Nov 2022 03:15:42 -0800 (PST) Received: from e126815.warwick.arm.com (e126815.arm.com [10.32.32.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BC2B83F73B; Wed, 30 Nov 2022 03:15:34 -0800 (PST) From: James Clark <james.clark@arm.com> To: linux-perf-users@vger.kernel.org, acme@kernel.org, namhyung@kernel.org Cc: linux-kernel@vger.kernel.org, James Clark <james.clark@arm.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com> Subject: [PATCH 2/2] perf stat: Fix invalid output handle Date: Wed, 30 Nov 2022 11:15:21 +0000 Message-Id: <20221130111521.334152-2-james.clark@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221130111521.334152-1-james.clark@arm.com> References: <20221130111521.334152-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750919747148990281?= X-GMAIL-MSGID: =?utf-8?q?1750919747148990281?= |
Series |
[1/2] perf tests: Fix "perf stat JSON output linter" test for new output
|
|
Commit Message
James Clark
Nov. 30, 2022, 11:15 a.m. UTC
In this context, 'os' is already a pointer so the extra dereference
isn't required. This fixes the following test failure on aarch64:
$ ./perf test "json output" -vvv
92: perf stat JSON output linter :
--- start ---
Checking json output: no args Test failed for input:
...
Fatal error: glibc detected an invalid stdio handle
---- end ----
perf stat JSON output linter: FAILED!
Fixes: e7f4da312259 ("perf stat: Pass struct outstate to printout()")
Signed-off-by: James Clark <james.clark@arm.com>
---
tools/perf/util/stat-display.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Nov 30, 2022 at 3:15 AM James Clark <james.clark@arm.com> wrote: > > In this context, 'os' is already a pointer so the extra dereference > isn't required. This fixes the following test failure on aarch64: > > $ ./perf test "json output" -vvv > 92: perf stat JSON output linter : > --- start --- > Checking json output: no args Test failed for input: > ... > Fatal error: glibc detected an invalid stdio handle > ---- end ---- > perf stat JSON output linter: FAILED! > > Fixes: e7f4da312259 ("perf stat: Pass struct outstate to printout()") > Signed-off-by: James Clark <james.clark@arm.com> Thanks for fixing this. I'm not sure how I missed it.. :( Acked-by: Namhyung Kim <namhyung@kernel.org> Thanks, Namhyung > --- > tools/perf/util/stat-display.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c > index 847acdb5dc40..eac5ac3a734c 100644 > --- a/tools/perf/util/stat-display.c > +++ b/tools/perf/util/stat-display.c > @@ -741,7 +741,7 @@ static void printout(struct perf_stat_config *config, struct outstate *os, > perf_stat__print_shadow_stats(config, counter, uval, map_idx, > &out, &config->metric_events, &rt_stat); > } else { > - pm(config, &os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); > + pm(config, os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); > } > > if (!config->metric_only) { > -- > 2.25.1 >
On 30/11/2022 18:32, Namhyung Kim wrote: > On Wed, Nov 30, 2022 at 3:15 AM James Clark <james.clark@arm.com> wrote: >> >> In this context, 'os' is already a pointer so the extra dereference >> isn't required. This fixes the following test failure on aarch64: >> >> $ ./perf test "json output" -vvv >> 92: perf stat JSON output linter : >> --- start --- >> Checking json output: no args Test failed for input: >> ... >> Fatal error: glibc detected an invalid stdio handle >> ---- end ---- >> perf stat JSON output linter: FAILED! >> >> Fixes: e7f4da312259 ("perf stat: Pass struct outstate to printout()") >> Signed-off-by: James Clark <james.clark@arm.com> > > Thanks for fixing this. I'm not sure how I missed it.. :( > It seems to only go down that path on some configuration. At least on x86 the test was passing fine for me. > Acked-by: Namhyung Kim <namhyung@kernel.org> Thanks for the review! > > Thanks, > Namhyung > > >> --- >> tools/perf/util/stat-display.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c >> index 847acdb5dc40..eac5ac3a734c 100644 >> --- a/tools/perf/util/stat-display.c >> +++ b/tools/perf/util/stat-display.c >> @@ -741,7 +741,7 @@ static void printout(struct perf_stat_config *config, struct outstate *os, >> perf_stat__print_shadow_stats(config, counter, uval, map_idx, >> &out, &config->metric_events, &rt_stat); >> } else { >> - pm(config, &os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); >> + pm(config, os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); >> } >> >> if (!config->metric_only) { >> -- >> 2.25.1 >>
> On 01-Dec-2022, at 3:36 PM, James Clark <james.clark@arm.com> wrote: > > > > On 30/11/2022 18:32, Namhyung Kim wrote: >> On Wed, Nov 30, 2022 at 3:15 AM James Clark <james.clark@arm.com> wrote: >>> >>> In this context, 'os' is already a pointer so the extra dereference >>> isn't required. This fixes the following test failure on aarch64: >>> >>> $ ./perf test "json output" -vvv >>> 92: perf stat JSON output linter : >>> --- start --- >>> Checking json output: no args Test failed for input: >>> ... >>> Fatal error: glibc detected an invalid stdio handle >>> ---- end ---- >>> perf stat JSON output linter: FAILED! >>> >>> Fixes: e7f4da312259 ("perf stat: Pass struct outstate to printout()") >>> Signed-off-by: James Clark <james.clark@arm.com> >> >> Thanks for fixing this. I'm not sure how I missed it.. :( >> > > It seems to only go down that path on some configuration. At least on > x86 the test was passing fine for me. > >> Acked-by: Namhyung Kim <namhyung@kernel.org> > > Thanks for the review! Faced same issue on powerpc. Tested with this change and it works with this patch. Tested-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Thanks Athira > >> >> Thanks, >> Namhyung >> >> >>> --- >>> tools/perf/util/stat-display.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c >>> index 847acdb5dc40..eac5ac3a734c 100644 >>> --- a/tools/perf/util/stat-display.c >>> +++ b/tools/perf/util/stat-display.c >>> @@ -741,7 +741,7 @@ static void printout(struct perf_stat_config *config, struct outstate *os, >>> perf_stat__print_shadow_stats(config, counter, uval, map_idx, >>> &out, &config->metric_events, &rt_stat); >>> } else { >>> - pm(config, &os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); >>> + pm(config, os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); >>> } >>> >>> if (!config->metric_only) { >>> -- >>> 2.25.1
Em Sun, Dec 04, 2022 at 10:38:28PM +0530, Athira Rajeev escreveu: > > > > On 01-Dec-2022, at 3:36 PM, James Clark <james.clark@arm.com> wrote: > > > > > > > > On 30/11/2022 18:32, Namhyung Kim wrote: > >> On Wed, Nov 30, 2022 at 3:15 AM James Clark <james.clark@arm.com> wrote: > >>> > >>> In this context, 'os' is already a pointer so the extra dereference > >>> isn't required. This fixes the following test failure on aarch64: > >>> > >>> $ ./perf test "json output" -vvv > >>> 92: perf stat JSON output linter : > >>> --- start --- > >>> Checking json output: no args Test failed for input: > >>> ... > >>> Fatal error: glibc detected an invalid stdio handle > >>> ---- end ---- > >>> perf stat JSON output linter: FAILED! > >>> > >>> Fixes: e7f4da312259 ("perf stat: Pass struct outstate to printout()") > >>> Signed-off-by: James Clark <james.clark@arm.com> > >> > >> Thanks for fixing this. I'm not sure how I missed it.. :( > >> > > > > It seems to only go down that path on some configuration. At least on > > x86 the test was passing fine for me. > > > >> Acked-by: Namhyung Kim <namhyung@kernel.org> > > > > Thanks for the review! > > Faced same issue on powerpc. Tested with this change and it works with this patch. > > Tested-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Thanks, applied. - Arnaldo
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 847acdb5dc40..eac5ac3a734c 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -741,7 +741,7 @@ static void printout(struct perf_stat_config *config, struct outstate *os, perf_stat__print_shadow_stats(config, counter, uval, map_idx, &out, &config->metric_events, &rt_stat); } else { - pm(config, &os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); + pm(config, os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); } if (!config->metric_only) {