Re: [PATCH v8 4/7] perf/tools: Enhance JSON/metric infrastructure to handle "?"

2020-05-01 Thread Ian Rogers
On Wed, Apr 1, 2020 at 1:35 PM Kajol Jain wrote: > > Patch enhances current metric infrastructure to handle "?" in the metric > expression. The "?" can be use for parameters whose value not known while > creating metric events and which can be replace later at runtime to > the proper value. It als

Re: [PATCH V2] tools/perf: Add includes for detected configs in Makefile.perf

2023-09-08 Thread Ian Rogers
On Fri, Sep 8, 2023 at 7:51 AM Athira Rajeev wrote: > > Makefile.perf uses "CONFIG_*" checks in the code. Example the config > for libtraceevent is used to set PYTHON_EXT_SRCS > > ifeq ($(CONFIG_LIBTRACEEVENT),y) > PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) >

Re: [PATCH V3] tools/perf: Add includes for detected configs in Makefile.perf

2023-09-12 Thread Ian Rogers
.config. Include the file > ".config-detected" so that make will use the system detected > configuration in the CONFIG checks. This will fix isues that > could arise when other "CONFIG_*" checks are added to Makefile.perf > in future as well. > > Signed-off-

Re: [PATCH 17/17] perf tests task_analyzer: skip tests if no libtraceevent support

2023-07-12 Thread Ian Rogers
On Tue, Jun 13, 2023 at 10:04 AM Athira Rajeev wrote: > > From: Aditya Gupta > > Test "perf script task-analyzer tests" fails in environment with missing > libtraceevent support, as perf record fails to create the perf.data > file, which further tests depend on. > > Instead, when perf is not comp

Re: [PATCH V2 00/26] tools/perf: Fix shellcheck coding/formatting issues of perf tool shell scripts

2023-07-19 Thread Ian Rogers
code from tools/perf/trace/beauty. > > Other patches are fixes for scripts from tools/perf/tests. > > > > The shellcheck is run for severity level for errors and warnings. > > Command used: > > > > # for F in $(find tests/shell/ -perm -o=x -name '*.sh'); do s

Re: [PATCH 1/1] perf tests task_analyzer: Check perf build options for libtraceevent support

2023-07-28 Thread Ian Rogers
ke NO_LIBTRACEEVENT=1'), > > 'perf version --build-options' outputs (output trimmed): > > > >... > > libtraceevent: [ OFF ] # HAVE_LIBTRACEEVENT > >... > > > > While, when perf is compiled WITH libtraceevent, > > > > 

Re: [PATCH] tools/perf: Fix bpf__probe to set bpf_prog_type type only if differs from the desired one

2023-08-17 Thread Ian Rogers
On Thu, Aug 17, 2023 at 10:35 AM Athira Rajeev wrote: > > > > > On 07-Aug-2023, at 11:07 AM, Sachin Sant wrote: > > > > > > > >> On 07-Aug-2023, at 10:22 AM, Athira Rajeev > >> wrote: > >> > >> The test "BPF prologue generation" fails as below: > >> > >> Writing event: p:perf_bpf_probe/func _t

Re: [PATCH] perf test: Fix parse-events tests to skip parametrized events

2023-08-17 Thread Ian Rogers
On Sun, Aug 6, 2023 at 9:50 PM Athira Rajeev wrote: > > Testcase "Parsing of all PMU events from sysfs" parse events for > all PMUs, and not just cpu. In case of powerpc, the PowerVM > environment supports events from hv_24x7 and hv_gpci PMU which > is of example format like below: > > - hv_24x7/C

Re: [PATCH] perf test: Skip perf bench breakpoint run if no breakpoints available

2023-08-29 Thread Ian Rogers
On Wed, Aug 23, 2023 at 4:00 AM Naveen N Rao wrote: > > Hi Kajol, > > On Wed Aug 23, 2023 at 1:21 PM IST, Kajol Jain wrote: > > Based on commit 7d54a4acd8c1 ("perf test: Skip watchpoint > > tests if no watchpoints available"), hardware breakpoints > > are not available for power9 platform and beca

Re: [PATCH V2] perf test: Fix parse-events tests to skip parametrized events

2023-09-07 Thread Ian Rogers
#x27;commit b50d691e50e6 ("perf test: Fix "all PMU test" to skip > parametrized events")' which handled a simialr instance with > "all PMU test". > > Fix parse-events test to skip parametrized events since > it needs proper setup of the parameters. > >

Re: [PATCH] tools/perf: Add includes for detected configs in Makefile.perf

2023-09-07 Thread Ian Rogers
On Thu, Sep 7, 2023 at 10:19 AM Athira Rajeev wrote: > > Makefile.perf uses "CONFIG_*" checks in the code. Example the config > for libtraceevent is used to set PYTHON_EXT_SRCS > > ifeq ($(CONFIG_LIBTRACEEVENT),y) > PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)

