Hi all,

gentle ping with some people CC'ed.

Regards,
Lucas

Am Dienstag, dem 21.06.2022 um 19:02 +0200 schrieb Lucas Stach:
> Commit e1382583cd50 ("perf: sort-pmuevents: don't drop elements") tried
> to fix a case where the array terminator elements were dropped from the
> sorted list breaking the build, but it only worked for the case where
> the terminator is the only element of the array. When the array has other
> elements the terminator will still be silently dropped, causing invalid
> memory accesses at runtime when the perf utility iterates over the array.
> 
> Fix this by treating any unmatched entry as an array terminator and also
> add a comment to make it a little more clear how things are ending up at
> the right position in the sorted list.
> 
> Signed-off-by: Lucas Stach <[email protected]>
> ---
>  meta/recipes-kernel/perf/perf/sort-pmuevents.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-kernel/perf/perf/sort-pmuevents.py 
> b/meta/recipes-kernel/perf/perf/sort-pmuevents.py
> index 09ba3328a7ab..0362f2d8fabc 100755
> --- a/meta/recipes-kernel/perf/perf/sort-pmuevents.py
> +++ b/meta/recipes-kernel/perf/perf/sort-pmuevents.py
> @@ -62,7 +62,10 @@ for struct in re.findall( struct_block_regex, data ):
>              #print( "    name found: %s" % name.group(1) )
>              entry_dict[struct[2]]['fields'][name.group(1)] = entry
>  
> -        if not entry_dict[struct[2]]['fields']:
> +        # unmatched entries are most likely array terminators and
> +        # should end up as the last element in the sorted list, which
> +        # is achieved by using '0' as the key
> +        if not cpuid and not name:
>              entry_dict[struct[2]]['fields']['0'] = entry
>  
>  # created ordered dictionaries from the captured values. These are ordered by
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#169238): 
https://lists.openembedded.org/g/openembedded-core/message/169238
Mute This Topic: https://lists.openembedded.org/mt/92954692/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to