Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:
Add trace generation disabled by default and new option --gen-trace to
enable it. The next commit will enable it for qapi/, but not for qga/
and tests/. Making it work for the latter two would involve some Meson
hackery to ensure we generate the trace-events files before trace-tool
uses them. Since we don't actually support tracing there, we'll bypass
that problem.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
scripts/qapi/commands.py | 91 +++++++++++++++++++++++++++++++++++-----
scripts/qapi/main.py | 14 +++++--
2 files changed, 91 insertions(+), 14 deletions(-)
diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py
index 17e5ed2414..fa90b6246b 100644
--- a/scripts/qapi/commands.py
+++ b/scripts/qapi/commands.py
[...]
@@ -265,6 +319,17 @@ def _begin_user_module(self, name: str) -> None:
''',
commands=commands, visit=visit))
+
+ if self._gen_tracing and commands != 'qapi-commands':
+ self._genc.add(mcgen('''
+#include "trace/trace-qapi.h"
I believe this include is superfluous.