Re: [PATCH 0/3] Fix for shellcheck issues with version "0.6"

2023-09-07 Thread Ian Rogers
k SC1090 to handle the location of sourced > files > tests/shell: Fix shellcheck issues in tests/shell/stat+shadow_stat.sh > tetscase > tests/shell: Fix shellcheck warnings for SC2153 in multiple scripts Series: Tested-by: Ian Rogers Thanks, Ian > tool

Re: [PATCH 1/2] tools/perf/tests: Fix string substitutions in build id test

2022-09-22 Thread Ian Rogers
On Thu, Sep 22, 2022 at 12:15 PM Arnaldo Carvalho de Melo wrote: > > Em Wed, Sep 21, 2022 at 10:38:38PM +0530, Athira Rajeev escreveu: > > The perf test named “build id cache operations” skips with below > > error on some distros: > > I wonder if we shouldn't instead state that bash is needed? > >

Re: [PATCH] tools/perf: Fix aggr_printout to display cpu field irrespective of core value

2022-10-01 Thread Ian Rogers
On Thu, Sep 29, 2022 at 5:56 AM James Clark wrote: > > > > On 29/09/2022 09:49, Athira Rajeev wrote: > > > > > >> On 28-Sep-2022, at 9:05 PM, James Clark wrote: > >> > >> > >> > > > > Hi James, > > > > Thanks for looking at the patch and sharing review comments. > > > >> On 13/09/2022 12:57, Athi

Re: [PATCH] tools/perf: Fix aggr_printout to display cpu field irrespective of core value

2022-10-03 Thread Ian Rogers
On Mon, Oct 3, 2022 at 7:03 AM atrajeev wrote: > > On 2022-10-02 05:17, Ian Rogers wrote: > > On Thu, Sep 29, 2022 at 5:56 AM James Clark > > wrote: > >> > >> > >> > >> On 29/09/2022 09:49, Athira Rajeev wrote: > >>

Re: [PATCH] tools/perf: Fix aggr_printout to display cpu field irrespective of core value

2022-10-04 Thread Ian Rogers
On Tue, Oct 4, 2022, 12:06 AM Athira Rajeev wrote: > > > > On 04-Oct-2022, at 12:21 AM, Ian Rogers wrote: > > > > On Mon, Oct 3, 2022 at 7:03 AM atrajeev > wrote: > >> > >> On 2022-10-02 05:17, Ian Rogers wrote: > >>>

Re: [PATCH] perf test record+probe_libc_inet_pton: Fix call chain match on powerpc

2023-11-28 Thread Ian Rogers
test child finished with 0 > end > probe libc's inet_pton & backtrace it with ping: Ok > > Output where gaih_inet function is present > > # ./perf test -v "probe libc's inet_pton & backtrace it with ping" >

Re: [PATCH] perf vendor events: Update datasource event name to fix duplicate events

2023-12-04 Thread Ian Rogers
On Thu, Nov 23, 2023 at 8:01 AM Athira Rajeev wrote: > > Running "perf list" on powerpc fails with segfault > as below: > >./perf list >Segmentation fault (core dumped) > > This happens because of duplicate events in the json list. > The powerpc Json event list contains some event with sam

Re: [PATCH] perf vendor events: Update datasource event name to fix duplicate events

2023-12-04 Thread Ian Rogers
On Mon, Dec 4, 2023 at 12:22 PM Arnaldo Carvalho de Melo wrote: > > Em Mon, Dec 04, 2023 at 05:20:46PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Mon, Dec 04, 2023 at 12:12:54PM -0800, Ian Rogers escreveu: > > > On Thu, Nov 23, 2023 at 8:01 AM Athir

Re: [PATCH V4] tools/perf: Add perf binary dependent rule for shellcheck log in Makefile.perf

2023-12-05 Thread Ian Rogers
On Tue, Dec 5, 2023 at 1:50 PM Arnaldo Carvalho de Melo wrote: > > Em Mon, Nov 27, 2023 at 11:12:57AM +, James Clark escreveu: > > On 23/11/2023 16:02, Athira Rajeev wrote: > > > --- a/tools/perf/Makefile.perf > > > @@ -1134,6 +1152,7 @@ bpf-skel-clean: > > > $(call QUIET_CLEAN, bpf-skel)

Re: [PATCH v2 0/9] jevents/pmu-events improvements

2023-01-19 Thread Ian Rogers
On Wed, Dec 21, 2022 at 2:34 PM Ian Rogers wrote: > > Add an optimization to jevents using the metric code, rewrite metrics > in terms of each other in order to minimize size and improve > readability. For example, on Power8 > other_stall_cpi is rewritten from: &g

