Re: [PATCH v4 00/25] perf tool: AlderLake hybrid support series 1

2021-04-20 Thread Jin, Yao
Hi Arnaldo, Hi Jiri, Kan's patch series for AlderLake perf core support has been upstreamed, so the interface will not be changed any more. For this perf tool series (v4), do you have any comments? Thanks Jin Yao On 4/16/2021 10:04 PM, Jin Yao wrote: AlderLake uses a hybrid architecture

[PATCH v4] perf Documentation: Document intel-hybrid support

2021-04-16 Thread Jin Yao
Add some words and examples to help understanding of Intel hybrid perf support. Signed-off-by: Jin Yao --- v4: - Update due to PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE are extended to be PMU type aware. tools/perf/Documentation/intel-hybrid.txt | 214 ++ tools/perf

[PATCH v4 25/25] perf tests: Skip 'perf stat metrics (shadow stat) test' for hybrid

2021-04-16 Thread Jin Yao
/instructions/ 841,158,734 cpu_atom/instructions/ 1.002644773 seconds time elapsed Now there is no shadow stat 'insn per cycle' reported. We will support it later and now just skip the 'perf stat metrics (shadow stat) test'. Signed-off-by: Jin Yao --- tools/perf/tests/shell

[PATCH v4 22/25] perf tests: Support 'Parse and process metrics' test for hybrid

2021-04-16 Thread Jin Yao
Some events are not supported. Only pick up some cases for hybrid. # ./perf test 67 67: Parse and process metrics : Ok Signed-off-by: Jin Yao --- tools/perf/tests/parse-metric.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff

[PATCH v4 24/25] perf tests: Support 'Convert perf time to TSC' test for hybrid

2021-04-16 Thread Jin Yao
Since for "cycles:u' on hybrid platform, it creates two "cycles". So the second evsel in evlist also needs initialization. With this patch, # ./perf test 71 71: Convert perf time to TSC: Ok Signed-off-by: Jin Yao --- tools/perf/

[PATCH v4 23/25] perf tests: Support 'Session topology' test for hybrid

2021-04-16 Thread Jin Yao
Force to create one event "cpu_core/cycles/" by default, otherwise in evlist__valid_sample_type, the checking of 'if (evlist->core.nr_entries == 1)' would be failed. # ./perf test 41 41: Session topology: Ok Signed-off-by: Jin Ya

[PATCH v4 21/25] perf tests: Support 'Track with sched_switch' test for hybrid

2021-04-16 Thread Jin Yao
: Ok Signed-off-by: Jin Yao --- tools/perf/tests/switch-tracking.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 3ebaa758df77..3a12176f8c46 100644 --- a/tools/perf/tests/swit

[PATCH v4 20/25] perf tests: Skip 'Setup struct perf_event_attr' test for hybrid

2021-04-16 Thread Jin Yao
For hybrid, the attr.type consists of pmu type id + original type. There will be much changes for this test. Now we temporarily skip this test case and TODO in future. Signed-off-by: Jin Yao --- tools/perf/tests/attr.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/tests

[PATCH v4 18/25] perf tests: Add hybrid cases for 'Parse event definition strings' test

2021-04-16 Thread Jin Yao
Add basic hybrid test cases for 'Parse event definition strings' test. # perf test 6 6: Parse event definition strings : Ok Signed-off-by: Jin Yao --- tools/perf/tests/parse-events.c | 152 1 file changed, 152 insertions

[PATCH v4 19/25] perf tests: Add hybrid cases for 'Roundtrip evsel->name' test

2021-04-16 Thread Jin Yao
d by 2. # ./perf test 14 14: Roundtrip evsel->name : Ok Signed-off-by: Jin Yao --- tools/perf/tests/evsel-roundtrip-name.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tools/perf/tests/evsel-roundtrip-

[PATCH v4 16/25] perf stat: Warn group events from different hybrid PMU

2021-04-16 Thread Jin Yao
cpu_core/cycles/ 3,914,586 cpu_atom/cycles/ 1.004250966 seconds time elapsed Signed-off-by: Jin Yao --- v4: - No change. tools/perf/builtin-stat.c | 4 +++ tools/perf/util/evlist-hybrid.c| 47 ++ tools/perf/util/evlist-hybrid.h| 2

[PATCH v4 17/25] perf record: Uniquify hybrid event name

2021-04-16 Thread Jin Yao
'cpu_core/cycles/' # Event count (approx.): 22043448 # # Overhead Command Shared ObjectSymbol # ... # ... Signed-off-by: Jin Yao --- v4: - No change. tools/perf/builtin-record.c | 28

[PATCH v4 14/25] perf stat: Add default hybrid events

2021-04-16 Thread Jin Yao
ant to get the original shadow stats. Signed-off-by: Jin Yao --- v4: - No change. tools/perf/builtin-stat.c | 21 + 1 file changed, 21 insertions(+) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 1255af4751c2..0351b99d17a7 100644 --- a/tools/perf/builtin-st

[PATCH v4 15/25] perf stat: Filter out unmatched aggregation for hybrid event

2021-04-16 Thread Jin Yao
/cycles/ S0-D0-C20 2 1,559,589 cpu_core/cycles/ S0-D0-C24 2163,924 cpu_core/cycles/ S0-D0-C28 2376,610 cpu_core/cycles/ 1.003621290 seconds time elapsed Signed-off-by: Jin Yao --- v4: - No change. tools/perf

