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 archite

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

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

2021-04-16 Thread Jin Yao
8 cpu_core/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: J

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

[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

[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

[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
5,438,125 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

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

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

2021-04-16 Thread Jin Yao
ats need to be improved in future if we want 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..03

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

2021-04-16 Thread Jin Yao
59,350 cpu_core/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

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

2021-04-16 Thread Jin Yao
have to create evlist-hybrid.c otherwise 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 | 1

[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
'system wide': 5,072,048 cpu_core/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

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

2021-04-16 Thread Jin Yao
2289965 seconds 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/

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

2021-04-16 Thread Jin Yao
6,744,979 cpu_core/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_HA

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

2021-04-16 Thread Jin Yao
thon would be failed. 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,

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

2021-04-16 Thread Jin Yao
o: "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 +

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

2021-04-16 Thread Jin Yao
ormance counter 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

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

2021-04-16 Thread Jin Yao
;perf_pmu__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 functi

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

[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
ed. Signed-off-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

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

2021-04-16 Thread Jin Yao
fy the arguments of __perf_pmu__new_alias() by passing the 'struct pme_event' pointer. - Check sysfs validity before access. - Use pmu style event name, such as "cpu_core/cycles/". - Move command output two chars to the right. - Move pmu hybrid functions to new created pmu-hyb

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 hybr

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
[get-dynamic-info.h:131 -> get-dynamic-info.h: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: b65a7d37

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

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

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

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

[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

[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
8 cpu_core/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

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

2021-03-29 Thread Jin Yao
179869184-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. S

[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
59,350 cpu_core/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: -

[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

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

2021-03-29 Thread Jin Yao
ats need to be improved in future if we want 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 7b2

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

2021-03-29 Thread Jin Yao
5,438,125 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 |

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

2021-03-29 Thread Jin Yao
would be called during parsing. The parse_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/

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

2021-03-29 Thread Jin Yao
pe. Signed-off-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 ind

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

2021-03-29 Thread Jin Yao
-1 cpu 23 group_fd -1 flags 0x8 = 29 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-recor

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

2021-03-29 Thread Jin Yao
ranches/ -a -- sleep 1 Performance counter stats for 'system wide': 490,951 cpu_core/branches/ 1.003693946 seconds time elapsed Signed-off-by: Jin Yao --- v3: - New patch in v3. tools/perf/util/pmu.c | 32 1 file cha

[PATCH v3 09/27] perf parse-events: Create two hybrid cache 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: - 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

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

2021-03-29 Thread Jin Yao
ime elapsed type 6 is PERF_TYPE_HARDWARE_PMU. 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

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

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

2021-03-29 Thread Jin Yao
d_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 --- v3: - No functional change. tools/perf/util/Build| 1 + tools/perf/util/pmu-hybrid.c | 35 +++ tools

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

2021-03-29 Thread Jin Yao
test python would 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 de

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

2021-03-29 Thread Jin Yao
o: "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/bui

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

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

2021-03-29 Thread Jin Yao
ch is upstreamed. 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 1

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

2021-03-29 Thread Jin Yao
;struct pme_event' pointer. - Check sysfs validity before access. - Use pmu style event name, such as "cpu_core/cycles/". - Move command output two chars to the right. - Move pmu hybrid functions to new created pmu-hybrid.c/pmu-hybrid.h. This is to pass the perf test python case. J

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

2021-03-19 Thread Jin Yao
y" 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/

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

2021-03-19 Thread Jin Yao
4,,branches,8013366204,100.00,69.081,K/sec 54021,,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/p

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

2021-03-18 Thread Jin, Yao
. Fair enough, lets fix 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': 1

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

2021-03-17 Thread Jin Yao
4,,branches,8013366204,100.00,69.081,K/sec 54021,,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

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 b

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

2021-03-16 Thread Jin, Yao
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
ption forever 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
summary,7954691,,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

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

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_HAR

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 th

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

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

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

2021-03-10 Thread Jin Yao
8 cpu_core/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: J

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

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

2021-03-10 Thread Jin Yao
[] 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: Jin Yao

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

[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
35 35: 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/u

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

2021-03-10 Thread Jin Yao
cpu23 are set with valid group fd (cpu_atom/cycles/'s fd on that cpu). For counting results, cpu_atom/cycles/ has 8 cpus aggregation , that's correct. But for cpu-clock, it also has 8 cpus aggregation (cpu16-cpu23, but not all cpus), the code should be improved. Now one warning is displayed

[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

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

2021-03-10 Thread Jin Yao
31,725 cpu_core/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

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

2021-03-10 Thread Jin Yao
shadow stats looks a bit different, now 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

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

2021-03-10 Thread Jin Yao
unter stats 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/ut

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

2021-03-10 Thread Jin Yao
x4 indicates the cpu_core pmu. 0xa in 0xa indicates the cpu_atom pmu. Signed-off-by: Jin Yao --- tools/perf/util/parse-events.c | 54 +- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/parse-events.c b/tool

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

2021-03-10 Thread Jin Yao
sys_perf_event_open: pid 22300 cpu 22 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. S

  1   2   3   4   5   6   7   8   9   10   >