summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Krummenacher <max.oss.09@gmail.com>2021-11-22 17:34:58 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-12 16:42:13 +0100
commit8a0766f6f50b993810be7d35e20188e63eae2eab (patch)
tree95c198e9afc1c7d3ccdc23e4f9f856f10c2451ac
parentffb6c5c902c367d5eb82b84848333404649e4af6 (diff)
downloadpoky-8a0766f6f50b993810be7d35e20188e63eae2eab.tar.gz
perf: sort-pmuevents: don't drop elements
If a struct element neither has an element cpuid or name it gets silenty dropped. Kernel 5.15 for some ARCHs have at least one array of structs matching this. e.g. for arm pmu-events.c: |#include "pmu-events/pmu-events.h" struct pmu_events_map pmu_events_map[] = { { .cpuid = 0, .version = 0, .type = 0, .table = 0, }, }; struct pmu_sys_events pmu_sys_event_tables[] = { { .table = 0 }, }; Before this patch the second struct is translated to an empty array:: struct pmu_sys_events pmu_sys_event_tables[] = { }; (From OE-Core rev: a6cc268224194218809b56874c70b87c7df4a94f) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> (cherry picked from commit e1382583cd5060be301afaa9998ccf250cc8bca3) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xmeta/recipes-kernel/perf/perf/sort-pmuevents.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/recipes-kernel/perf/perf/sort-pmuevents.py b/meta/recipes-kernel/perf/perf/sort-pmuevents.py
index 5ddf0f144f..4f841eb822 100755
--- a/meta/recipes-kernel/perf/perf/sort-pmuevents.py
+++ b/meta/recipes-kernel/perf/perf/sort-pmuevents.py
@@ -61,6 +61,8 @@ for struct in re.findall( struct_block_regex, data ):
61 #print( " name found: %s" % name.group(1) ) 61 #print( " name found: %s" % name.group(1) )
62 entry_dict[struct[1]]['fields'][name.group(1)] = entry 62 entry_dict[struct[1]]['fields'][name.group(1)] = entry
63 63
64 if not entry_dict[struct[1]]['fields']:
65 entry_dict[struct[1]]['fields']['0'] = entry
64 66
65# created ordered dictionaries from the captured values. These are ordered by 67# created ordered dictionaries from the captured values. These are ordered by
66# a sorted() iteration of the keys. We don't care about the order we read 68# a sorted() iteration of the keys. We don't care about the order we read