[PATCH v4 13/25] perf record: Create two hybrid 'cycles' events by default

2021-04-16 Thread Jin Yao
due to the symbol dependency the perf test python would be failed. Signed-off-by: Jin Yao --- v4: - Use PERF_TYPE_HARDWARE (v3 uses PERF_TYPE_HARDWARE_PMU). v3: - Move the major code to new created evlist-hybrid.c. tools/perf/builtin-record.c | 19 +++ tools/perf/util/Build

[PATCH v4 11/25] perf parse-events: Compare with hybrid pmu name

2021-04-16 Thread Jin Yao
event creation. So next only the event with the specified pmu would be created. Signed-off-by: Jin Yao --- v4: - New in v4. tools/perf/util/parse-events-hybrid.c | 21 - tools/perf/util/parse-events-hybrid.h | 3 ++- tools/perf/util/parse-events.c| 5 +++-- tools/perf

[PATCH v4 12/25] perf parse-events: Support event inside hybrid pmu

2021-04-16 Thread Jin Yao
e/r3c/ 1.001989415 seconds time elapsed # perf stat -e cpu_core/r3c,name=EVENT/ -a -- sleep 1 Performance counter stats for 'system wide': 6,819,847 EVENT 1.001795630 seconds time elapsed Signed-off-by: Jin Yao --- v4: - New in v4.

[PATCH v4 10/25] perf parse-events: Create two hybrid raw events

2021-04-16 Thread Jin Yao
time elapsed Signed-off-by: Jin Yao --- v4: - Directly return add_raw_hybrid(). v3: - Raw event creation is moved to parse-events-hybrid.c. tools/perf/util/parse-events-hybrid.c | 38 ++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/parse

[PATCH v4 08/25] perf parse-events: Create two hybrid hardware events

2021-04-16 Thread Jin Yao
/cycles/ 1,965,552 cpu_atom/cycles/ 1.001882711 seconds time elapsed 0x4 in 0x4 indicates the cpu_core pmu. 0x8 in 0x8 indicates the cpu_atom pmu. Signed-off-by: Jin Yao --- v4: - Use PERF_TYPE_HARDWARE (v3 uses PERF_TYPE_HARDWARE_PMU) v3: - Create new

[PATCH v4 06/25] perf pmu: Add hybrid helper functions

2021-04-16 Thread Jin Yao
. Signed-off-by: Jin Yao --- v4: - No change. v3: - Move perf_pmu__has_hybrid from pmu-hybrid.c to pmu.c. We have to add pmu-hybrid.c to python-ext-sources to solve symbol dependency issue found in perf test python. For perf_pmu__has_hybrid, it calls perf_pmu__scan, which is defined

[PATCH v4 07/25] perf stat: Uniquify hybrid event name

2021-04-16 Thread Jin Yao
cpu_core/cycles/" If user configs the name, we still use the user specified name. Signed-off-by: Jin Yao --- v4: - If user configs the name, we still use the user specified name. v3: - No change. tools/perf/builtin-stat.c | 4 tools/perf/util/evsel.h| 1 + tools/perf

[PATCH v4 09/25] perf parse-events: Create two hybrid cache events

2021-04-16 Thread Jin Yao
stats for 'system wide': 24,793 cpu_core/LLC-loads/ 17,255 cpu_atom/LLC-loads/ 1.001970988 seconds time elapsed 0x4 in 0x40002 indicates the cpu_core pmu. 0x8 in 0x80002 indicates the cpu_atom pmu. Signed-off-by: Jin Yao --- v4: - Use

[PATCH v4 05/25] perf pmu: Save detected hybrid pmus to a global pmu list

2021-04-16 Thread Jin Yao
hybrid_pmus' and then next we just need to iterate the list to get all hybrid pmu by using perf_pmu__for_each_hybrid_pmu. Signed-off-by: Jin Yao --- v4: - Check if 'cpus' file is empty. If so, don't create pmu. v3: - No functional change. tools/perf/util/Buil

[PATCH v4 02/25] perf jevents: Support unit value "cpu_core" and "cpu_atom"

2021-04-16 Thread Jin Yao
nt = "period=103,umask=0x80,event=0xd2", .desc = "Counts the number of load ops retired that. Unit: cpu_atom ", .topic = "cache", .pmu = "cpu_atom", }, But if without this patch, the "uncore_" prefix is added before &q

[PATCH v4 03/25] perf pmu: Simplify arguments of __perf_pmu__new_alias

2021-04-16 Thread Jin Yao
Simplify the arguments of __perf_pmu__new_alias() by passing the whole 'struct pme_event' pointer. Signed-off-by: Jin Yao --- v4: - No change. tools/perf/util/pmu.c | 36 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/tools/perf/util/pmu.c

[PATCH v4 04/25] perf pmu: Save pmu name

2021-04-16 Thread Jin Yao
On hybrid platform, one event is available on one pmu (such as, available on cpu_core or on cpu_atom). This patch saves the pmu name to the pmu field of struct perf_pmu_alias. Then next we can know the pmu which the event can be enabled on. Signed-off-by: Jin Yao --- v4: - No change. v3

