Re: [PATCH] tools/lib/perf: Fix -Werror=alloc-size-larger-than in cpumap.c

2025-05-21 Thread Ian Rogers
On Wed, May 21, 2025 at 10:28 AM Likhitha Korrapati wrote: > > Hi Ian, > > On 5/21/25 21:15, Ian Rogers wrote: > > On Wed, May 21, 2025 at 6:03 AM Likhitha Korrapati > > wrote: > >> > >> Hi Arnaldo, > >> > >> On 5/14/25 02:43, Arnaldo

Re: [PATCH] tools/lib/perf: Fix -Werror=alloc-size-larger-than in cpumap.c

2025-05-21 Thread Ian Rogers
On Wed, May 21, 2025 at 6:03 AM Likhitha Korrapati wrote: > > Hi Arnaldo, > > On 5/14/25 02:43, Arnaldo Carvalho de Melo wrote: > > On Fri, May 02, 2025 at 01:14:32PM +0530, Mukesh Kumar Chaurasiya wrote: > >> On Fri, Apr 25, 2025 at 02:46:43PM -0300, Arnaldo Carvalho de Melo wrote: > >>> Maybe th

Re: [PATCH] tools/lib/perf: Fix -Werror=alloc-size-larger-than in cpumap.c

2025-05-13 Thread Ian Rogers
On Tue, May 13, 2025 at 3:12 PM Ian Rogers wrote: > > On Tue, May 13, 2025 at 2:13 PM Arnaldo Carvalho de Melo > wrote: > > > > On Fri, May 02, 2025 at 01:14:32PM +0530, Mukesh Kumar Chaurasiya wrote: > > > On Fri, Apr 25, 2025 at 02:46:43PM -0300, Arnaldo Carvalh

Re: [PATCH] tools/lib/perf: Fix -Werror=alloc-size-larger-than in cpumap.c

2025-05-13 Thread Ian Rogers
On Tue, May 13, 2025 at 2:13 PM Arnaldo Carvalho de Melo wrote: > > On Fri, May 02, 2025 at 01:14:32PM +0530, Mukesh Kumar Chaurasiya wrote: > > On Fri, Apr 25, 2025 at 02:46:43PM -0300, Arnaldo Carvalho de Melo wrote: > > > Maybe that max() call in perf_cpu_map__intersect() somehow makes the > >

Re: [PATCH v2] perf: Fix display of kernel symbols

2025-01-08 Thread Ian Rogers
dress of the following map. > > Fix it by really taking the next entry, also make sure that entry > follows current one by making sure entries are sorted. > > Fixes: 659ad3492b91 ("perf maps: Switch from rbtree to lazily sorted array > for addresses") > Signed-off-b

Re: [PATCH] libperf: Add back guard on MAX_NR_CPUS

2025-01-07 Thread Ian Rogers
On Tue, Jan 7, 2025 at 12:50 AM Christophe Leroy wrote: > > Le 06/01/2025 à 21:05, Ian Rogers a écrit : > > On Mon, Jan 6, 2025 at 11:38 AM Christophe Leroy > > wrote: > >> > >> Building perf with EXTRA_CFLAGS="-DMAX_NR_CPUS=1" fails: > >&

Re: [PATCH] perf: Fix display of kernel symbols

2025-01-06 Thread Ian Rogers
On Mon, Jan 6, 2025 at 11:38 AM Christophe Leroy wrote: > > Since commit 659ad3492b91 ("perf maps: Switch from rbtree to lazily > sorted array for addresses"), perf doesn't display anymore kernel > symbols on powerpc, allthough it still detects them as kernel addresses. > > # Overhead Com

Re: [PATCH] libperf: Add back guard on MAX_NR_CPUS

2025-01-06 Thread Ian Rogers
On Mon, Jan 6, 2025 at 11:38 AM Christophe Leroy wrote: > > Building perf with EXTRA_CFLAGS="-DMAX_NR_CPUS=1" fails: > > CC /home/chleroy/linux-powerpc/tools/perf/libperf/cpumap.o > cpumap.c:16: error: "MAX_NR_CPUS" redefined [-Werror] >16 | #define MAX_NR_CPUS 4

Re: [PATCH v1] perf test expr: Fix system_tsc_freq for only x86

2024-12-04 Thread Ian Rogers
On Wed, Dec 4, 2024 at 10:33 PM Ian Rogers wrote: > > On Wed, Dec 4, 2024 at 9:47 PM Namhyung Kim wrote: > > > > Hi Ian, > > > > On Wed, Dec 04, 2024 at 06:23:05PM -0800, Ian Rogers wrote: > > > The refactoring of tool PMU events to have a PMU then adding

Re: [PATCH v1] perf test expr: Fix system_tsc_freq for only x86

2024-12-04 Thread Ian Rogers
On Wed, Dec 4, 2024 at 9:47 PM Namhyung Kim wrote: > > Hi Ian, > > On Wed, Dec 04, 2024 at 06:23:05PM -0800, Ian Rogers wrote: > > The refactoring of tool PMU events to have a PMU then adding the expr > > literals to the tool PMU made it so that the literal system_tsc_fre

[PATCH v1] perf test expr: Fix system_tsc_freq for only x86

2024-12-04 Thread Ian Rogers
: 609aa2667f67 ("perf tool_pmu: Switch to standard pmu functions and json descriptions") Reported-by: Athira Rajeev Closes: https://lore.kernel.org/linux-perf-users/20241022140156.98854-1-atraj...@linux.vnet.ibm.com/ Co-developed-by: Athira Rajeev Signed-off-by: Ian Rogers --- tools/perf/te

