Message ID | 20230524210600.3095830-1-namhyung@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp184985vqr; Wed, 24 May 2023 14:13:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ77uSAP5COF++2xbsUm8xwPsgOeP8cFh5K9oiKSQ1C8Keq2oCiMRi5iGgUb/9T0lNBo6OIB X-Received: by 2002:a05:6a20:8e22:b0:10e:ed51:a552 with SMTP id y34-20020a056a208e2200b0010eed51a552mr507254pzj.59.1684962821974; Wed, 24 May 2023 14:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684962821; cv=none; d=google.com; s=arc-20160816; b=VhWzcQp4JP0oeeNdwiVq0i8aRFC1vp21q0hOZXWB2Go2w+XHs23FXop1w4rDJAPqD1 sMSkhRcJEP21X9vlerJpb9k/O6+SW8cZ83UskT/r+WK9MVPFTX4z+VKizAsiVsgjFsXR whBBQ+b5vst4629QGHhLvlEJb5EOHw+RTm8zP4ASJfZLYllFRAEH9lL8PAOBJgk2mjvo fGujVL7jKleDeqn7varKBQDqIPM/W/+/jZ4GiA61PyjanlxcJH385VzzBsdofiGEy8Dx aXQrlhHSPS+qPD71cASJKYESiR8jIEnoePe8qB9g9PgihahVOgF+TgXaI+em3lHNHlhQ qtjA== 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:sender:dkim-signature; bh=DvpEdbo9D8eOCupgJdY5TOmPtHK0qONBFxkN7MU8U54=; b=ZAQmoqcvQ+T/5cp7OCV9bS0xFPwr9v+ziixQzf/d0n9OLKjasyavHZxmuHIQ6KkQMs BIANZbcAxfHmi7DWtSxuXz9Hab4bDy6xE1nQSfmMMeDVQCD8jfYO4LGLBeub9EABGJnd cFDdk7Reh56JFu8mfSHa/X55rWQ/hslbY6SkTK5dLiMP2vfvDluFZ6/1yiWAhrBl+kot iQd9v3Ga453cSVvH9wlDhTaFGWiQGa44ka36AsHC3ut8eFM0VGYzLXQFjmEEHkXaWFaC af6IXT3XMFepnSvZzbTo0sUVvJBBSJcMI3kbCffbSPvzNw8w1YKT4ehJ7UMM9QQZi1Tz f9NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=OmFeoysn; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lr8-20020a17090b4b8800b0025069d02778si2133459pjb.28.2023.05.24.14.13.22; Wed, 24 May 2023 14:13:41 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=OmFeoysn; 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 S230174AbjEXVGI (ORCPT <rfc822;jian.xie.xdx@gmail.com> + 99 others); Wed, 24 May 2023 17:06:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjEXVGF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 24 May 2023 17:06:05 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D22F6191; Wed, 24 May 2023 14:06:04 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-52c30fbccd4so749253a12.0; Wed, 24 May 2023 14:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684962364; x=1687554364; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=DvpEdbo9D8eOCupgJdY5TOmPtHK0qONBFxkN7MU8U54=; b=OmFeoysniEmDOVLFTnSjviPsyEGrlwzRNwOWEeXOw4xv6KGAiC+ir8i0HOhuEDYmYg KbuwYql0xMKH1y3RvMO9DmLcjKXdoqhxJ10qgK511fCCaODrZraYjN7KnAvl7i1/D7um T0eUQWaB+qTLxel6VKAngFL+EL4hEbnbaTZptflUTzYhzJ6YIM8ktH15ubu4+AUvQZmO 7UOhcpn46W7GyNWqi6Vl6HpYgux3fwA/6qkvwNpXqNyStEDLn2QBSXMBS9+FzgozIhD8 zVA14yR/npyOgCnRN6yigcc6gwLW5JkdNKZdMoq22eaBZaHfL/TJyD/v4A7GXWSgOVxb Sf6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684962364; x=1687554364; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DvpEdbo9D8eOCupgJdY5TOmPtHK0qONBFxkN7MU8U54=; b=e/AmHB9EaWrREGqXEu6SyHHmQnqX7VchjYKyCbowGojg56z7sNH0AiX061ybghTpvO FOWLoBMl4AOAZKpm5NdwjneXBGOmoOEfBOF5GJupHQrAoc3a2w4sV1FfwT4tA3NVGwOE KmYVcfT9Dyd6zMUBcmR3ljsyV5Y3perMIz8Wf1zf7EZ4vNxkLTmq2/T4t2Wj1y99y7jv ZLo89Ru58EHiBxsScBUMxB5iJa8ZJcIdxY5MY5Jj5hq6emDUnnA8zrAt4GD7bCqax8QF FGQiVV+IMKdjKOv0O99Wxo+XHfsWbWX1Bj2kkwem+7dWxJquUAn0F/b+aoeagD/ktUc3 LdIg== X-Gm-Message-State: AC+VfDyZAD6re7FM4HVJKU2PTPeDRdVmD1qHhEvlXucR9eszL5Ri7b50 XsQA3sqhNsipu+xJ4IC7txQ= X-Received: by 2002:a17:90b:3106:b0:253:3cfa:e310 with SMTP id gc6-20020a17090b310600b002533cfae310mr17570513pjb.19.1684962364082; Wed, 24 May 2023 14:06:04 -0700 (PDT) Received: from moohyul.svl.corp.google.com ([2620:15c:2d4:203:121:f908:b42d:c399]) by smtp.gmail.com with ESMTPSA id hi20-20020a17090b30d400b0024ffa911e2asm1726221pjb.51.2023.05.24.14.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 14:06:02 -0700 (PDT) Sender: Namhyung Kim <namhyung@gmail.com> From: Namhyung Kim <namhyung@kernel.org> To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@kernel.org> Cc: Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@kernel.org>, LKML <linux-kernel@vger.kernel.org>, linux-perf-users@vger.kernel.org, K Prateek Nayak <kprateek.nayak@amd.com> Subject: [PATCH] perf test: Fix perf stat JSON output test Date: Wed, 24 May 2023 14:06:00 -0700 Message-ID: <20230524210600.3095830-1-namhyung@kernel.org> X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,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: <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?1766811575896313795?= X-GMAIL-MSGID: =?utf-8?q?1766811575896313795?= |
Series |
perf test: Fix perf stat JSON output test
|
|
Commit Message
Namhyung Kim
May 24, 2023, 9:06 p.m. UTC
The recent --per-cache option test caused a problem. According to
the option name, I think it should check args.per_cache instead of
args.per_cache_instance.
$ sudo ./perf test -v 99
99: perf stat JSON output linter :
--- start ---
test child forked, pid 3086101
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 [Success]
Checking json output: system wide no aggregation [Success]
Checking json output: per core [Success]
Checking json output: per cache_instance Test failed for input:
...
Traceback (most recent call last):
File "linux/tools/perf/tests/shell/lib/perf_json_output_lint.py", line 88, in <module>
elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache_instance:
AttributeError: 'Namespace' object has no attribute 'per_cache_instance'
test child finished with -1
---- end ----
perf stat JSON output linter: FAILED!
Fixes: bfce728db317 ("pert tests: Add tests for new "perf stat --per-cache" aggregation option")
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/tests/shell/lib/perf_json_output_lint.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hello Namhyung, On 5/25/2023 2:36 AM, Namhyung Kim wrote: > The recent --per-cache option test caused a problem. According to > the option name, I think it should check args.per_cache instead of > args.per_cache_instance. > > $ sudo ./perf test -v 99 > 99: perf stat JSON output linter : > --- start --- > test child forked, pid 3086101 > 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 [Success] > Checking json output: system wide no aggregation [Success] > Checking json output: per core [Success] > Checking json output: per cache_instance Test failed for input: > ... > Traceback (most recent call last): > File "linux/tools/perf/tests/shell/lib/perf_json_output_lint.py", line 88, in <module> > elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache_instance: > AttributeError: 'Namespace' object has no attribute 'per_cache_instance' > test child finished with -1 > ---- end ---- > perf stat JSON output linter: FAILED! > > Fixes: bfce728db317 ("pert tests: Add tests for new "perf stat --per-cache" aggregation option") Another oversight on my part. Thank you for fixing this :) $ sudo perf test -v 99 99: perf stat JSON output linter : --- start --- test child forked, pid 25046 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 [Success] Checking json output: system wide no aggregation [Success] Checking json output: per core [Success] Checking json output: per cache_instance [Success] Checking json output: per die [Success] Checking json output: per socket [Success] test child finished with 0 ---- end ---- perf stat JSON output linter: Ok Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> > Cc: K Prateek Nayak <kprateek.nayak@amd.com> > Signed-off-by: Namhyung Kim <namhyung@kernel.org> > --- > 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 4acaaed5560d..b81582a89d36 100644 > --- a/tools/perf/tests/shell/lib/perf_json_output_lint.py > +++ b/tools/perf/tests/shell/lib/perf_json_output_lint.py > @@ -85,7 +85,7 @@ Lines = args.file.readlines() > expected_items = 7 > elif args.interval or args.per_thread or args.system_wide_no_aggr: > expected_items = 8 > - elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache_instance: > + elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache: > expected_items = 9 > else: > # If no option is specified, don't check the number of items. -- Thanks and Regards, Prateek
On Wed, May 24, 2023 at 8:01 PM K Prateek Nayak <kprateek.nayak@amd.com> wrote: > > Hello Namhyung, > > On 5/25/2023 2:36 AM, Namhyung Kim wrote: > > The recent --per-cache option test caused a problem. According to > > the option name, I think it should check args.per_cache instead of > > args.per_cache_instance. > > > > $ sudo ./perf test -v 99 > > 99: perf stat JSON output linter : > > --- start --- > > test child forked, pid 3086101 > > 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 [Success] > > Checking json output: system wide no aggregation [Success] > > Checking json output: per core [Success] > > Checking json output: per cache_instance Test failed for input: > > ... > > Traceback (most recent call last): > > File "linux/tools/perf/tests/shell/lib/perf_json_output_lint.py", line 88, in <module> > > elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache_instance: > > AttributeError: 'Namespace' object has no attribute 'per_cache_instance' > > test child finished with -1 > > ---- end ---- > > perf stat JSON output linter: FAILED! > > > > Fixes: bfce728db317 ("pert tests: Add tests for new "perf stat --per-cache" aggregation option") > > Another oversight on my part. Thank you for fixing this :) > > $ sudo perf test -v 99 > 99: perf stat JSON output linter : > --- start --- > test child forked, pid 25046 > 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 [Success] > Checking json output: system wide no aggregation [Success] > Checking json output: per core [Success] > Checking json output: per cache_instance [Success] > Checking json output: per die [Success] > Checking json output: per socket [Success] > test child finished with 0 > ---- end ---- > perf stat JSON output linter: Ok > > Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> Thanks Namhyung and Prateek, Arnaldo could we get this in perf-tools-next so that the failing test goes away? Acked-by: Ian Rogers <irogers@google.com> > > Cc: K Prateek Nayak <kprateek.nayak@amd.com> > > Signed-off-by: Namhyung Kim <namhyung@kernel.org> > > --- > > 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 4acaaed5560d..b81582a89d36 100644 > > --- a/tools/perf/tests/shell/lib/perf_json_output_lint.py > > +++ b/tools/perf/tests/shell/lib/perf_json_output_lint.py > > @@ -85,7 +85,7 @@ Lines = args.file.readlines() > > expected_items = 7 > > elif args.interval or args.per_thread or args.system_wide_no_aggr: > > expected_items = 8 > > - elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache_instance: > > + elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache: > > expected_items = 9 > > else: > > # If no option is specified, don't check the number of items. > > -- > Thanks and Regards, > Prateek
Em Fri, May 26, 2023 at 03:41:29PM -0700, Ian Rogers escreveu: > On Wed, May 24, 2023 at 8:01 PM K Prateek Nayak <kprateek.nayak@amd.com> wrote: > > > > Hello Namhyung, > > > > On 5/25/2023 2:36 AM, Namhyung Kim wrote: > > > The recent --per-cache option test caused a problem. According to > > > the option name, I think it should check args.per_cache instead of > > > args.per_cache_instance. > > > > > > $ sudo ./perf test -v 99 > > > 99: perf stat JSON output linter : > > > --- start --- > > > test child forked, pid 3086101 > > > 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 [Success] > > > Checking json output: system wide no aggregation [Success] > > > Checking json output: per core [Success] > > > Checking json output: per cache_instance Test failed for input: > > > ... > > > Traceback (most recent call last): > > > File "linux/tools/perf/tests/shell/lib/perf_json_output_lint.py", line 88, in <module> > > > elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache_instance: > > > AttributeError: 'Namespace' object has no attribute 'per_cache_instance' > > > test child finished with -1 > > > ---- end ---- > > > perf stat JSON output linter: FAILED! > > > > > > Fixes: bfce728db317 ("pert tests: Add tests for new "perf stat --per-cache" aggregation option") > > > > Another oversight on my part. Thank you for fixing this :) > > > > $ sudo perf test -v 99 > > 99: perf stat JSON output linter : > > --- start --- > > test child forked, pid 25046 > > 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 [Success] > > Checking json output: system wide no aggregation [Success] > > Checking json output: per core [Success] > > Checking json output: per cache_instance [Success] > > Checking json output: per die [Success] > > Checking json output: per socket [Success] > > test child finished with 0 > > ---- end ---- > > perf stat JSON output linter: Ok > > > > Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> > > Thanks Namhyung and Prateek, Arnaldo could we get this in > perf-tools-next so that the failing test goes away? > > Acked-by: Ian Rogers <irogers@google.com> Applied and pushed to perf-tools-next, please continue from there. ⬢[acme@toolbox perf-tools-next]$ git log --oneline -10 540c910c65a94fb4 (HEAD -> perf-tools-next) perf test: Fix perf stat JSON output test 5cebb33fd929dc67 perf tests: Organize cpu_map tests into a single suite 237d41d4a2d7d45e perf cpumap: Add intersect function 6ac2230b55d392e6 perf vendor events intel: Add metricgroup descriptions for all models 66c6e0c100277175 perf jevents: Add support for metricgroup descriptions bfce728db3179042 pert tests: Add tests for new "perf stat --per-cache" aggregation option aab667ca8837e45f perf stat: Add "--per-cache" aggregation option and document it 4b87406a3b590888 perf stat record: Save cache level information 995ed074b829f293 perf stat: Setup the foundation to allow aggregation based on cache topology 2b72cec9eef19d73 perf: Extract building cache level for a CPU into separate function ⬢[acme@toolbox perf-tools-next]$ - Arnaldo
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 4acaaed5560d..b81582a89d36 100644 --- a/tools/perf/tests/shell/lib/perf_json_output_lint.py +++ b/tools/perf/tests/shell/lib/perf_json_output_lint.py @@ -85,7 +85,7 @@ Lines = args.file.readlines() expected_items = 7 elif args.interval or args.per_thread or args.system_wide_no_aggr: expected_items = 8 - elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache_instance: + elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache: expected_items = 9 else: # If no option is specified, don't check the number of items.