qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, michael.roth@amd.com, armbru@redhat.com,
	vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com,
	kwolf@redhat.com, pbonzini@redhat.com
Subject: [PATCH v6 7/7] qapi: generate trace events by default
Date: Wed, 26 Jan 2022 17:11:30 +0100	[thread overview]
Message-ID: <20220126161130.3240892-8-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20220126161130.3240892-1-vsementsov@virtuozzo.com>

We don't generate trace events for tests/ and qga/ because that it is
not simple and not necessary. We have corresponding comments in both
tests/meson.build and qga/meson.build.

Still to not miss possible future qapi code generation call, and not to
forget to enable trace events generation, let's enable it by default.
So, turn option --gen-trace into opposite --no-trace-events and use new
option only in tests/ and qga/ where we already have good comments why
we don't generate trace events code.

Note that this commit enables trace-events generation for qapi-gen.py
call from tests/qapi-schema/meson.build and storage-daemon/meson.build.
Still, both are kind of noop: tests/qapi-schema/ doesn't seem to
generate any QMP command code and no .trace-events files anyway,
storage-daemon/ uses common QMP command implementations and just
generate empty .trace-events

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 qapi/meson.build     | 2 +-
 qga/meson.build      | 3 ++-
 scripts/qapi/main.py | 8 ++++----
 tests/meson.build    | 3 ++-
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/qapi/meson.build b/qapi/meson.build
index b22558ca73..656ef0e039 100644
--- a/qapi/meson.build
+++ b/qapi/meson.build
@@ -127,7 +127,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@', '--gen-trace' ],
+  command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ],
   depend_files: [ qapi_inputs, qapi_gen_depends ])
 
 # Now go through all the outputs and add them to the right sourceset.
diff --git a/qga/meson.build b/qga/meson.build
index 724d5a667b..f06b726ad3 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -25,7 +25,8 @@ qga_qapi_outputs = [
 qga_qapi_files = custom_target('QGA QAPI files',
                                output: qga_qapi_outputs,
                                input: 'qapi-schema.json',
-                               command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@' ],
+                               command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@',
+                                          '--suppress-tracing' ],
                                depend_files: qapi_gen_depends)
 
 qga_ss = ss.source_set()
diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py
index 687d408aba..fc216a53d3 100644
--- a/scripts/qapi/main.py
+++ b/scripts/qapi/main.py
@@ -76,10 +76,10 @@ def main() -> int:
                         dest='unmask',
                         help="expose non-ABI names in introspection")
 
-    # Option --gen-trace exists so we can avoid solving build system
+    # Option --suppress-tracing exists so we can avoid solving build system
     # problems.  TODO Drop it when we no longer need it.
-    parser.add_argument('--gen-trace', action='store_true',
-                        help="add trace events to qmp marshals")
+    parser.add_argument('--suppress-tracing', action='store_true',
+                        help="suppress adding trace events to qmp marshals")
 
     parser.add_argument('schema', action='store')
     args = parser.parse_args()
@@ -96,7 +96,7 @@ def main() -> int:
                  prefix=args.prefix,
                  unmask=args.unmask,
                  builtins=args.builtins,
-                 gen_tracing=args.gen_trace)
+                 gen_tracing=not args.suppress_tracing)
     except QAPIError as err:
         print(f"{sys.argv[0]}: {str(err)}", file=sys.stderr)
         return 1
diff --git a/tests/meson.build b/tests/meson.build
index af8f5b1746..6d11dd436e 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -44,7 +44,8 @@ test_qapi_files = custom_target('Test QAPI files',
                                              'qapi-schema/include/sub-module.json',
                                              'qapi-schema/sub-sub-module.json'),
                                 command: [ qapi_gen, '-o', meson.current_build_dir(),
-                                           '-b', '-p', 'test-', '@INPUT0@' ],
+                                           '-b', '-p', 'test-', '@INPUT0@',
+                                           '--suppress-tracing' ],
                                 depend_files: qapi_gen_depends)
 
 # meson doesn't like generated output in other directories
-- 
2.31.1



  parent reply	other threads:[~2022-01-26 16:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 16:11 [PATCH v6 0/7] trace qmp commands Vladimir Sementsov-Ogievskiy
2022-01-26 16:11 ` [PATCH v6 1/7] qapi/gen: Add FOO.trace-events output module Vladimir Sementsov-Ogievskiy
2022-01-26 16:11 ` [PATCH v6 2/7] qapi/commands: refactor error handling code Vladimir Sementsov-Ogievskiy
2022-01-26 16:11 ` [PATCH v6 3/7] qapi/commands: Optionally generate trace for QMP commands Vladimir Sementsov-Ogievskiy
2022-01-27  7:24   ` Markus Armbruster
2022-01-27  9:42     ` Vladimir Sementsov-Ogievskiy
2022-01-26 16:11 ` [PATCH v6 4/7] meson: generate trace events for qmp commands Vladimir Sementsov-Ogievskiy
2022-01-26 16:11 ` [PATCH v6 5/7] docs/qapi-code-gen: update to cover trace events code generation Vladimir Sementsov-Ogievskiy
2022-01-27  8:20   ` Stefan Hajnoczi
2022-01-26 16:11 ` [PATCH v6 6/7] meson: document, why we don't generate trace events for tests/ and qga/ Vladimir Sementsov-Ogievskiy
2022-01-27  6:50   ` Markus Armbruster
2022-01-27  9:26     ` Vladimir Sementsov-Ogievskiy
2022-01-27  6:51   ` Markus Armbruster
2022-01-27  8:21   ` Stefan Hajnoczi
2022-01-26 16:11 ` Vladimir Sementsov-Ogievskiy [this message]
2022-01-27  7:32 ` [PATCH v6 0/7] trace qmp commands Markus Armbruster
2022-01-27  9:41   ` Vladimir Sementsov-Ogievskiy
2022-01-27 11:10     ` Markus Armbruster
2022-01-27  8:21 ` Stefan Hajnoczi
2022-01-27  9:41   ` Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220126161130.3240892-8-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).