diff mbox series

[v4,06/13] meson: add trace_events_config[]

Message ID 20210601132414.432430-7-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series fix tracing for modules | expand

Commit Message

Gerd Hoffmann June 1, 2021, 1:24 p.m. UTC
It's an array of dicts, where each dict holds the configuration for one
trace-events file.  For now just fill it from trace_events_subdirs.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 meson.build       |  1 +
 trace/meson.build | 18 +++++++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index a45f1a844f13..84a9e17533cb 100644
--- a/meson.build
+++ b/meson.build
@@ -1774,6 +1774,7 @@  target_user_arch = {}
 
 # TODO: add each directory to the subdirs from its own meson.build, once
 # we have those
+trace_events_config = []
 trace_events_subdirs = [
   'crypto',
   'qapi',
diff --git a/trace/meson.build b/trace/meson.build
index 08f83a15c316..bc946495a714 100644
--- a/trace/meson.build
+++ b/trace/meson.build
@@ -2,10 +2,22 @@ 
 specific_ss.add(files('control-target.c'))
 
 trace_events_files = []
-foreach dir : [ '.' ] + trace_events_subdirs
-  trace_events_file = meson.source_root() / dir / 'trace-events'
+
+trace_events_config += {
+  'file'  : meson.source_root() / 'trace-events',
+  'group' : 'root',
+}
+foreach dir : trace_events_subdirs
+  trace_events_config += {
+    'file'  : meson.source_root() / dir / 'trace-events',
+    'group' : dir.underscorify(),
+  }
+endforeach
+
+foreach c : trace_events_config
+  trace_events_file = c.get('file')
   trace_events_files += [ trace_events_file ]
-  group_name = dir == '.' ? 'root' : dir.underscorify()
+  group_name = c.get('group')
   group = '--group=' + group_name
   fmt = '@0@-' + group_name + '.@1@'