All of lore.kernel.org
 help / color / mirror / Atom feed
From: bruce.ashfield@gmail.com
To: richard.purdie@linuxfoundation.org
Cc: openembedded-core@lists.openembedded.org, TicoTimo@gmail.com,
	trevor.gamblin@windriver.com
Subject: [PATCH 19/20] perf: sort-pmuevents: don't drop elements
Date: Wed, 24 Nov 2021 16:14:25 -0500	[thread overview]
Message-ID: <3fe4037143c8e9b1ff0e1d15efe0a02ecb501e81.1637788184.git.bruce.ashfield@gmail.com> (raw)
In-Reply-To: <cover.1637788184.git.bruce.ashfield@gmail.com>

From: Max Krummenacher <max.oss.09@gmail.com>

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[] = {
};

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/recipes-kernel/perf/perf/sort-pmuevents.py | 2 ++
 1 file changed, 2 insertions(+)

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 ):
             #print( "    name found: %s" % name.group(1) )
             entry_dict[struct[1]]['fields'][name.group(1)] = entry
         
+        if not entry_dict[struct[1]]['fields']:
+            entry_dict[struct[1]]['fields']['0'] = entry
 
 # created ordered dictionaries from the captured values. These are ordered by
 # a sorted() iteration of the keys. We don't care about the order we read
-- 
2.19.1



  parent reply	other threads:[~2021-11-24 21:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 21:14 [PATCH 00/20 v2] kernel: consolidated pull request bruce.ashfield
2021-11-24 21:14 ` [PATCH 01/20] linux-yocto-dev: bump to v5.16+ bruce.ashfield
2021-11-24 21:14 ` [PATCH 02/20] kernel: export native PKGCONFIG variables bruce.ashfield
2021-11-24 21:14 ` [PATCH 03/20] python: introduce python3-dtschema bruce.ashfield
2021-11-25 17:36   ` [OE-core] " Khem Raj
2021-11-25 17:51     ` Bruce Ashfield
2021-11-25 17:53       ` Khem Raj
2021-11-25 18:00         ` Bruce Ashfield
2021-11-24 21:14 ` [PATCH 04/20] python: import jsonpointer from meta-python bruce.ashfield
2021-11-24 21:14 ` [PATCH 05/20] python: import jsonschema " bruce.ashfield
2021-11-24 21:14 ` [PATCH 06/20] python: import idna " bruce.ashfield
2021-11-24 21:14 ` [PATCH 07/20] python: import rfc3339-validator " bruce.ashfield
2021-11-24 21:14 ` [PATCH 08/20] python: import rfc3986-validator " bruce.ashfield
2021-11-24 21:14 ` [PATCH 09/20] python: import webcolors " bruce.ashfield
2021-11-24 21:14 ` [PATCH 10/20] python: import ruamel-yaml " bruce.ashfield
2021-11-24 21:14 ` [PATCH 11/20] python: import pyrsistent " bruce.ashfield
2021-11-24 21:14 ` [PATCH 12/20] python: import rfc3987 from meta-pyton bruce.ashfield
2021-11-24 21:14 ` [PATCH 13/20] python: import strict-rfc3339 from meta-python bruce.ashfield
2021-11-24 21:14 ` [PATCH 14/20] python: import vcversioner " bruce.ashfield
2021-11-24 21:14 ` [PATCH 15/20] maintainers: update for kernel dtschema checking dependencies bruce.ashfield
2021-11-24 21:14 ` [PATCH 16/20] linux-yocto: export pkgconfig variables to devshell bruce.ashfield
2021-11-24 21:14 ` [PATCH 17/20] kernel: introduce python3-dtschema-wrapper bruce.ashfield
2021-11-24 21:14 ` [PATCH 18/20] linux-yocto-dev: introduce dt-validation PACKAGECONFIG bruce.ashfield
2021-11-24 21:14 ` bruce.ashfield [this message]
2021-11-24 21:14 ` [PATCH 20/20] perf: sort-pmuevents: allow for additional type qualifiers and storage class bruce.ashfield
2022-03-14 21:13   ` Ferry Toth
  -- strict thread matches above, loose matches on Subject: below --
2021-11-23 21:57 [PATCH 00/20] kernel/kernel-yocto: consolidated pull request bruce.ashfield
2021-11-23 21:57 ` [PATCH 19/20] perf: sort-pmuevents: don't drop elements bruce.ashfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3fe4037143c8e9b1ff0e1d15efe0a02ecb501e81.1637788184.git.bruce.ashfield@gmail.com \
    --to=bruce.ashfield@gmail.com \
    --cc=TicoTimo@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=trevor.gamblin@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.