Re: [PATCH v2 4/9] perf pmu-events: Separate metric out of pmu_event

2023-01-23 Thread Ian Rogers
On Mon, Jan 23, 2023 at 7:16 AM John Garry wrote: > > On 21/12/2022 22:34, Ian Rogers wrote: > > Previously both events and metrics were encoded in struct > > pmu_event. Create a new pmu_metric that has the metric related > > variables and remove these from pmu_

Re: [PATCH v2 7/9] perf pmu-events: Introduce pmu_metrics_table

2023-01-23 Thread Ian Rogers
On Mon, Jan 23, 2023 at 7:36 AM John Garry wrote: > > On 21/12/2022 22:34, Ian Rogers wrote: > > Add a metrics table that is just a cast from pmu_events_table. This > > changes the APIs so that event and metric usage of the underlying > > table is different. Later changes

Re: [PATCH v2 8/9] perf jevents: Generate metrics and events as separate tables

2023-01-23 Thread Ian Rogers
On Mon, Jan 23, 2023 at 7:18 AM John Garry wrote: > > On 21/12/2022 22:34, Ian Rogers wrote: > > Turn a perf json event into an event, metric or both. This reduces the > > number of events needed to scan to find an event or metric. As events > > no longer need the relat

Re: [PATCH v2 0/9] jevents/pmu-events improvements

2023-01-23 Thread Ian Rogers
On Mon, Jan 23, 2023 at 5:26 AM John Garry wrote: > > On 21/12/2022 22:34, Ian Rogers wrote: > > Add an optimization to jevents using the metric code, rewrite metrics > > in terms of each other in order to minimize size and improve > > readability. For example, on Power

[PATCH v3 00/11] jevents/pmu-events improvements

2023-01-23 Thread Ian Rogers
ents breakage and then later fix is avoided in this series too. v2. Rebase. Modify the code that skips rewriting a metric with the same name with itself, to make the name check case insensitive. Ian Rogers (11): perf jevents metric: Correct Function equality perf jevents metric: Add abil

[PATCH v3 01/11] perf jevents metric: Correct Function equality

2023-01-23 Thread Ian Rogers
rhs may not be defined, say for source_count, so add a guard. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py index 4797ed4fd817

[PATCH v3 02/11] perf jevents metric: Add ability to rewrite metrics in terms of others

2023-01-23 Thread Ian Rogers
Add RewriteMetricsInTermsOfOthers that iterates over pairs of names and expressions trying to replace an expression, within the current expression, with its name. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 73 +++- tools/perf/pmu-events

[PATCH v3 03/11] perf jevents: Rewrite metrics in the same file with each other

2023-01-23 Thread Ian Rogers
on Power9. To avoid recomputation decorate the function with a cache. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.p

[PATCH v3 04/11] perf pmu-events: Add separate metric from pmu_event

2023-01-23 Thread Ian Rogers
only events. Signed-off-by: Ian Rogers --- tools/perf/arch/powerpc/util/header.c| 4 +- tools/perf/pmu-events/empty-pmu-events.c | 49 ++- tools/perf/pmu-events/jevents.py | 62 - tools/perf/pmu-events/pmu-events.h | 26 tools/perf/tests/pmu-events.c

[PATCH v3 05/11] perf pmu-events: Separate the metrics from events for no jevents

2023-01-23 Thread Ian Rogers
Separate the event and metric table when building without jevents. Add find_core_metrics_table and perf_pmu__find_metrics_table while renaming existing utilities to be event specific, so that users can find the right table for their need. Signed-off-by: Ian Rogers --- tools/perf/pmu-events

[PATCH v3 06/11] perf pmu-events: Remove now unused event and metric variables

2023-01-23 Thread Ian Rogers
or metrics [2] but given the lack of use of such a feature, let's clean the code and just remove. [1] https://lore.kernel.org/lkml/20220707195610.303254-1-irog...@google.com/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/stat-shadow.c?id=01

[PATCH v3 07/11] perf stat: Remove evsel metric_name/expr

2023-01-23 Thread Ian Rogers
Metrics are their own unit and these variables held broken metrics previously and now just hold the value NULL. Remove code that used these variables. Reviewed-by: John Garry Signed-off-by: Ian Rogers --- tools/perf/builtin-stat.c | 1 - tools/perf/util/cgroup.c | 1 - tools/perf

[PATCH v3 08/11] perf jevents: Combine table prefix and suffix writing

2023-01-23 Thread Ian Rogers
Combine into a single function to simplify, in a later change, writing metrics separately. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 36 +--- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b

[PATCH v3 09/11] perf pmu-events: Introduce pmu_metrics_table

2023-01-23 Thread Ian Rogers
Add a metrics table that is just a cast from pmu_events_table. This changes the APIs so that event and metric usage of the underlying table is different. For the no jevents case the tables are already separate, later changes will separate the tables for the jevents case. Signed-off-by: Ian Rogers