[PATCH v4 01/25] tools headers uapi: Update tools's copy of linux/perf_event.h

2021-04-16 Thread Jin Yao
-by: Jin Yao --- v4: - Updated by Kan's latest patch, '[PATCH V6 21/25] perf: Extend PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE' include/uapi/linux/perf_event.h | 15 +++ tools/include/uapi/linux/perf_event.h | 15 +++ 2 files changed, 30 insertions(+) diff --git

[PATCH v4 00/25] perf tool: AlderLake hybrid support series 1

2021-04-16 Thread Jin Yao
-hybrid.c/pmu-hybrid.h. This is to pass the perf test python case. Jin Yao (25): tools headers uapi: Update tools's copy of linux/perf_event.h perf jevents: Support unit value "cpu_core" and "cpu_atom" perf pmu: Simplify arguments of __perf_pmu__new_alias perf pmu: Sa

Re: [PATCH v3 12/27] perf parse-events: Support no alias assigned event inside hybrid PMU

2021-04-15 Thread Jin, Yao
Hi Jiri, On 4/16/2021 3:39 AM, Jiri Olsa wrote: On Thu, Apr 15, 2021 at 10:53:33PM +0800, Jin, Yao wrote: SNIP With my current code, static int parse_events__with_hybrid_pmu(struct parse_events_state *parse_state, const char *str, char *pmu_name

Re: [PATCH v3 12/27] perf parse-events: Support no alias assigned event inside hybrid PMU

2021-04-15 Thread Jin, Yao
Hi Jiri, On 4/15/2021 10:11 PM, Jiri Olsa wrote: On Thu, Apr 15, 2021 at 09:36:16PM +0800, Jin, Yao wrote: SNIP + int n = 0; + + list_for_each(pos, list) + n++; + + return n; +} + +static int parse_events__with_hybrid_pmu(struct parse_events_state

Re: [PATCH v3 12/27] perf parse-events: Support no alias assigned event inside hybrid PMU

2021-04-15 Thread Jin, Yao
Hi Jiri, On 4/15/2021 7:03 PM, Jiri Olsa wrote: On Mon, Mar 29, 2021 at 03:00:31PM +0800, Jin Yao wrote: SNIP --- v3: - Rename the patch: 'perf parse-events: Support hardware events inside PMU' --> 'perf parse-events: Support no alias assigned event inside hybrid PMU' - Ma

Re: [PATCH v3 12/27] perf parse-events: Support no alias assigned event inside hybrid PMU

2021-04-11 Thread Jin, Yao
Hi Jiri, On 4/9/2021 9:47 PM, Jiri Olsa wrote: On Mon, Mar 29, 2021 at 03:00:31PM +0800, Jin Yao wrote: SNIP + struct parse_events_state *parse_state) { struct perf_event_attr attr; LIST_HEAD(config_terms); @@ -521,7 +526,7 @@ int

Re: [PATCH v3 11/27] perf pmu: Support 'cycles' and 'branches' inside hybrid PMU

2021-04-11 Thread Jin, Yao
Hi Jiri, On 4/9/2021 9:48 PM, Jiri Olsa wrote: On Mon, Mar 29, 2021 at 03:00:30PM +0800, Jin Yao wrote: On hybrid platform, user may want to enable the hardware event only on one PMU. So following syntax is supported: cpu_core// cpu_atom// # perf stat -e cpu_core/cpu-cycles/ -a -- sleep 1

Re: [PATCH v3 09/27] perf parse-events: Create two hybrid cache events

2021-04-11 Thread Jin, Yao
Hi Jiri, On 4/9/2021 9:48 PM, Jiri Olsa wrote: On Mon, Mar 29, 2021 at 03:00:28PM +0800, Jin Yao wrote: SNIP index 1bbd0ba92ba7..3692fa3c964a 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -458,6 +458,7 @@ int parse_events_add_cache(struct list_head *list

Re: [PATCH v3 10/27] perf parse-events: Create two hybrid raw events

2021-04-11 Thread Jin, Yao
Hi Jiri, On 4/9/2021 9:49 PM, Jiri Olsa wrote: On Mon, Mar 29, 2021 at 03:00:29PM +0800, Jin Yao wrote: SNIP + name, config_terms, pmu); + if (ret) + return ret; + } + + return 0; +} + int

[PATCH] perf report: Fix wrong LBR block sorting

