[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 3/7] qapi/commands: Optionally generate trace for QMP comm
|
From: |
Markus Armbruster |
|
Subject: |
Re: [PATCH v6 3/7] qapi/commands: Optionally generate trace for QMP commands |
|
Date: |
Thu, 27 Jan 2022 08:24:13 +0100 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
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.
> +#include "qapi/qmp/qjson.h"
> +#include "trace/trace-%(nm)s_trace_events.h"
> +''',
> + nm=c_name(commands, protect=False)))
> + # We use c_name(commands, protect=False) to turn '-' into '_', to
> + # match .underscorify() in trace/meson.build
> +
> self._genh.add(mcgen('''
> #include "%(types)s.h"
>
[...]
- [PATCH v6 0/7] trace qmp commands, Vladimir Sementsov-Ogievskiy, 2022/01/26
- [PATCH v6 1/7] qapi/gen: Add FOO.trace-events output module, Vladimir Sementsov-Ogievskiy, 2022/01/26
- [PATCH v6 2/7] qapi/commands: refactor error handling code, Vladimir Sementsov-Ogievskiy, 2022/01/26
- [PATCH v6 3/7] qapi/commands: Optionally generate trace for QMP commands, Vladimir Sementsov-Ogievskiy, 2022/01/26
- Re: [PATCH v6 3/7] qapi/commands: Optionally generate trace for QMP commands,
Markus Armbruster <=
- [PATCH v6 7/7] qapi: generate trace events by default, Vladimir Sementsov-Ogievskiy, 2022/01/26
- [PATCH v6 4/7] meson: generate trace events for qmp commands, Vladimir Sementsov-Ogievskiy, 2022/01/26
- [PATCH v6 5/7] docs/qapi-code-gen: update to cover trace events code generation, Vladimir Sementsov-Ogievskiy, 2022/01/26
- [PATCH v6 6/7] meson: document, why we don't generate trace events for tests/ and qga/, Vladimir Sementsov-Ogievskiy, 2022/01/26