[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 025/150] libqemuutil, qapi, trace: convert to meson
From: |
Roman Bolshakov |
Subject: |
Re: [PATCH 025/150] libqemuutil, qapi, trace: convert to meson |
Date: |
Mon, 17 Aug 2020 14:10:00 +0300 |
On Fri, Aug 14, 2020 at 05:11:21AM -0400, Paolo Bonzini wrote:
> This shows how to do some "computations" in meson.build using its array
> and dictionary data structures, and also a basic usage of the sourceset
> module for conditional compilation.
>
> [...]
> diff --git a/trace/meson.build b/trace/meson.build
> new file mode 100644
> index 0000000000..f0a8d1c2e2
> --- /dev/null
> +++ b/trace/meson.build
> @@ -0,0 +1,76 @@
> +trace_events_files = []
> +foreach dir : [ '.' ] + trace_events_subdirs
> + trace_events_file = meson.source_root() / dir / 'trace-events'
> + trace_events_files += [ trace_events_file ]
> + group_name = dir == '.' ? 'root' : dir.underscorify()
> + group = '--group=' + group_name
> + fmt = '@0@-' + group_name + '.@1@'
> +
> + trace_h = custom_target(fmt.format('trace', 'h'),
> + output: fmt.format('trace', 'h'),
> + input: trace_events_file,
> + command: [ tracetool, group, '--format=h',
> '@INPUT@' ],
> + capture: true)
> + genh += trace_h
> + trace_c = custom_target(fmt.format('trace', 'c'),
> + output: fmt.format('trace', 'c'),
> + input: trace_events_file,
> + command: [ tracetool, group, '--format=c',
> '@INPUT@' ],
> + capture: true)
> + if 'CONFIG_TRACE_UST' in config_host
> + trace_ust_h = custom_target(fmt.format('trace-ust', 'h'),
> + output: fmt.format('trace-ust', 'h'),
> + input: trace_events_file,
> + command: [ tracetool, group,
> '--format=ust-events-h', '@INPUT@' ],
> + capture: true)
> + trace_ss.add(trace_ust_h, lttng, urcubp)
> + genh += trace_ust_h
> + endif
> + trace_ss.add(trace_h, trace_c)
> + if 'CONFIG_TRACE_DTRACE' in config_host
> + trace_dtrace = custom_target(fmt.format('trace-dtrace', 'dtrace'),
> + output: fmt.format('trace-dtrace',
> 'dtrace'),
> + input: trace_events_file,
> + command: [ tracetool, group, '--format=d',
> '@INPUT@' ],
> + capture: true)
> + trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'),
> + output: fmt.format('trace-dtrace', 'h'),
> + input: trace_dtrace,
> + command: [ 'dtrace', '-o', '@OUTPUT@',
> '-h', '-s', '@INPUT@' ])
> + trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'),
> + output: fmt.format('trace-dtrace', 'o'),
> + input: trace_dtrace,
> + command: [ 'dtrace', '-o', '@OUTPUT@',
> '-G', '-s', '@INPUT@' ])
> +
> + trace_ss.add(trace_dtrace_h, trace_dtrace_o)
The patch conflicts with the latest tracing PULL request, object files
shouldn't be generated on darwin:
https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg02493.html
Thanks,
Roman
> + genh += trace_dtrace_h
> + endif
> +endforeach
> +
> +custom_target('trace-events-all',
> + output: 'trace-events-all',
> + input: trace_events_files,
> + command: [ 'cat', '@INPUT@' ],
> + capture: true,
> + install: true,
> + install_dir: config_host['qemu_datadir'])
> +
> +if 'CONFIG_TRACE_UST' in config_host
> + trace_ust_all_h = custom_target('trace-ust-all.h',
> + output: 'trace-ust-all.h',
> + input: trace_events_files,
> + command: [ tracetool, '--group=all',
> '--format=ust-events-h', '@INPUT@' ],
> + capture: true)
> + trace_ust_all_c = custom_target('trace-ust-all.c',
> + output: 'trace-ust-all.c',
> + input: trace_events_files,
> + command: [ tracetool, '--group=all',
> '--format=ust-events-c', '@INPUT@' ],
> + capture: true)
> + trace_ss.add(trace_ust_all_h, trace_ust_all_c)
> + genh += trace_ust_all_h
> +endif
> +
> +trace_ss.add(when: 'CONFIG_TRACE_SIMPLE', if_true: files('simple.c'))
> +trace_ss.add(when: 'CONFIG_TRACE_FTRACE', if_true: files('ftrace.c'))
> +trace_ss.add(files('control.c'))
> +trace_ss.add(files('qmp.c'))
- [PATCH 020/150] meson: move summary to meson.build, (continued)
- [PATCH 020/150] meson: move summary to meson.build, Paolo Bonzini, 2020/08/14
- [PATCH 022/150] meson: use coverage option, Paolo Bonzini, 2020/08/14
- [PATCH 023/150] meson: add sparse support, Paolo Bonzini, 2020/08/14
- [PATCH 026/150] meson: add remaining generated tcg trace helpers, Paolo Bonzini, 2020/08/14
- [PATCH 024/150] meson: add testsuite Makefile generator, Paolo Bonzini, 2020/08/14
- [PATCH 029/150] tools/virtiofsd: convert to Meson, Paolo Bonzini, 2020/08/14
- [PATCH 032/150] contrib/vhost-user-scsi: convert to Meson, Paolo Bonzini, 2020/08/14
- [PATCH 028/150] contrib/libvhost-user: convert to Meson, Paolo Bonzini, 2020/08/14
- [PATCH 027/150] meson: add version.o, Paolo Bonzini, 2020/08/14
- [PATCH 025/150] libqemuutil, qapi, trace: convert to meson, Paolo Bonzini, 2020/08/14
- Re: [PATCH 025/150] libqemuutil, qapi, trace: convert to meson,
Roman Bolshakov <=
- [PATCH 031/150] vhost-user-scsi: add compatibility for libiscsi 1.9.0, Paolo Bonzini, 2020/08/14
- [PATCH 030/150] contrib/vhost-user-blk: convert to Meson, Paolo Bonzini, 2020/08/14
- [PATCH 016/150] configure: integrate Meson in the build system, Paolo Bonzini, 2020/08/14
- [PATCH 037/150] contrib/elf2dmp: convert to meson, Paolo Bonzini, 2020/08/14
- [PATCH 041/150] meson: convert vss-win32, Paolo Bonzini, 2020/08/14
- [PATCH 038/150] meson: add macos dependencies, Paolo Bonzini, 2020/08/14
- [PATCH 033/150] contrib/rdmacm-mux: convert to Meson, Paolo Bonzini, 2020/08/14
- [PATCH 034/150] contrib/vhost-user-input: convert to meson, Paolo Bonzini, 2020/08/14