Re: [PATCH] tools/perf/tests/expr: Make the system_tsc_freq test only for intel

2024-11-04 Thread Ian Rogers
On Sun, Nov 3, 2024 at 8:17 PM Athira Rajeev wrote: > > > > > On 30 Oct 2024, at 5:29 AM, Namhyung Kim wrote: > > > > Hello, > > > > On Tue, Oct 22, 2024 at 07:31:56PM +0530, Athira Rajeev wrote: > >> The "Simple expression parser" test fails on powerpc > >> as below: > >> > >> parsing metric: #s

Re: [PATCH] tools/perf/tests: Fix compilation error with strncpy in tests/tool_pmu

2024-10-16 Thread Ian Rogers
On Wed, Oct 16, 2024 at 11:23 AM Athira Rajeev wrote: > > > > > On 16 Oct 2024, at 8:36 PM, Ian Rogers wrote: > > > > On Wed, Oct 16, 2024 at 5:30 AM Athira Rajeev > > wrote: > >> > >> > >> > >>> On 14 Oct 2024, at 10:56 PM

Re: [PATCH] tools/perf/tests: Fix compilation error with strncpy in tests/tool_pmu

2024-10-16 Thread Ian Rogers
On Wed, Oct 16, 2024 at 5:30 AM Athira Rajeev wrote: > > > > > On 14 Oct 2024, at 10:56 PM, Namhyung Kim wrote: > > > > Hello Athira, > > > > On Sun, Oct 13, 2024 at 11:07:42PM +0530, Athira Rajeev wrote: > >> perf fails to compile on systems with GCC version11 > >> as below: > >> > >> In file in

Re: [PATCH 1/3] perf vendor events power10: Update JSON/events

2024-08-27 Thread Ian Rogers
On Mon, Aug 26, 2024 at 10:33 PM Kajol Jain wrote: > > Update JSON/events for power10 platform with additional events. > > Signed-off-by: Kajol Jain For the series: Reviewed-by: Ian Rogers Just to note, the moving of events in patches 2 and 3 is necessary as the filename sets th

Re: [PATCH] perf vendor events power10: Update JSON/events

2024-07-23 Thread Ian Rogers
On Mon, Jul 22, 2024 at 10:27 PM Kajol Jain wrote: > > Update JSON/events for power10 platform with additional events. > Also move PM_VECTOR_LD_CMPL event from others.json to > frontend.json file. > > Signed-off-by: Kajol Jain Reviewed-by: Ian Rogers > --- >

Re: [PATCH] perf report: Calling available function for stats printing

2024-06-28 Thread Ian Rogers
On Fri, Jun 28, 2024 at 11:32 AM Abhishek Dubey wrote: > > For printing dump_trace, just use existing stats_print() > function. > > Signed-off-by: Abhishek Dubey Reviewed-by: Ian Rogers Thanks, Ian > --- > tools/perf/builtin-report.c | 3 +-- > 1 file changed, 1 i

Re: [PATCH] Perf: Calling available function for stats printing

2024-06-27 Thread Ian Rogers
On Thu, Jun 27, 2024 at 6:37 AM Abhishek Dubey wrote: > > For printing dump_trace, just use existing stats_print() > function. > > Signed-off-by: Abhishek Dubey Thanks Abishek, the change looks good but it needs to be rebased on top of Commit 411ee13598ef ("perf hist: Add symbol_conf.skip_empty"

Re: [PATCH 1/3] tools/perf: Fix the nrcpus in perf bench futex to enable the run when all CPU's are not online

2024-06-07 Thread Ian Rogers
hich is not allocated on the cpumask. Fix this by changing > the size of cpumask to number of possible cpus and not the number > of online cpus. > > Signed-off-by: Athira Rajeev For the series: Reviewed-by: Ian Rogers Thanks, Ian > --- > tools/perf/bench/futex-hash.c |

Re: [PATCH V3 11/14] tools/perf: Add support to use libcapstone in powerpc

2024-06-03 Thread Ian Rogers
On Fri, May 31, 2024 at 11:10 PM Athira Rajeev wrote: > > Now perf uses the capstone library to disassemble the instructions in > x86. capstone is used (if available) for perf annotate to speed up. > Currently it only supports x86 architecture. Patch includes changes to > enable this in powerpc. F

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] 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] 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 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 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 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 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] 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 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] 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] 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] 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 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 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 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] 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: 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] 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: [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] 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 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 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 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

[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 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

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-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

[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.. ==

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

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 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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

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

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 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 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 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 1/2] tools/perf/tests: Fix string substitutions in build id test

2023-01-16 Thread Ian Rogers
On Mon, Jan 16, 2023 at 4:00 AM Athira Rajeev wrote: > > > > > On 16-Jan-2023, at 11:47 AM, Ian Rogers wrote: > > > > On Sun, Jan 15, 2023 at 9:03 PM Athira Rajeev > > wrote: > >> > >> > >> > >>> On 28-Sep-2022, at 10:24

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

2023-01-15 Thread Ian Rogers
On Sun, Jan 15, 2023 at 9:03 PM Athira Rajeev wrote: > > > > > On 28-Sep-2022, at 10:24 AM, Athira Rajeev > > wrote: > > > > Hi All, > > > > Looking for what direction we can take here. > > Do we want to change all tests in tools/perf/tests/shell except > > test_intel_pt.sh to use "bash" or go

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

2022-12-21 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 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

[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 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

  1   2   >