2021-04-06 Thread Jin Yao
157]ld-2.27.so 0.07% 690.09% 17 [intel_pmu_drain_pebs_nhm+432 -> intel_pmu_drain_pebs_nhm+468] [kernel.kallsyms] Now the hottest block is reported at the top of output. Fixes: b65a7d372b1a ("perf hist: Support block formats with comp

[PATCH] perf vendor events: Add missing model numbers

2021-03-29 Thread Jin Yao
Kernel has supported COMETLAKE/COMETLAKE_L to use the SKYLAKE events and supported TIGERLAKE_L/TIGERLAKE/ROCKETLAKE to use the ICELAKE events. But pmu-events mapfile.csv is missing these model numbers. Now add the missing model numbers to mapfile.csv. Signed-off-by: Jin Yao --- tools/perf/pmu

[PATCH v3 19/27] perf tests: Add hybrid cases for 'Parse event definition strings' test

2021-03-29 Thread Jin Yao
Add basic hybrid test cases for 'Parse event definition strings' test. # ./perf test 6 6: Parse event definition strings : Ok Signed-off-by: Jin Yao --- v3: - Use PERF_TYPE_RAW for cpu_core/cycles/ tools/perf/tests/parse-events.c | 170

[PATCH v3 24/27] perf tests: Support 'Session topology' test for hybrid

2021-03-29 Thread Jin Yao
Force to create one event "cpu_core/cycles/" by default, otherwise in evlist__valid_sample_type, the checking of 'if (evlist->core.nr_entries == 1)' would be failed. # ./perf test 41 41: Session topology: Ok Signed-off-by: Ji

[PATCH v3 18/27] perf record: Uniquify hybrid event name

2021-03-29 Thread Jin Yao
'cpu_core/cycles/' # Event count (approx.): 22043448 # # Overhead Command Shared ObjectSymbol # ... # ... Signed-off-by: Jin Yao --- v3: - New patch in v3. tools/perf/builtin-record.c | 28

[PATCH v3 25/27] perf tests: Support 'Convert perf time to TSC' test for hybrid

2021-03-29 Thread Jin Yao
Since for "cycles:u' on hybrid platform, it creates two "cycles". So the second evsel in evlist also needs initialization. With this patch, # ./perf test 71 71: Convert perf time to TSC: Ok Signed-off-by: Jin Yao --- v3: - No fu

[PATCH v3 22/27] perf tests: Support 'Track with sched_switch' test for hybrid

2021-03-29 Thread Jin Yao
: Ok Signed-off-by: Jin Yao --- v3: - No functional change. tools/perf/tests/switch-tracking.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 3ebaa758df77..3a12176f8c46 1006

[PATCH v3 27/27] perf Documentation: Document intel-hybrid support

2021-03-29 Thread Jin Yao
Add some words and examples to help understanding of Intel hybrid perf support. Signed-off-by: Jin Yao --- v3: - No functional change. tools/perf/Documentation/intel-hybrid.txt | 228 ++ tools/perf/Documentation/perf-record.txt | 1 + tools/perf/Documentation/perf

[PATCH v3 23/27] perf tests: Support 'Parse and process metrics' test for hybrid

2021-03-29 Thread Jin Yao
Some events are not supported. Only pick up some cases for hybrid. # ./perf test 67 67: Parse and process metrics : Ok Signed-off-by: Jin Yao --- v3: - No functional change. tools/perf/tests/parse-metric.c | 10 -- 1 file changed, 8

[PATCH v3 26/27] perf tests: Skip 'perf stat metrics (shadow stat) test' for hybrid

2021-03-29 Thread Jin Yao
/instructions/ 841,158,734 cpu_atom/instructions/ 1.002644773 seconds time elapsed Now there is no shadow stat 'insn per cycle' reported. We will support it later and now just skip the 'perf stat metrics (shadow stat) test'. Signed-off-by: Jin Yao --- v3: - No functional

[PATCH v3 21/27] perf tests: Skip 'Setup struct perf_event_attr' test for hybrid

2021-03-29 Thread Jin Yao
9184-4] matches [] expected type=6, got 0 expected config=17179869184, got 0 FAILED './tests/attr/test-stat-C0' - match failure The type matching is failed because one type is 0 but the type of hybrid hardware event is 6. We temporarily skip this test case and TODO in future. Signed-off-by: J

[PATCH v3 20/27] perf tests: Add hybrid cases for 'Roundtrip evsel->name' test

2021-03-29 Thread Jin Yao
d by 2. # ./perf test 14 14: Roundtrip evsel->name : Ok Signed-off-by: Jin Yao --- v3: - No functional change. tools/perf/tests/evsel-roundtrip-name.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tools/p

[PATCH v3 15/27] perf stat: Filter out unmatched aggregation for hybrid event

2021-03-29 Thread Jin Yao
/cycles/ S0-D0-C20 2 1,559,589 cpu_core/cycles/ S0-D0-C24 2163,924 cpu_core/cycles/ S0-D0-C28 2376,610 cpu_core/cycles/ 1.003621290 seconds time elapsed Signed-off-by: Jin Yao --- v3: - No functional change

[PATCH v3 17/27] perf script: Support PERF_TYPE_HARDWARE_PMU and PERF_TYPE_HW_CACHE_PMU

2021-03-29 Thread Jin Yao
For a hybrid system, the perf subsystem doesn't know which PMU the events belong to. So the PMU aware version PERF_TYPE_HARDWARE_PMU and PERF_TYPE_HW_CACHE_PMU are introduced. Now define the new output[] entries for these two types. Signed-off-by: Jin Yao --- v3: - No change. tools/perf

[PATCH v3 14/27] perf stat: Add default hybrid events

2021-03-29 Thread Jin Yao
ant to get the original shadow stats. Signed-off-by: Jin Yao --- v3: - No functional change. tools/perf/builtin-stat.c | 21 + 1 file changed, 21 insertions(+) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 7b2dfe21c5a8..33fda8f55f66 100644 --- a/tools/pe

[PATCH v3 16/27] perf stat: Warn group events from different hybrid PMU

