Linux-perf-users Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] perf test: Fix metric parsing test
@ 2020-11-19 15:24 Kajol Jain
  2020-11-19 19:32 ` Jiri Olsa
       [not found] ` <CAP-5=fX76BQMaOnKTCgBD9MMwx_Q=tShDFBYZxzJOreOhXV=Mw@mail.gmail.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Kajol Jain @ 2020-11-19 15:24 UTC (permalink / raw)
  To: acme
  Cc: jolsa, linux-perf-users, linux-kernel, irogers, ravi.bangoria,
	kjain, maddy

Commit e1c92a7fbbc5 ("perf tests: Add another metric parsing test")
add another test for metric parsing. The test goes through all metrics
compiled for arch within pmu events and try to parse them.

Right now this test is failing in powerpc machine.

Result in power9 platform:

[command]# ./perf test 10
10: PMU events                                                      :
10.1: PMU event table sanity                                        : Ok
10.2: PMU event map aliases                                         : Ok
10.3: Parsing of PMU event table metrics                            : Skip (some metrics failed)
10.4: Parsing of PMU event table metrics with fake PMUs             : FAILED!

Issue is we are passing different runtime parameter value in "expr__find_other"
and "expr__parse" function which is called from function `metric_parse_fake`.
And because of this parsing of hv-24x7 metrics is failing.

[command]# ./perf test 10 -vv
.....
hv_24x7/pm_mcs01_128b_rd_disp_port01,chip=1/ not found
expr__parse failed
test child finished with -1
---- end ----
PMU events subtest 4: FAILED!

This patch fix this issue and change runtime parameter value to '0' in
expr__parse function.

Result in power9 platform after this patch:

[command]# ./perf test 10
10: PMU events                                                      :
10.1: PMU event table sanity                                        : Ok
10.2: PMU event map aliases                                         : Ok
10.3: Parsing of PMU event table metrics                            : Skip (some metrics failed)
10.4: Parsing of PMU event table metrics with fake PMUs             : Ok

Fixes: e1c92a7fbbc5 ("perf tests: Add another metric parsing test")
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
---
 tools/perf/tests/pmu-events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/pmu-events.c b/tools/perf/tests/pmu-events.c
index ad2b21591275..0ca6a5a53523 100644
--- a/tools/perf/tests/pmu-events.c
+++ b/tools/perf/tests/pmu-events.c
@@ -575,7 +575,7 @@ static int metric_parse_fake(const char *str)
 		}
 	}
 
-	if (expr__parse(&result, &ctx, str, 1))
+	if (expr__parse(&result, &ctx, str, 0))
 		pr_err("expr__parse failed\n");
 	else
 		ret = 0;
-- 
2.27.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf test: Fix metric parsing test
  2020-11-19 15:24 [PATCH] perf test: Fix metric parsing test Kajol Jain
@ 2020-11-19 19:32 ` Jiri Olsa
       [not found] ` <CAP-5=fX76BQMaOnKTCgBD9MMwx_Q=tShDFBYZxzJOreOhXV=Mw@mail.gmail.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2020-11-19 19:32 UTC (permalink / raw)
  To: Kajol Jain
  Cc: acme, linux-perf-users, linux-kernel, irogers, ravi.bangoria, maddy

On Thu, Nov 19, 2020 at 08:54:11PM +0530, Kajol Jain wrote:
> Commit e1c92a7fbbc5 ("perf tests: Add another metric parsing test")
> add another test for metric parsing. The test goes through all metrics
> compiled for arch within pmu events and try to parse them.
> 
> Right now this test is failing in powerpc machine.
> 
> Result in power9 platform:
> 
> [command]# ./perf test 10
> 10: PMU events                                                      :
> 10.1: PMU event table sanity                                        : Ok
> 10.2: PMU event map aliases                                         : Ok
> 10.3: Parsing of PMU event table metrics                            : Skip (some metrics failed)
> 10.4: Parsing of PMU event table metrics with fake PMUs             : FAILED!
> 
> Issue is we are passing different runtime parameter value in "expr__find_other"
> and "expr__parse" function which is called from function `metric_parse_fake`.
> And because of this parsing of hv-24x7 metrics is failing.
> 
> [command]# ./perf test 10 -vv
> .....
> hv_24x7/pm_mcs01_128b_rd_disp_port01,chip=1/ not found
> expr__parse failed
> test child finished with -1
> ---- end ----
> PMU events subtest 4: FAILED!
> 
> This patch fix this issue and change runtime parameter value to '0' in
> expr__parse function.
> 
> Result in power9 platform after this patch:
> 
> [command]# ./perf test 10
> 10: PMU events                                                      :
> 10.1: PMU event table sanity                                        : Ok
> 10.2: PMU event map aliases                                         : Ok
> 10.3: Parsing of PMU event table metrics                            : Skip (some metrics failed)
> 10.4: Parsing of PMU event table metrics with fake PMUs             : Ok
> 
> Fixes: e1c92a7fbbc5 ("perf tests: Add another metric parsing test")
> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

> ---
>  tools/perf/tests/pmu-events.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/tests/pmu-events.c b/tools/perf/tests/pmu-events.c
> index ad2b21591275..0ca6a5a53523 100644
> --- a/tools/perf/tests/pmu-events.c
> +++ b/tools/perf/tests/pmu-events.c
> @@ -575,7 +575,7 @@ static int metric_parse_fake(const char *str)
>  		}
>  	}
>  
> -	if (expr__parse(&result, &ctx, str, 1))
> +	if (expr__parse(&result, &ctx, str, 0))
>  		pr_err("expr__parse failed\n");
>  	else
>  		ret = 0;
> -- 
> 2.27.0
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf test: Fix metric parsing test
       [not found] ` <CAP-5=fX76BQMaOnKTCgBD9MMwx_Q=tShDFBYZxzJOreOhXV=Mw@mail.gmail.com>
@ 2020-11-30 12:10   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-11-30 12:10 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Kajol Jain, Jiri Olsa, linux-perf-users, LKML, Ravi Bangoria, maddy

Em Thu, Nov 19, 2020 at 08:48:57AM -0800, Ian Rogers escreveu:
> On Thu, Nov 19, 2020 at 7:25 AM Kajol Jain <kjain@linux.ibm.com> wrote:
> > Result in power9 platform after this patch:

> > [command]# ./perf test 10
> > 10: PMU events                                                      :
> > 10.1: PMU event table sanity                                        : Ok
> > 10.2: PMU event map aliases                                         : Ok
> > 10.3: Parsing of PMU event table metrics                            : Skip
> > (some metrics failed)
> > 10.4: Parsing of PMU event table metrics with fake PMUs             : Ok

> > Fixes: e1c92a7fbbc5 ("perf tests: Add another metric parsing test")
> > Signed-off-by: Kajol Jain <kjain@linux.ibm.com>

> Acked-by: Ian Rogers <irogers@google.com>



Thanks, applied.

- Arnaldo


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 15:24 [PATCH] perf test: Fix metric parsing test Kajol Jain
2020-11-19 19:32 ` Jiri Olsa
     [not found] ` <CAP-5=fX76BQMaOnKTCgBD9MMwx_Q=tShDFBYZxzJOreOhXV=Mw@mail.gmail.com>
2020-11-30 12:10   ` Arnaldo Carvalho de Melo

Linux-perf-users Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-perf-users/0 linux-perf-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-perf-users linux-perf-users/ https://lore.kernel.org/linux-perf-users \
		linux-perf-users@vger.kernel.org
	public-inbox-index linux-perf-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-perf-users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git