[PATCH v3 10/11] perf jevents: Generate metrics and events as separate tables

2023-01-23 Thread Ian Rogers
, for the test PMU architecture pme_test_soc_cpu is renamed pmu_events__test_soc_cpu for consistency with the event vs metric naming convention. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 244 +++ tools/perf/tests/pmu-events.c| 3 +- 2

[PATCH v3 11/11] perf jevents: Add model list option

2023-01-23 Thread Ian Rogers
This allows the set of generated jevents events and metrics be limited to a subset of the model names. Appropriate if trying to minimize the binary size where only a set of models are possible. On ARM64 the --model selects the implementor rather than model. Signed-off-by: Ian Rogers --- tools

[PATCH v4 00/12] jevents/pmu-events improvements

2023-01-25 Thread Ian Rogers
wed-by John Garry and Kajol Jain. v3. Rebase an incorporate review comments from John Garry , in particular breaking apart patch 4 into 3 patches. The no jevents breakage and then later fix is avoided in this series too. v2. Rebase. Modify the code that skips rewriting a metric w

[PATCH v4 01/12] perf jevents metric: Correct Function equality

2023-01-25 Thread Ian Rogers
rhs may not be defined, say for source_count, so add a guard. Reviewed-by: Kajol Jain Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py index

[PATCH v4 02/12] perf jevents metric: Add ability to rewrite metrics in terms of others

2023-01-25 Thread Ian Rogers
Add RewriteMetricsInTermsOfOthers that iterates over pairs of names and expressions trying to replace an expression, within the current expression, with its name. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 73 +++- tools/perf/pmu-events

[PATCH v4 03/12] perf jevents: Rewrite metrics in the same file with each other

2023-01-25 Thread Ian Rogers
on Power9. To avoid recomputation decorate the function with a cache. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.p

[PATCH v4 04/12] perf pmu-events: Add separate metric from pmu_event

2023-01-25 Thread Ian Rogers
only events. Reviewed-by: John Garry Signed-off-by: Ian Rogers --- tools/perf/arch/powerpc/util/header.c| 4 +- tools/perf/pmu-events/empty-pmu-events.c | 49 ++- tools/perf/pmu-events/jevents.py | 62 - tools/perf/pmu-events/pmu-events.h | 26 tools/perf

[PATCH v4 05/12] perf pmu-events: Separate the metrics from events for no jevents

2023-01-25 Thread Ian Rogers
Separate the event and metric table when building without jevents. Add find_core_metrics_table and perf_pmu__find_metrics_table while renaming existing utilities to be event specific, so that users can find the right table for their need. Reviewed-by: John Garry Signed-off-by: Ian Rogers

[PATCH v4 06/12] perf pmu-events: Remove now unused event and metric variables

2023-01-25 Thread Ian Rogers
738f42f96a130079bc951b3cc78c5b8a#n425 Reviewed-by: John Garry Signed-off-by: Ian Rogers --- tools/perf/builtin-list.c | 20 ++--- tools/perf/pmu-events/jevents.py | 20 + tools/perf/pmu-events/pmu-events.h | 22 +-- tools/perf/tests/pmu-even

[PATCH v4 07/12] perf stat: Remove evsel metric_name/expr

2023-01-25 Thread Ian Rogers
Metrics are their own unit and these variables held broken metrics previously and now just hold the value NULL. Remove code that used these variables. Reviewed-by: John Garry Signed-off-by: Ian Rogers --- tools/perf/builtin-stat.c | 1 - tools/perf/util/cgroup.c | 1 - tools/perf

[PATCH v4 08/12] perf jevents: Combine table prefix and suffix writing

2023-01-25 Thread Ian Rogers
Combine into a single function to simplify, in a later change, writing metrics separately. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 36 +--- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b

[PATCH v4 09/12] perf pmu-events: Introduce pmu_metrics_table

2023-01-25 Thread Ian Rogers
Add a metrics table that is just a cast from pmu_events_table. This changes the APIs so that event and metric usage of the underlying table is different. For the no jevents case the tables are already separate, later changes will separate the tables for the jevents case. Signed-off-by: Ian Rogers

[PATCH v4 10/12] perf jevents: Generate metrics and events as separate tables

2023-01-25 Thread Ian Rogers
, for the test PMU architecture pme_test_soc_cpu is renamed pmu_events__test_soc_cpu for consistency with the event vs metric naming convention. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 244 +++ tools/perf/tests/pmu-events.c| 3 +- 2

[PATCH v4 11/12] perf jevents: Add model list option

2023-01-25 Thread Ian Rogers
This allows the set of generated jevents events and metrics be limited to a subset of the model names. Appropriate if trying to minimize the binary size where only a set of models are possible. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/Build | 3 ++- tools/perf/pmu-events