2021-03-29 Thread Jin Yao
cpu_core/cycles/ 3,914,586 cpu_atom/cycles/ 1.004250966 seconds time elapsed Signed-off-by: Jin Yao --- v3: - Change the processing logic. In v2, it just reported the warning and returned error. But in v3, we also disable grouping. tools/perf/builtin-stat.c | 4 +++ to

[PATCH v3 12/27] perf parse-events: Support no alias assigned event inside hybrid PMU

2021-03-29 Thread Jin Yao
se_state->pmu_name is used to identify the pmu where the event should be enabled on. After: # ./perf stat -e cpu_core/LLC-loads/ -a -- sleep 1 Performance counter stats for 'system wide': 24,593 cpu_core/LLC-loads/ 1.003911601 seconds time elapsed Signed-off-b

[PATCH v3 10/27] perf parse-events: Create two hybrid raw events

2021-03-29 Thread Jin Yao
-by: Jin Yao --- v3: - Raw event creation is moved to parse-events-hybrid.c. tools/perf/util/parse-events-hybrid.c | 38 +++ 1 file changed, 38 insertions(+) diff --git a/tools/perf/util/parse-events-hybrid.c b/tools/perf/util/parse-events-hybrid.c index ff2909bfbf86

[PATCH v3 13/27] perf record: Create two hybrid 'cycles' events by default

2021-03-29 Thread Jin Yao
We have to create evlist-hybrid.c otherwise due to the symbol dependency the perf test python would be failed. Signed-off-by: Jin Yao --- v3: - Move the major code to new created evlist-hybrid.c. tools/perf/builtin-record.c | 19 +++ tools/perf

[PATCH v3 11/27] perf pmu: Support 'cycles' and 'branches' inside hybrid PMU

2021-03-29 Thread Jin Yao
ned-off-by: Jin Yao --- v3: - New patch in v3. tools/perf/util/pmu.c | 32 1 file changed, 32 insertions(+) diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index beff29981101..72e5ae5e868e 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pm

[PATCH v3 09/27] perf parse-events: Create two hybrid cache events

2021-03-29 Thread Jin Yao
. 0xa in 0xa indicates the cpu_atom pmu. Signed-off-by: Jin Yao --- v3: - Hybrid cache event creation is moved to parse-events-hybrid.c. tools/perf/util/parse-events-hybrid.c | 23 +++ tools/perf/util/parse-events-hybrid.h | 5 + tools/perf/util/parse-events.c

[PATCH v3 08/27] perf parse-events: Create two hybrid hardware events

2021-03-29 Thread Jin Yao
. 0x4 in 0x4 indicates the cpu_core pmu. 0xa in 0xa indicates the cpu_atom pmu. Signed-off-by: Jin Yao --- v3: - Create new parse-events-hybrid.c/parse-events-hybrid.h - Refine the code tools/perf/util/Build | 1 + tools/perf/util/parse-events-hybrid.c | 97

[PATCH v3 04/27] perf pmu: Save pmu name

2021-03-29 Thread Jin Yao
On hybrid platform, one event is available on one pmu (such as, available on cpu_core or on cpu_atom). This patch saves the pmu name to the pmu field of struct perf_pmu_alias. Then next we can know the pmu which the event can be enabled on. Signed-off-by: Jin Yao --- v3: - Change pmu

[PATCH v3 05/27] perf pmu: Save detected hybrid pmus to a global pmu list

2021-03-29 Thread Jin Yao
n next we just need to iterate the list to get all hybrid pmu by using perf_pmu__for_each_hybrid_pmu. Signed-off-by: Jin Yao --- v3: - No functional change. tools/perf/util/Build| 1 + tools/perf/util/pmu-hybrid.c | 35 +++ tools/perf/util/pmu-hybri

[PATCH v3 06/27] perf pmu: Add hybrid helper functions

2021-03-29 Thread Jin Yao
be failed. Signed-off-by: Jin Yao --- v3: - Move perf_pmu__has_hybrid from pmu-hybrid.c to pmu.c. We have to add pmu-hybrid.c to python-ext-sources to solve symbol dependency issue found in perf test python. For perf_pmu__has_hybrid, it calls perf_pmu__scan, which is defined in pmu.c. It's

[PATCH v3 07/27] perf stat: Uniquify hybrid event name

2021-03-29 Thread Jin Yao
cpu_core/cycles/" Signed-off-by: Jin Yao --- v3: - No functional change. tools/perf/builtin-stat.c | 4 tools/perf/util/stat-display.c | 13 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.

[PATCH v3 02/27] perf jevents: Support unit value "cpu_core" and "cpu_atom"

2021-03-29 Thread Jin Yao
nt = "period=103,umask=0x80,event=0xd2", .desc = "Counts the number of load ops retired that. Unit: cpu_atom ", .topic = "cache", .pmu = "cpu_atom", }, But if without this patch, the "uncore_" prefix is added before &q

[PATCH v3 03/27] perf pmu: Simplify arguments of __perf_pmu__new_alias

2021-03-29 Thread Jin Yao
Simplify the arguments of __perf_pmu__new_alias() by passing the whole 'struct pme_event' pointer. Signed-off-by: Jin Yao --- v3: - No change. tools/perf/util/pmu.c | 36 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/tools/perf/util/pmu.c

[PATCH v3 01/27] tools headers uapi: Update tools's copy of linux/perf_event.h

