All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: kwolf@redhat.com, michael.roth@amd.com, qemu-devel@nongnu.org,
	hreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com,
	jsnow@redhat.com
Subject: Re: [PATCH v3 3/3] meson: generate trace events for qmp commands
Date: Tue, 18 Jan 2022 11:30:30 +0100	[thread overview]
Message-ID: <871r15pc8p.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20220117201845.2438382-4-vsementsov@virtuozzo.com> (Vladimir Sementsov-Ogievskiy's message of "Mon, 17 Jan 2022 21:18:45 +0100")

Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:

> 1. Use --add-trace-events 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>
> ---
>  meson.build       |  5 +++++
>  qapi/meson.build  |  9 ++++++++-
>  trace/meson.build | 11 ++++++++---
>  3 files changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 762d7cee85..effd66e4c2 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -41,6 +41,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
> @@ -2554,6 +2555,10 @@ if 'CONFIG_VHOST_USER' in config_host
>    vhost_user = libvhost_user.get_variable('vhost_user_dep')
>  endif
>  
> +# Please keep ordering between 'qapi' and 'trace' subdirs:
> +# We should first handle 'qapi' subdir, so that all
> +# generated trace events be generated prior handling 'trace'
> +# subdir.

I naively expect explicit dependencies to be used for ordering, but I'm
a Meson noob.  I'd like an ACK from a non-noob on this one.

>  subdir('qapi')
>  subdir('qobject')
>  subdir('stubs')
> diff --git a/qapi/meson.build b/qapi/meson.build
> index c0c49c15e4..b48125f8da 100644
> --- a/qapi/meson.build
> +++ b/qapi/meson.build
> @@ -114,6 +114,7 @@ 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),
>      ]
>    endif
>    if module.endswith('-target')
> @@ -126,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@' ],
> +  command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@', '--add-trace-events' ],
>    depend_files: [ qapi_inputs, qapi_gen_depends ])
>  
>  # Now go through all the outputs and add them to the right sourceset.
> @@ -137,6 +138,9 @@ foreach output : qapi_util_outputs
>    if output.endswith('.h')
>      genh += qapi_files[i]
>    endif
> +  if output.endswith('.trace-events')
> +    qapi_trace_events += qapi_files[i]
> +  endif
>    util_ss.add(qapi_files[i])
>    i = i + 1
>  endforeach
> @@ -145,6 +149,9 @@ foreach output : qapi_specific_outputs + qapi_nonmodule_outputs
>    if output.endswith('.h')
>      genh += qapi_files[i]
>    endif
> +  if output.endswith('.trace-events')
> +    qapi_trace_events += qapi_files[i]
> +  endif
>    specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: qapi_files[i])
>    i = i + 1
>  endforeach
> diff --git a/trace/meson.build b/trace/meson.build
> index 573dd699c6..c4794a1f2a 100644
> --- a/trace/meson.build
> +++ b/trace/meson.build
> @@ -2,10 +2,15 @@
>  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 item : [ '.' ] + trace_events_subdirs + qapi_trace_events
> +  if item in qapi_trace_events
> +    trace_events_file = item
> +    group_name = item.full_path().split('/')[-1].underscorify()
> +  else
> +    trace_events_file = meson.project_source_root() / item / 'trace-events'
> +    group_name = item == '.' ? 'root' : item.underscorify()
> +  endif
>    trace_events_files += [ trace_events_file ]
> -  group_name = dir == '.' ? 'root' : dir.underscorify()
>    group = '--group=' + group_name
>    fmt = '@0@-' + group_name + '.@1@'



  reply	other threads:[~2022-01-18 10:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 20:18 [PATCH v3 0/3] trace qmp commands Vladimir Sementsov-Ogievskiy
2022-01-17 20:18 ` [PATCH v3 1/3] scripts/qapi/gen.py: add .trace-events file for module Vladimir Sementsov-Ogievskiy
2022-01-18  8:38   ` Markus Armbruster
2022-01-18 10:34     ` Vladimir Sementsov-Ogievskiy
2022-01-17 20:18 ` [PATCH v3 2/3] scripts/qapi-gen.py: add --add-trace-events option Vladimir Sementsov-Ogievskiy
2022-01-18 10:27   ` Markus Armbruster
2022-01-18 11:58     ` Vladimir Sementsov-Ogievskiy
2022-01-18 14:22       ` Markus Armbruster
2022-01-19  8:41         ` Paolo Bonzini
2022-01-17 20:18 ` [PATCH v3 3/3] meson: generate trace events for qmp commands Vladimir Sementsov-Ogievskiy
2022-01-18 10:30   ` Markus Armbruster [this message]
2022-01-18 12:21     ` Paolo Bonzini
2022-01-18 13:05       ` Markus Armbruster

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=871r15pc8p.fsf@dusky.pond.sub.org \
    --to=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 \
    --cc=vsementsov@virtuozzo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.