[PATCH v4 12/12] perf pmu-events: Fix testing with JEVENTS_ARCH=all

2023-01-25 Thread Ian Rogers
test. Fixes: acef233b7ca7 ("perf pmu: Add #slots literal support for arm64") Signed-off-by: Ian Rogers --- tools/perf/tests/pmu-events.c | 1 + tools/perf/util/expr.h| 1 + tools/perf/util/expr.l| 8 +--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --g

Re: [PATCH v4 02/12] perf jevents metric: Add ability to rewrite metrics in terms of others

2023-01-26 Thread Ian Rogers
On Thu, Jan 26, 2023 at 7:59 AM John Garry wrote: > > On 26/01/2023 01:18, Ian Rogers wrote: > > Add RewriteMetricsInTermsOfOthers that iterates over pairs of names > > and expressions trying to replace an expression, within the current > > expression, with its name. &g

[PATCH v5 00/15] jevents/pmu-events improvements

2023-01-26 Thread Ian Rogers
porate review comments from John Garry , in particular breaking apart patch 4 into 3 patches. The no jevents breakage and then later fix is avoided in this series too. v2. Rebase. Modify the code that skips rewriting a metric with the same name with itself, to make the name check

[PATCH v5 01/15] perf jevents metric: Correct Function equality

2023-01-26 Thread Ian Rogers
rhs may not be defined, say for source_count, so add a guard. Reviewed-by: Kajol Jain --- tools/perf/pmu-events/metric.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py index 4797ed4fd817..2f2fd220e843 10

[PATCH v5 02/15] perf jevents metric: Add ability to rewrite metrics in terms of others

2023-01-26 Thread Ian Rogers
Add RewriteMetricsInTermsOfOthers that iterates over pairs of names and expressions trying to replace an expression, within the current expression, with its name. --- tools/perf/pmu-events/metric.py | 73 +++- tools/perf/pmu-events/metric_test.py | 10 2 files cha

[PATCH v5 03/15] perf jevents: Rewrite metrics in the same file with each other

2023-01-26 Thread Ian Rogers
Rewrite metrics within the same file in terms of each other. For example, on Power8 other_stall_cpi is rewritten from: "PM_CMPLU_STALL / PM_RUN_INST_CMPL - PM_CMPLU_STALL_BRU_CRU / PM_RUN_INST_CMPL - PM_CMPLU_STALL_FXU / PM_RUN_INST_CMPL - PM_CMPLU_STALL_VSU / PM_RUN_INST_CMPL - PM_CMPLU_STALL_L

[PATCH v5 04/15] perf pmu-events: Add separate metric from pmu_event

2023-01-26 Thread Ian Rogers
Create a new pmu_metric for the metric related variables from pmu_event but that is initially just a clone of pmu_event. Add iterators for pmu_metric and use in places that metrics are desired rather than events. Make the event iterator skip metric only events, and the metric iterator skip event on

[PATCH v5 05/15] perf pmu-events: Separate the metrics from events for no jevents

2023-01-26 Thread Ian Rogers
Separate the event and metric table when building without jevents. Add find_core_metrics_table and perf_pmu__find_metrics_table while renaming existing utilities to be event specific, so that users can find the right table for their need. Reviewed-by: John Garry --- tools/perf/pmu-events/empty-p

[PATCH v5 06/15] perf pmu-events: Remove now unused event and metric variables

2023-01-26 Thread Ian Rogers
Previous changes separated the uses of pmu_event and pmu_metric, however, both structures contained all the variables of event and metric. This change removes the event variables from metric and the metric variables from event. Note, this change removes the setting of evsel's metric_name/expr as t

[PATCH v5 07/15] perf stat: Remove evsel metric_name/expr

2023-01-26 Thread Ian Rogers
Metrics are their own unit and these variables held broken metrics previously and now just hold the value NULL. Remove code that used these variables. Reviewed-by: John Garry --- tools/perf/builtin-stat.c | 1 - tools/perf/util/cgroup.c | 1 - tools/perf/util/evsel.c | 2 -

[PATCH v5 08/15] perf jevents: Combine table prefix and suffix writing

2023-01-26 Thread Ian Rogers
Combine into a single function to simplify, in a later change, writing metrics separately. --- tools/perf/pmu-events/jevents.py | 36 +--- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py

[PATCH v5 09/15] perf pmu-events: Introduce pmu_metrics_table

2023-01-26 Thread Ian Rogers
Add a metrics table that is just a cast from pmu_events_table. This changes the APIs so that event and metric usage of the underlying table is different. For the no jevents case the tables are already separate, later changes will separate the tables for the jevents case. --- tools/perf/arch/arm64/

[PATCH v5 10/15] perf jevents: Generate metrics and events as separate tables

