Message ID | 20221130111521.334152-1-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 q4csp863323wrr; Wed, 30 Nov 2022 03:19:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf6PxBpXgaPOfMnl/EsCCIboYpZVp5oagX2hb0KoNhcQJsuviUzAmdXm7SweABCkS1TrbhOh X-Received: by 2002:a17:907:3117:b0:7ae:6746:f26b with SMTP id wl23-20020a170907311700b007ae6746f26bmr51353682ejb.171.1669807191931; Wed, 30 Nov 2022 03:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669807191; cv=none; d=google.com; s=arc-20160816; b=BwcUCHNI/HSSMD1JdR9OMuSufN4xR9sEYHwNGewwfydga+EsbzPhCZiP41GRS70grz Kt/M3lPqKLkWJw8KouqOqcifwvgP5jG9blai+Lfwu0nFJH/dFWISZCNVPtZYJLEbP8Sl GdGoB1vTKAKOaRmsjmq6jLXVpxM/QZQJMahJlPhns4AHk3T6huGPbjLHyTwbGFgTY4j3 kJVwRttqRwpyHdJ0ycsN9lFP5xNbSteoYggmqbv+gEYcOFiYdf2OKZtWYVGhFRnO3qdU VU8bmUSlCox9sKCqo0Ha1pQhK/wA+RSU89bedFC2jdKBhnlTOa5wDS3WrJinkHxtOpTh IsVQ== 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 :message-id:date:subject:cc:to:from; bh=a2jaoCRYG4lTKMaH+G2qK7aruieHoAC6MgYw4LJHBv0=; b=MMLZwZWQ4gM6psa4X228vc15t/0QLgfqQpP3xVmzmzXQ05pBmJkPM+fLJTqJu2xA+Q 2QbRGInUSBSTnOXv0gq0uMp+wGqCFjjU4i5aaHpWjMMj27F4ONIuGD4WUGAOtR0FiTx4 Nw1Zkex8zwBI0zxT9eZgS6a/ARNvsFfcZsr/VZagI9W2KZxCFiSHuYCvpb9iralwK72c Kr/QnoUqvFXQfHrr5XubPIBPLy4iinkFJkOqwTrmCH4Q+E65DGPTkkj9XLV+cRDIbF0f TO69omSYrisZ9OTu69CQSS7CKe8gmRnL8Lx2nmmbhO1Vi3ja67gmuYgdi3H1UM7xwBib LP5g== 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 sc14-20020a1709078a0e00b007c0905bab0asi1100366ejc.311.2022.11.30.03.19.28; Wed, 30 Nov 2022 03:19:51 -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 S234045AbiK3LPr (ORCPT <rfc822;heyuhang3455@gmail.com> + 99 others); Wed, 30 Nov 2022 06:15:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231577AbiK3LPf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 30 Nov 2022 06:15:35 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D86DB2791F; Wed, 30 Nov 2022 03:15:34 -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 D1480D6E; Wed, 30 Nov 2022 03:15:40 -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 9FF2E3F73B; Wed, 30 Nov 2022 03:15:32 -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 1/2] perf tests: Fix "perf stat JSON output linter" test for new output Date: Wed, 30 Nov 2022 11:15:20 +0000 Message-Id: <20221130111521.334152-1-james.clark@arm.com> X-Mailer: git-send-email 2.25.1 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?1750919746224045940?= X-GMAIL-MSGID: =?utf-8?q?1750919746224045940?= |
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
Commit c4b41b83c250 ("perf stat: Rename "aggregate-number" to
"cpu-count" in JSON") renamed a field, so update the tests to reflect
this.
This fixes the following failure:
$ sudo ./perf test "json output" -vvv
96: perf stat JSON output linter :
--- start ---
test child forked, pid 327720
Checking json output: no args [Success]
Checking json output: system wide [Success]
Checking json output: interval [Success]
Checking json output: event [Success]
Checking json output: per thread [Success]
Checking json output: per node Test failed for input:
...
Traceback (most recent call last):
File "./tools/perf/tests/shell/lib/perf_json_output_lint.py", line 93, in <module>
check_json_output(expected_items)
File "./tools/perf/tests/shell/lib/perf_json_output_lint.py", line 78, in check_json_output
raise RuntimeError(f'Unexpected key: key={key} value={value}')
RuntimeError: Unexpected key: key=cpu-count value=16
test child finished with -1
---- end ----
perf stat JSON output linter: FAILED!
Fixes: c4b41b83c250 ("perf stat: Rename "aggregate-number" to "cpu-count" in JSON")
Signed-off-by: James Clark <james.clark@arm.com>
---
tools/perf/tests/shell/lib/perf_json_output_lint.py | 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: > > Commit c4b41b83c250 ("perf stat: Rename "aggregate-number" to > "cpu-count" in JSON") renamed a field, so update the tests to reflect > this. > > This fixes the following failure: > > $ sudo ./perf test "json output" -vvv > 96: perf stat JSON output linter : > --- start --- > test child forked, pid 327720 > Checking json output: no args [Success] > Checking json output: system wide [Success] > Checking json output: interval [Success] > Checking json output: event [Success] > Checking json output: per thread [Success] > Checking json output: per node Test failed for input: > ... > Traceback (most recent call last): > File "./tools/perf/tests/shell/lib/perf_json_output_lint.py", line 93, in <module> > check_json_output(expected_items) > File "./tools/perf/tests/shell/lib/perf_json_output_lint.py", line 78, in check_json_output > raise RuntimeError(f'Unexpected key: key={key} value={value}') > RuntimeError: Unexpected key: key=cpu-count value=16 > test child finished with -1 > ---- end ---- > perf stat JSON output linter: FAILED! > > Fixes: c4b41b83c250 ("perf stat: Rename "aggregate-number" to "cpu-count" in JSON") > Signed-off-by: James Clark <james.clark@arm.com> Namhyung mentioned reverting change c4b41b83c250, in which case merging this would break the test again. I think the revert is better. Thanks, Ian > --- > tools/perf/tests/shell/lib/perf_json_output_lint.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/tests/shell/lib/perf_json_output_lint.py b/tools/perf/tests/shell/lib/perf_json_output_lint.py > index d90f8d102eb9..9c073e257d33 100644 > --- a/tools/perf/tests/shell/lib/perf_json_output_lint.py > +++ b/tools/perf/tests/shell/lib/perf_json_output_lint.py > @@ -54,7 +54,7 @@ def check_json_output(expected_items): > raise RuntimeError(f'wrong number of fields. counted {count} expected {expected_items}' > f' in \'{line}\'') > checks = { > - 'aggregate-number': lambda x: isfloat(x), > + 'cpu-count': lambda x: isfloat(x), > 'core': lambda x: True, > 'counter-value': lambda x: is_counter_value(x), > 'cgroup': lambda x: True, > -- > 2.25.1 >
Hi, On Wed, Nov 30, 2022 at 10:19 AM Ian Rogers <irogers@google.com> wrote: > > On Wed, Nov 30, 2022 at 3:15 AM James Clark <james.clark@arm.com> wrote: > > > > Commit c4b41b83c250 ("perf stat: Rename "aggregate-number" to > > "cpu-count" in JSON") renamed a field, so update the tests to reflect > > this. > > > > This fixes the following failure: > > > > $ sudo ./perf test "json output" -vvv > > 96: perf stat JSON output linter : > > --- start --- > > test child forked, pid 327720 > > Checking json output: no args [Success] > > Checking json output: system wide [Success] > > Checking json output: interval [Success] > > Checking json output: event [Success] > > Checking json output: per thread [Success] > > Checking json output: per node Test failed for input: > > ... > > Traceback (most recent call last): > > File "./tools/perf/tests/shell/lib/perf_json_output_lint.py", line 93, in <module> > > check_json_output(expected_items) > > File "./tools/perf/tests/shell/lib/perf_json_output_lint.py", line 78, in check_json_output > > raise RuntimeError(f'Unexpected key: key={key} value={value}') > > RuntimeError: Unexpected key: key=cpu-count value=16 > > test child finished with -1 > > ---- end ---- > > perf stat JSON output linter: FAILED! > > > > Fixes: c4b41b83c250 ("perf stat: Rename "aggregate-number" to "cpu-count" in JSON") > > Signed-off-by: James Clark <james.clark@arm.com> > > Namhyung mentioned reverting change c4b41b83c250, in which case > merging this would break the test again. I think the revert is better. Yep, I will send the revert soon. Thanks, Namhyung
Em Wed, Nov 30, 2022 at 10:18:49AM -0800, Ian Rogers escreveu: > On Wed, Nov 30, 2022 at 3:15 AM James Clark <james.clark@arm.com> wrote: > > > > Commit c4b41b83c250 ("perf stat: Rename "aggregate-number" to > > "cpu-count" in JSON") renamed a field, so update the tests to reflect > > this. > > > > This fixes the following failure: > > > > $ sudo ./perf test "json output" -vvv > > 96: perf stat JSON output linter : > > --- start --- > > test child forked, pid 327720 > > Checking json output: no args [Success] > > Checking json output: system wide [Success] > > Checking json output: interval [Success] > > Checking json output: event [Success] > > Checking json output: per thread [Success] > > Checking json output: per node Test failed for input: > > ... > > Traceback (most recent call last): > > File "./tools/perf/tests/shell/lib/perf_json_output_lint.py", line 93, in <module> > > check_json_output(expected_items) > > File "./tools/perf/tests/shell/lib/perf_json_output_lint.py", line 78, in check_json_output > > raise RuntimeError(f'Unexpected key: key={key} value={value}') > > RuntimeError: Unexpected key: key=cpu-count value=16 > > test child finished with -1 > > ---- end ---- > > perf stat JSON output linter: FAILED! > > > > Fixes: c4b41b83c250 ("perf stat: Rename "aggregate-number" to "cpu-count" in JSON") > > Signed-off-by: James Clark <james.clark@arm.com> > > Namhyung mentioned reverting change c4b41b83c250, in which case > merging this would break the test again. I think the revert is better. Applied the revert, with an Acked-by: you. > Thanks, > Ian > > > --- > > tools/perf/tests/shell/lib/perf_json_output_lint.py | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/tests/shell/lib/perf_json_output_lint.py b/tools/perf/tests/shell/lib/perf_json_output_lint.py > > index d90f8d102eb9..9c073e257d33 100644 > > --- a/tools/perf/tests/shell/lib/perf_json_output_lint.py > > +++ b/tools/perf/tests/shell/lib/perf_json_output_lint.py > > @@ -54,7 +54,7 @@ def check_json_output(expected_items): > > raise RuntimeError(f'wrong number of fields. counted {count} expected {expected_items}' > > f' in \'{line}\'') > > checks = { > > - 'aggregate-number': lambda x: isfloat(x), > > + 'cpu-count': lambda x: isfloat(x), > > 'core': lambda x: True, > > 'counter-value': lambda x: is_counter_value(x), > > 'cgroup': lambda x: True, > > -- > > 2.25.1 > >
diff --git a/tools/perf/tests/shell/lib/perf_json_output_lint.py b/tools/perf/tests/shell/lib/perf_json_output_lint.py index d90f8d102eb9..9c073e257d33 100644 --- a/tools/perf/tests/shell/lib/perf_json_output_lint.py +++ b/tools/perf/tests/shell/lib/perf_json_output_lint.py @@ -54,7 +54,7 @@ def check_json_output(expected_items): raise RuntimeError(f'wrong number of fields. counted {count} expected {expected_items}' f' in \'{line}\'') checks = { - 'aggregate-number': lambda x: isfloat(x), + 'cpu-count': lambda x: isfloat(x), 'core': lambda x: True, 'counter-value': lambda x: is_counter_value(x), 'cgroup': lambda x: True,