• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisãob83a80e831137d57eadd3b91b74d06bf9d4a3f36 (tree)
Hora2022-01-27 19:26:40
AutorVladimir Sementsov-Ogievskiy <vsementsov@virt...>
CommiterMarkus Armbruster

Mensagem de Log

meson: generate trace events for qmp commands

1. Use --gen-trace when generate qmp commands
2. Add corresponding .trace-events files as outputs in qapi_files

custom target

3. Define global qapi_trace_events list of .trace-events file targets,

to fill in trace/qapi.build and to use in trace/meson.build

4. In trace/meson.build use the new array as an additional source of

.trace_events files to be processed

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220126161130.3240892-5-vsementsov@virtuozzo.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>

Mudança Sumário

Diff

--- a/meson.build
+++ b/meson.build
@@ -41,6 +41,7 @@ qemu_icondir = get_option('datadir') / 'icons'
4141
4242 config_host_data = configuration_data()
4343 genh = []
44+qapi_trace_events = []
4445
4546 target_dirs = config_host['TARGET_DIRS'].split()
4647 have_linux_user = false
@@ -2557,6 +2558,8 @@ if 'CONFIG_VHOST_USER' in config_host
25572558 vhost_user = libvhost_user.get_variable('vhost_user_dep')
25582559 endif
25592560
2561+# NOTE: the trace/ subdirectory needs the qapi_trace_events variable
2562+# that is filled in by qapi/.
25602563 subdir('qapi')
25612564 subdir('qobject')
25622565 subdir('stubs')
--- a/qapi/meson.build
+++ b/qapi/meson.build
@@ -114,6 +114,7 @@ foreach module : qapi_all_modules
114114 'qapi-events-@0@.h'.format(module),
115115 'qapi-commands-@0@.c'.format(module),
116116 'qapi-commands-@0@.h'.format(module),
117+ 'qapi-commands-@0@.trace-events'.format(module),
117118 ]
118119 endif
119120 if module.endswith('-target')
@@ -126,7 +127,7 @@ endforeach
126127 qapi_files = custom_target('shared QAPI source files',
127128 output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs,
128129 input: [ files('qapi-schema.json') ],
129- command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ],
130+ command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@', '--gen-trace' ],
130131 depend_files: [ qapi_inputs, qapi_gen_depends ])
131132
132133 # Now go through all the outputs and add them to the right sourceset.
@@ -137,6 +138,9 @@ foreach output : qapi_util_outputs
137138 if output.endswith('.h')
138139 genh += qapi_files[i]
139140 endif
141+ if output.endswith('.trace-events')
142+ qapi_trace_events += qapi_files[i]
143+ endif
140144 util_ss.add(qapi_files[i])
141145 i = i + 1
142146 endforeach
@@ -145,6 +149,9 @@ foreach output : qapi_specific_outputs + qapi_nonmodule_outputs
145149 if output.endswith('.h')
146150 genh += qapi_files[i]
147151 endif
152+ if output.endswith('.trace-events')
153+ qapi_trace_events += qapi_files[i]
154+ endif
148155 specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: qapi_files[i])
149156 i = i + 1
150157 endforeach
--- a/trace/meson.build
+++ b/trace/meson.build
@@ -2,10 +2,15 @@
22 specific_ss.add(files('control-target.c'))
33
44 trace_events_files = []
5-foreach dir : [ '.' ] + trace_events_subdirs
6- trace_events_file = meson.project_source_root() / dir / 'trace-events'
5+foreach item : [ '.' ] + trace_events_subdirs + qapi_trace_events
6+ if item in qapi_trace_events
7+ trace_events_file = item
8+ group_name = item.full_path().split('/')[-1].underscorify()
9+ else
10+ trace_events_file = meson.project_source_root() / item / 'trace-events'
11+ group_name = item == '.' ? 'root' : item.underscorify()
12+ endif
713 trace_events_files += [ trace_events_file ]
8- group_name = dir == '.' ? 'root' : dir.underscorify()
914 group = '--group=' + group_name
1015 fmt = '@0@-' + group_name + '.@1@'
1116