2023-01-26 Thread Ian Rogers
Turn a perf json event into an event, metric or both. This reduces the number of events needed to scan to find an event or metric. As events no longer need the relatively seldom used metric fields, 4 bytes is saved per event. This reduces the big C string's size by 335kb (14.8%) on x86. Note, for

[PATCH v5 11/15] perf jevents: Add model list option

2023-01-26 Thread Ian Rogers
This allows the set of generated jevents events and metrics be limited to a subset of the model names. Appropriate if trying to minimize the binary size where only a set of models are possible. --- tools/perf/pmu-events/Build | 3 ++- tools/perf/pmu-events/jevents.py | 14 ++ 2 f

[PATCH v5 12/15] perf pmu-events: Fix testing with JEVENTS_ARCH=all

2023-01-26 Thread Ian Rogers
The #slots literal will return NAN when not on ARM64 which causes a perf test failure when not on an ARM64 for a JEVENTS_ARCH=all build: .. 10.4: Parsing of PMU event table metrics with fake PMUs : FAILED! .. Add an is_test boolean so that the failure can be avoided when running as a t

[PATCH v5 13/15] perf jevents: Correct bad character encoding

2023-01-26 Thread Ian Rogers
A character encoding issue added a "3D" character that breaks the metrics test. Fixes: 40769665b63d ("perf jevents: Parse metrics during conversion") --- tools/perf/pmu-events/metric_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/pmu-events/metric_test.

[PATCH v5 14/15] tools build: Add test echo-cmd

2023-01-26 Thread Ian Rogers
Add quiet_cmd_test so that: $(Q)$(call echo-cmd,test) will print: TEST This is useful for executing compile-time tests similar to what happens for fortify tests in the kernel's lib directory. --- tools/build/Makefile.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build/Makefi

[PATCH v5 15/15] perf jevents: Run metric_test.py at compile-time