2021-03-29 Thread Jin Yao
d. Signed-off-by: Jin Yao --- v3: - No change. tools/include/uapi/linux/perf_event.h | 26 ++ 1 file changed, 26 insertions(+) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index ad15e40d7f5d..c0a511eea498 100644 --- a/too

[PATCH v3 00/27] perf tool: AlderLake hybrid support series 1

2021-03-29 Thread Jin Yao
o the right. - Move pmu hybrid functions to new created pmu-hybrid.c/pmu-hybrid.h. This is to pass the perf test python case. Jin Yao (27): tools headers uapi: Update tools's copy of linux/perf_event.h perf jevents: Support unit value "cpu_core" and "cpu_atom" perf pmu:

[PATCH v3 2/2] perf test: Add CVS summary test

2021-03-19 Thread Jin Yao
t; string would not be added, also check with this case. Signed-off-by: Jin Yao --- v3: - New in v3. tools/perf/tests/shell/stat+cvs_summary.sh | 31 ++ 1 file changed, 31 insertions(+) create mode 100755 tools/perf/tests/shell/stat+cvs_summary.sh diff --git a/tools/perf/tests

[PATCH v3 1/2] perf stat: Align CSV output for summary mode

2021-03-19 Thread Jin Yao
,,branch-misses,8013375952,100.00,9.76,of all branches Signed-off-by: Jin Yao --- v3: - No change. v2: - Add new option '--no-cvs-summary'. - Add perf config variable 'stat.no-cvs-summary'. tools/perf/Documentation/perf-stat.txt | 9 + tools/perf/builtin-stat.c | 7

Re: [PATCH v2] perf stat: Align CSV output for summary mode

2021-03-18 Thread Jin, Yao
the default then. Jin, can you please consider adding a 'perf test' shell entry to parse the CSV mode with/without that summary? This way we'll notice when the new normal gets broken. - Arnaldo Thanks Arnaldo! I will post v3 with the perf test script. Thanks Jin Yao

Re: [PATCH v2 11/27] perf parse-events: Support hardware events inside PMU

2021-03-17 Thread Jin, Yao
Hi Jiri, On 3/17/2021 6:06 PM, Jiri Olsa wrote: On Wed, Mar 17, 2021 at 10:12:03AM +0800, Jin, Yao wrote: On 3/16/2021 10:04 PM, Jiri Olsa wrote: On Tue, Mar 16, 2021 at 09:49:42AM +0800, Jin, Yao wrote: SNIP Performance counter stats for 'system wide': 136,655,302

[PATCH v2] perf stat: Align CSV output for summary mode

2021-03-17 Thread Jin Yao
,,branch-misses,8013375952,100.00,9.76,of all branches Signed-off-by: Jin Yao --- v2: - Add new option '--no-cvs-summary'. - Add perf config variable 'stat.no-cvs-summary'. tools/perf/Documentation/perf-stat.txt | 9 + tools/perf/builtin-stat.c | 7 +++ tools/perf/util

Re: [PATCH v2 11/27] perf parse-events: Support hardware events inside PMU

2021-03-16 Thread Jin, Yao
On 3/16/2021 10:04 PM, Jiri Olsa wrote: On Tue, Mar 16, 2021 at 09:49:42AM +0800, Jin, Yao wrote: SNIP Performance counter stats for 'system wide': 136,655,302 cpu_core/branch-instructions/ 1.003171561 seconds time elapsed So we need special rules for both cycles

Re: [PATCH] perf stat: Align CSV output for summary mode

2021-03-16 Thread Jin, Yao
be hidden in the perf config file instead of being on the command line. -Andi That makes sense, thanks Andi! Thanks Jin Yao

Re: [PATCH] perf stat: Align CSV output for summary mode

2021-03-16 Thread Jin, Yao
ver just to get sane output. I like that.. also we'll find out how many people are actually parsing that ;-) jirka Is it serious or just a joke? :) Thanks Jin Yao Or maybe only a perf config option. -Andi

[PATCH] perf stat: Align CSV output for summary mode

2021-03-16 Thread Jin Yao
,,instructions,8012804027,100.00,0.53,insn per cycle summary,1590259,,branches,8012814766,100.00,0.198,M/sec summary,82601,,branch-misses,8012824365,100.00,5.19,of all branches Now it's easy for script to analyse the summary lines. Signed-off-by: Jin Yao --- tools/perf/util/stat

Re: [PATCH v2 16/27] perf evlist: Warn as events from different hybrid PMUs in a group

2021-03-15 Thread Jin, Yao
Hi Jiri, On 3/16/2021 7:03 AM, Jiri Olsa wrote: On Thu, Mar 11, 2021 at 03:07:31PM +0800, Jin Yao wrote: SNIP goto try_again; } + + if (errno == EINVAL && perf_pmu__hybr

Re: [PATCH v2 17/27] perf evsel: Adjust hybrid event and global event mixed group

2021-03-15 Thread Jin, Yao
Hi Jiri, On 3/16/2021 7:04 AM, Jiri Olsa wrote: On Thu, Mar 11, 2021 at 03:07:32PM +0800, Jin Yao wrote: A group mixed with hybrid event and global event is allowed. For example, group leader is 'cpu-clock' and the group member is 'cpu_atom/cycles/'. e.g. perf stat -e '{cpu-clock,cpu_atom

Re: [PATCH v2 10/27] perf parse-events: Create two hybrid cache events

2021-03-15 Thread Jin, Yao
Hi Jiri, On 3/16/2021 7:05 AM, Jiri Olsa wrote: On Thu, Mar 11, 2021 at 03:07:25PM +0800, Jin Yao wrote: SNIP + config_terms, pmu); + if (ret) + return ret; + } + + return 0; +} + int

