qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/3] meson: generate trace points for qmp commands


From: Vladimir Sementsov-Ogievskiy
Subject: [PATCH 3/3] meson: generate trace points for qmp commands
Date: Tue, 21 Dec 2021 20:35:02 +0100

I need help with this thing. Now it works like this:

make -j9
ninja: error: 
'/work/src/qemu/up/up-trace-qmp-commands/build/qapi/qapi-commands-authz.trace-events',
 needed by 'trace/trace-events-all', missing and no known rule to make it
make[1]: *** [Makefile:162: run-ninja] Error 1
make[1]: Leaving directory '/work/src/qemu/up/up-trace-qmp-commands/build'
make: *** [GNUmakefile:11: all] Error 2

OK, let's try to make it by hand:

make qapi/qapi-commands-authz.trace-events
changing dir to build for make "qapi/qapi-commands-authz.trace-events"...
make[1]: Entering directory '/work/src/qemu/up/up-trace-qmp-commands/build'
  GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 
tests/fp/berkeley-softfloat-3 dtc capstone slirp
[1/1] Generating shared QAPI source files with a custom command
make[1]: Leaving directory '/work/src/qemu/up/up-trace-qmp-commands/build'

It works! So meson doesn't understand that absolute path is the same
as relative.. But I failed to make it the correct way :(

And after it, just run "make" again and it build the whole project.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 meson.build       |  1 +
 qapi/meson.build  |  4 +++-
 trace/meson.build | 10 +++++++---
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index f45ecf31bd..20d32fd20d 100644
--- a/meson.build
+++ b/meson.build
@@ -38,6 +38,7 @@ qemu_icondir = get_option('datadir') / 'icons'
 
 config_host_data = configuration_data()
 genh = []
+qapi_trace_events = []
 
 target_dirs = config_host['TARGET_DIRS'].split()
 have_linux_user = false
diff --git a/qapi/meson.build b/qapi/meson.build
index c0c49c15e4..333ca60583 100644
--- a/qapi/meson.build
+++ b/qapi/meson.build
@@ -114,7 +114,9 @@ foreach module : qapi_all_modules
       'qapi-events-@0@.h'.format(module),
       'qapi-commands-@0@.c'.format(module),
       'qapi-commands-@0@.h'.format(module),
+      'qapi-commands-@0@.trace-events'.format(module),
     ]
+    qapi_trace_events += ['qapi-commands-@0@.trace-events'.format(module)]
   endif
   if module.endswith('-target')
     qapi_specific_outputs += qapi_module_outputs
@@ -126,7 +128,7 @@ endforeach
 qapi_files = custom_target('shared QAPI source files',
   output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs,
   input: [ files('qapi-schema.json') ],
-  command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ],
+  command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@', '--add-trace-points' ],
   depend_files: [ qapi_inputs, qapi_gen_depends ])
 
 # Now go through all the outputs and add them to the right sourceset.
diff --git a/trace/meson.build b/trace/meson.build
index 573dd699c6..77e44fa68d 100644
--- a/trace/meson.build
+++ b/trace/meson.build
@@ -2,10 +2,14 @@
 specific_ss.add(files('control-target.c'))
 
 trace_events_files = []
-foreach dir : [ '.' ] + trace_events_subdirs
-  trace_events_file = meson.project_source_root() / dir / 'trace-events'
+foreach path : [ '.' ] + trace_events_subdirs + qapi_trace_events
+  if path.contains('trace-events')
+    trace_events_file = meson.project_build_root() / 'qapi' / path
+  else
+    trace_events_file = meson.project_source_root() / path / 'trace-events'
+  endif
   trace_events_files += [ trace_events_file ]
-  group_name = dir == '.' ? 'root' : dir.underscorify()
+  group_name = path == '.' ? 'root' : path.underscorify()
   group = '--group=' + group_name
   fmt = '@0@-' + group_name + '.@1@'
 
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]