2023-01-26 Thread Ian Rogers
Add a target that generates a log file for running metric_test.py and make this a dependency on generating pmu-events.c. The log output is displayed if the test fails like (the test was modified to make it fail): ``` TEST/tmp/perf/pmu-events/metric_test.log F.. ==

Re: [PATCH v5 00/15] jevents/pmu-events improvements

2023-01-27 Thread Ian Rogers
On Fri, Jan 27, 2023, 5:20 AM John Garry wrote: > On 26/01/2023 23:36, Ian Rogers wrote: > > Hi Ian, > > At a glance, none of this series has your Signed-off-by tag.. > > Thanks, > John > Thanks John, will fix. Is there anything else? Ian > Add an optimizati

Re: [PATCH v5 10/15] perf jevents: Generate metrics and events as separate tables

2023-01-30 Thread Ian Rogers
On Mon, Jan 30, 2023 at 8:07 AM John Garry wrote: > > On 26/01/2023 23:36, Ian Rogers wrote: > > @@ -660,7 +763,29 @@ const struct pmu_events_table > > *perf_pmu__find_events_table(struct perf_pmu *pmu) > > > > const struct pmu_metrics_table *perf_pmu__find_metr

Re: [PATCH v5 00/15] jevents/pmu-events improvements

2023-01-30 Thread Ian Rogers
On Mon, Jan 30, 2023 at 7:22 AM John Garry wrote: > > On 27/01/2023 13:48, Ian Rogers wrote: > > On Fri, Jan 27, 2023, 5:20 AM John Garry > <mailto:john.g.ga...@oracle.com>> wrote: > > > > On 26/01/2023 23:36, Ian Rogers wrote: > > > > Hi I

[PATCH v1] perf pmu: Fix aarch64 build

2023-02-02 Thread Ian Rogers
ARM64 overrides a weak function but a previous change had broken the build. Fixes: 8cefeb8bd336 ("perf pmu-events: Introduce pmu_metrics_table") Signed-off-by: Ian Rogers --- tools/perf/arch/arm64/util/pmu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/arch/arm64/

Re: [PATCH v1] perf pmu: Fix aarch64 build

2023-02-02 Thread Ian Rogers
On Thu, Feb 2, 2023 at 5:40 PM Ian Rogers wrote: > > ARM64 overrides a weak function but a previous change had broken the > build. > > Fixes: 8cefeb8bd336 ("perf pmu-events: Introduce pmu_metrics_table") As 8cefeb8bd336 ("perf pmu-events: Introduce pmu_metrics_ta

Re: [PATCH v1] perf pmu: Fix aarch64 build

2023-02-04 Thread Ian Rogers
On Fri, Feb 3, 2023 at 8:56 AM Arnaldo Carvalho de Melo wrote: > > Em Fri, Feb 03, 2023 at 01:02:02PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Fri, Feb 03, 2023 at 12:43:48PM -0300, Arnaldo Carvalho de Melo escreveu: > > > I tried bisecting, but at this cset: > > > > > > acme@roc-rk3399-pc

Re: [PATCH v5 15/15] perf jevents: Run metric_test.py at compile-time

2023-02-04 Thread Ian Rogers
On Fri, Feb 3, 2023 at 12:15 PM Arnaldo Carvalho de Melo wrote: > > Em Thu, Jan 26, 2023 at 03:36:45PM -0800, Ian Rogers escreveu: > > Add a target that generates a log file for running metric_test.py and > > make this a dependency on generating pmu-events.c. The log output i

Re: [PATCH] tools/perf/tests: Add system wide check for perf bench workload in all metric test

2023-02-14 Thread Ian Rogers
On Tue, Feb 7, 2023 at 7:45 PM kajoljain wrote: > > > > On 2/6/23 10:10, Athira Rajeev wrote: > > > > > >> On 02-Feb-2023, at 10:14 PM, Kajol Jain wrote: > >> > >> Testcase stat_all_metrics.sh fails in powerpc: > >> > >> 92: perf all metrics test : FAILED! > >> > >> Logs with verbose: > >> > >> [

Re: [PATCH v2] tools/perf/tests: Change true workload to sleep workload in all metric test for system wide check

2023-02-15 Thread Ian Rogers
me of the hv-24x7 metric events > may need bigger workload with system wide monitoring to get the data. > Fix this issue by changing current system wide check from true workload to > sleep 0.01 workload. > > Result with the patch changes in powerpc: > > 98: perf all metrics test

Re: [PATCH] powerpc/perf: Add json metric events to present CPI stall cycles in powerpc

2023-02-16 Thread Ian Rogers
#37.48 > EXECUTION_STALL_CPI > 1,393,916,546,654 PM_DISP_STALL_CYC > 8,455,376,836,463 PM_EXEC_STALL > > "--metric-no-group" is used for forcing PM_RUN_INST_CMPL to be scheduled > in all group for more accuracy. > > Signed-off-by: A

Re: perf tools power9 JSON files build breakage on ubuntu 18.04 cross build

2023-03-23 Thread Ian Rogers
On Thu, Mar 23, 2023 at 6:11 AM Arnaldo Carvalho de Melo wrote: > > Exception processing pmu-events/arch/powerpc/power9/other.json > Traceback (most recent call last): > File "pmu-events/jevents.py", line 997, in > main() > File "pmu-events/jevents.py", line 979, in main > ftw(arch_pa

Re: [PATCH] perf vendor events power9: Remove UTF-8 characters from json files

2023-03-28 Thread Ian Rogers
-events/arch/powerpc/power9/pmc.json:application/json; > charset=us-ascii > pmu-events/arch/powerpc/power9/translation.json:application/json; > charset=us-ascii > > Fixes: 3c22ba524304 ("perf vendor events powerpc: Update POWER9 events") > Reported-by: Ar

Re: [PATCH 1/2] tools/perf: Fix printing os->prefix in CSV metrics output

2022-11-03 Thread Ian Rogers
On Wed, Nov 2, 2022 at 1:36 AM Athira Rajeev wrote: > > > > > On 18-Oct-2022, at 2:26 PM, Athira Rajeev > > wrote: > > > > Perf stat with CSV output option prints an extra empty > > string as first field in metrics output line. > > Sample output below: > > > > # ./perf stat -x, --per-socke

Re: [PATCH] perf test: Skip watchpoint tests if no watchpoints available

2022-11-22 Thread Ian Rogers
pr_debug("failed opening event %x\n", attr.bp_type); > > + } > > Do you really need that ? > > Can't you directly check errno in the caller ? errno is very easily clobbered and not clearly set on success - ie, it'd be better not to do that. Acked-

[PATCH v1 0/9] jevents/pmu-events improvements

2022-12-12 Thread Ian Rogers
ate for operating systems like ChromeOS, that aim to minimize binary size and know all the target CPU models. Ian Rogers (9): perf jevents metric: Correct Function equality perf jevents metric: Add ability to rewrite metrics in terms of others perf jevents: Rewrite metrics in the same file wit

[PATCH v1 1/9] perf jevents metric: Correct Function equality

2022-12-12 Thread Ian Rogers
rhs may not be defined, say for source_count, so add a guard. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py index cc451a265751

[PATCH v1 2/9] perf jevents metric: Add ability to rewrite metrics in terms of others

2022-12-12 Thread Ian Rogers
Add RewriteMetricsInTermsOfOthers that iterates over pairs of names and expressions trying to replace an expression, within the current expression, with its name. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 69 +++- tools/perf/pmu-events

[PATCH v1 3/9] perf jevents: Rewrite metrics in the same file with each other

2022-12-12 Thread Ian Rogers
on Power9. To avoid recomputation decorate the function with a cache. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.p

[PATCH v1 4/9] perf pmu-events: Separate metric out of pmu_event

2022-12-12 Thread Ian Rogers
quot; to fail as they fail to find necessary metrics. This is fixed in a later change. [1] https://lore.kernel.org/lkml/20220707195610.303254-1-irog...@google.com/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/stat-shadow.c?id=01b8957b738f42f96a130079bc

[PATCH v1 5/9] perf stat: Remove evsel metric_name/expr

2022-12-12 Thread Ian Rogers
Metrics are their own unit and these variables held broken metrics previously and now just hold the value NULL. Remove code that used these variables. Signed-off-by: Ian Rogers --- tools/perf/builtin-stat.c | 1 - tools/perf/util/cgroup.c | 1 - tools/perf/util/evsel.c | 2

[PATCH v1 6/9] perf jevents: Combine table prefix and suffix writing

2022-12-12 Thread Ian Rogers
Combine into a single function to simplify, in a later change, writing metrics separately. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 36 +--- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b

[PATCH v1 7/9] perf pmu-events: Introduce pmu_metrics_table

2022-12-12 Thread Ian Rogers
: Ok 70: Event expansion for cgroups : Ok caused by the necessary test metrics not being found. Signed-off-by: Ian Rogers --- tools/perf/arch/arm64/util/pmu.c | 23 ++- tools/perf/pmu-events/empty-pmu-events.c | 52

[PATCH v1 8/9] perf jevents: Generate metrics and events as separate tables

2022-12-12 Thread Ian Rogers
igned-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 244 +++ tools/perf/tests/pmu-events.c| 3 +- 2 files changed, 189 insertions(+), 58 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py index be2cf8a

[PATCH v1 9/9] perf jevents: Add model list option

2022-12-12 Thread Ian Rogers
This allows the set of generated jevents events and metrics be limited to a subset of the model names. Appropriate if trying to minimize the binary size where only a set of models are possible. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/Build | 3 ++- tools/perf/pmu-events

[PATCH v2 0/9] jevents/pmu-events improvements

2022-12-21 Thread Ian Rogers
ated pmu-metrics.c code. This functionality is appropriate for operating systems like ChromeOS, that aim to minimize binary size and know all the target CPU models. v2. Rebase. Modify the code that skips rewriting a metric with the same name with itself, to make the name check case insensitive.

[PATCH v2 1/9] perf jevents metric: Correct Function equality

2022-12-21 Thread Ian Rogers
rhs may not be defined, say for source_count, so add a guard. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py index 4797ed4fd817

[PATCH v2 2/9] perf jevents metric: Add ability to rewrite metrics in terms of others

2022-12-21 Thread Ian Rogers
Add RewriteMetricsInTermsOfOthers that iterates over pairs of names and expressions trying to replace an expression, within the current expression, with its name. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 73 +++- tools/perf/pmu-events

[PATCH v2 3/9] perf jevents: Rewrite metrics in the same file with each other

2022-12-21 Thread Ian Rogers
on Power9. To avoid recomputation decorate the function with a cache. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.p

[PATCH v2 4/9] perf pmu-events: Separate metric out of pmu_event

2022-12-21 Thread Ian Rogers
quot; to fail as they fail to find necessary metrics. This is fixed in a later change. [1] https://lore.kernel.org/lkml/20220707195610.303254-1-irog...@google.com/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/stat-shadow.c?id=01b8957b738f42f96a130079bc

[PATCH v2 5/9] perf stat: Remove evsel metric_name/expr

2022-12-21 Thread Ian Rogers
Metrics are their own unit and these variables held broken metrics previously and now just hold the value NULL. Remove code that used these variables. Signed-off-by: Ian Rogers --- tools/perf/builtin-stat.c | 1 - tools/perf/util/cgroup.c | 1 - tools/perf/util/evsel.c | 2

[PATCH v2 6/9] perf jevents: Combine table prefix and suffix writing

2022-12-21 Thread Ian Rogers
Combine into a single function to simplify, in a later change, writing metrics separately. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 36 +--- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b

[PATCH v2 7/9] perf pmu-events: Introduce pmu_metrics_table

2022-12-21 Thread Ian Rogers
: Ok 70: Event expansion for cgroups : Ok caused by the necessary test metrics not being found. Signed-off-by: Ian Rogers --- tools/perf/arch/arm64/util/pmu.c | 23 ++- tools/perf/pmu-events/empty-pmu-events.c | 52

[PATCH v2 8/9] perf jevents: Generate metrics and events as separate tables

2022-12-21 Thread Ian Rogers
igned-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 244 +++ tools/perf/tests/pmu-events.c| 3 +- 2 files changed, 189 insertions(+), 58 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py index be2cf8a

  1   2   >