Re: [PATCH v2 09/27] perf parse-events: Create two hybrid hardware events

2021-03-15 Thread Jin, Yao
Hi Jiri, On 3/16/2021 7:05 AM, Jiri Olsa wrote: On Thu, Mar 11, 2021 at 03:07:24PM +0800, Jin Yao wrote: For hardware events, they have pre-defined configs. The kernel needs to know where the event comes from (e.g. from cpu_core pmu or from cpu_atom pmu). But the perf type 'PERF_TYPE_HARDWARE

Re: [PATCH v2 11/27] perf parse-events: Support hardware events inside PMU

2021-03-15 Thread Jin, Yao
Hi Jiri, On 3/16/2021 1:37 AM, Jiri Olsa wrote: On Mon, Mar 15, 2021 at 10:28:12AM +0800, Jin, Yao wrote: Hi Jiri, On 3/13/2021 3:15 AM, Jiri Olsa wrote: On Thu, Mar 11, 2021 at 03:07:26PM +0800, Jin Yao wrote: On hybrid platform, some hardware events are only available on a specific pmu

Re: [PATCH v2 04/27] perf pmu: Save pmu name

2021-03-15 Thread Jin, Yao
Hi Jiri, On 3/16/2021 7:03 AM, Jiri Olsa wrote: On Thu, Mar 11, 2021 at 03:07:19PM +0800, Jin Yao wrote: On hybrid platform, one event is available on one pmu (such as, available on cpu_core or on cpu_atom). This patch saves the pmu name to the pmu field of struct perf_pmu_alias. Then next we

Re: [PATCH v2 11/27] perf parse-events: Support hardware events inside PMU

2021-03-14 Thread Jin, Yao
Hi Jiri, On 3/13/2021 3:15 AM, Jiri Olsa wrote: On Thu, Mar 11, 2021 at 03:07:26PM +0800, Jin Yao wrote: On hybrid platform, some hardware events are only available on a specific pmu. For example, 'L1-dcache-load-misses' is only available on 'cpu_core' pmu. And even for the event which can

Re: [PATCH v2 09/27] perf parse-events: Create two hybrid hardware events

2021-03-14 Thread Jin, Yao
Hi Jiri, On 3/13/2021 3:15 AM, Jiri Olsa wrote: On Thu, Mar 11, 2021 at 03:07:24PM +0800, Jin Yao wrote: SNIP cycles: 4: 800933425 1002536659 1002536659 cycles: 5: 800928573 1002528386 1002528386 cycles: 6: 800924347 1002520527 1002520527 cycles: 7: 800922009 1002513176

Re: [PATCH v2 07/27] perf evlist: Hybrid event uses its own cpus

2021-03-14 Thread Jin, Yao
Hi Jiri, On 3/13/2021 3:15 AM, Jiri Olsa wrote: On Thu, Mar 11, 2021 at 03:07:22PM +0800, Jin Yao wrote: On hybrid platform, atom events can be only enabled on atom CPUs. Core events can be only enabled on core CPUs. So for a hybrid event, it can be only enabled on it's own CPUs

[PATCH v2 25/27] perf tests: Support 'Convert perf time to TSC' test for hybrid

2021-03-10 Thread Jin Yao
Since for "cycles:u' on hybrid platform, it creates two "cycles". So the second evsel in evlist also needs initialization. With this patch, root@otcpl-adl-s-2:~# ./perf test 71 71: Convert perf time to TSC: Ok Signed-off-by: Jin Yao --- t

[PATCH v2 26/27] perf tests: Skip 'perf stat metrics (shadow stat) test' for hybrid

2021-03-10 Thread Jin Yao
/instructions/ 841,158,734 cpu_atom/instructions/ 1.002644773 seconds time elapsed Now there is no shadow stat 'insn per cycle' reported. We will support it later and now just skip the 'perf stat metrics (shadow stat) test'. Signed-off-by: Jin Yao --- tools/perf/tests/shell

[PATCH v2 27/27] perf Documentation: Document intel-hybrid support

2021-03-10 Thread Jin Yao
Add some words and examples to help understanding of Intel hybrid perf support. Signed-off-by: Jin Yao --- tools/perf/Documentation/intel-hybrid.txt | 228 ++ tools/perf/Documentation/perf-record.txt | 1 + tools/perf/Documentation/perf-stat.txt| 2 + 3 files

[PATCH v2 19/27] perf tests: Add hybrid cases for 'Parse event definition strings' test

2021-03-10 Thread Jin Yao
Add basic hybrid test cases for 'Parse event definition strings' test. root@otcpl-adl-s-2:~# ./perf test 6 6: Parse event definition strings : Ok Signed-off-by: Jin Yao --- tools/perf/tests/parse-events.c | 171 1 file changed

[PATCH v2 21/27] perf tests: Skip 'Setup struct perf_event_attr' test for hybrid

2021-03-10 Thread Jin Yao
pected type=6, got 0 expected config=17179869184, got 0 FAILED './tests/attr/test-stat-C0' - match failure The type matching is failed because one type is 0 but the type of hybrid hardware event is 6. We temporarily skip this test case and TODO in future. Signed-off-by: Jin Yao --- tools/perf

[PATCH v2 24/27] perf tests: Support 'Session topology' test for hybrid

2021-03-10 Thread Jin Yao
Force to create one event "cpu_core/cycles/" by default, otherwise in evlist__valid_sample_type, the checking of 'if (evlist->core.nr_entries == 1)' would be failed. root@otcpl-adl-s-2:~# ./perf test 41 41: Session topology: Ok Signe

[PATCH v2 23/27] perf tests: Support 'Parse and process metrics' test for hybrid

2021-03-10 Thread Jin Yao
Some events are not supported. Only pick up some cases for hybrid. root@otcpl-adl-s-2:~# ./perf test 67 67: Parse and process metrics : Ok Signed-off-by: Jin Yao --- tools/perf/tests/parse-metric.c | 11 --- 1 file changed, 8 insertions(+), 3

[PATCH v2 20/27] perf tests: Add hybrid cases for 'Roundtrip evsel->name' test

2021-03-10 Thread Jin Yao
d by 2. root@otcpl-adl-s-2:~# ./perf test 14 14: Roundtrip evsel->name : Ok Signed-off-by: Jin Yao --- tools/perf/tests/evsel-roundtrip-name.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tools/perf/te

[PATCH v2 22/27] perf tests: Support 'Track with sched_switch' test for hybrid

2021-03-10 Thread Jin Yao
: Track with sched_switch : Ok Signed-off-by: Jin Yao --- tools/perf/tests/switch-tracking.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 3ebaa758df77..13a11ce51a1a 100644 ---

[PATCH v2 16/27] perf evlist: Warn as events from different hybrid PMUs in a group

2021-03-10 Thread Jin Yao
different hybrid PMUs Performance counter stats for 'sleep 1': cpu_core/cycles/ cpu_atom/cycles/ 1.002585908 seconds time elapsed Signed-off-by: Jin Yao --- tools/perf/builtin-record.c | 3 +++ tools/perf/builtin-stat.c | 7 ++ tools/perf/util/evlist

[PATCH v2 17/27] perf evsel: Adjust hybrid event and global event mixed group

2021-03-10 Thread Jin Yao
ock, it also has 8 cpus aggregation (cpu16-cpu23, but not all cpus), the code should be improved. Now one warning is displayed: "WARNING: for cpu-clock, some CPU counts not read". Signed-off-by: Jin Yao --- tools/perf/util/evsel.c | 105 ++-- tools/per

[PATCH v2 18/27] perf script: Support PERF_TYPE_HARDWARE_PMU and PERF_TYPE_HW_CACHE_PMU

2021-03-10 Thread Jin Yao
For a hybrid system, the perf subsystem doesn't know which PMU the events belong to. So the PMU aware version PERF_TYPE_HARDWARE_PMU and PERF_TYPE_HW_CACHE_PMU are introduced. Now define the new output[] entries for these two types. Signed-off-by: Jin Yao --- tools/perf/builtin-script.c | 24

[PATCH v2 15/27] perf stat: Filter out unmatched aggregation for hybrid event

2021-03-10 Thread Jin Yao
/cycles/ S0-D0-C20 2 1,603,435,286 cpu_core/cycles/ S0-D0-C24 2 1,603,387,250 cpu_core/cycles/ S0-D0-C28 2 1,604,173,183 cpu_core/cycles/ Signed-off-by: Jin Yao --- tools/perf/util/stat-display.c | 20 1 file changed

[PATCH v2 14/27] perf stat: Add default hybrid events

2021-03-10 Thread Jin Yao
it's just 'M/sec'. The perf_stat__update_shadow_stats and perf_stat__print_shadow_stats need to be improved in future if we want to get the original shadow stats. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/

[PATCH v2 13/27] perf evlist: Create two hybrid 'cycles' events by default

2021-03-10 Thread Jin Yao
group_fd -1 flags 0x8 = 28 sys_perf_event_open: pid 22300 cpu 23 group_fd -1 flags 0x8 = 29 ... We can see one core 'cycles' (0x4) is enabled on cpu0-cpu15 and atom 'cycles' (0xa) is enabled on cpu16-cpu23. Signed-off-by: Jin Yao --- tools/perf/builtin-record.c | 10

[PATCH v2 11/27] perf parse-events: Support hardware events inside PMU

2021-03-10 Thread Jin Yao
275 Performance counter stats for 'taskset -c 16 ./triad_loop': 603,961,400 cpu_atom/cycles/ (99.68%) 3,548 cpu_atom/LLC-loads/ (99.68%) 0.344904585 seconds time

[PATCH v2 12/27] perf parse-events: Support hybrid raw events

2021-03-10 Thread Jin Yao
for './triad_loop': 449,000,613 cpu_core/r3c/ 0.294859229 seconds time elapsed Signed-off-by: Jin Yao --- tools/perf/util/parse-events.c | 56 +- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/parse-events.c b/tools

  1   2   3   4   5   6   7   8   9   10   >