]> git.proxmox.com Git - mirror_qemu.git/blob - trace/meson.build
Merge remote-tracking branch 'remotes/philmd-gitlab/tags/mips-20210104' into staging
[mirror_qemu.git] / trace / meson.build
1 specific_ss.add(files('control-target.c'))
2
3 trace_events_files = []
4 foreach dir : [ '.' ] + trace_events_subdirs
5 trace_events_file = meson.source_root() / dir / 'trace-events'
6 trace_events_files += [ trace_events_file ]
7 group_name = dir == '.' ? 'root' : dir.underscorify()
8 group = '--group=' + group_name
9 fmt = '@0@-' + group_name + '.@1@'
10
11 trace_h = custom_target(fmt.format('trace', 'h'),
12 output: fmt.format('trace', 'h'),
13 input: trace_events_file,
14 command: [ tracetool, group, '--format=h', '@INPUT@', '@OUTPUT@' ])
15 genh += trace_h
16 trace_c = custom_target(fmt.format('trace', 'c'),
17 output: fmt.format('trace', 'c'),
18 input: trace_events_file,
19 command: [ tracetool, group, '--format=c', '@INPUT@', '@OUTPUT@' ])
20 if 'CONFIG_TRACE_UST' in config_host
21 trace_ust_h = custom_target(fmt.format('trace-ust', 'h'),
22 output: fmt.format('trace-ust', 'h'),
23 input: trace_events_file,
24 command: [ tracetool, group, '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ])
25 trace_ss.add(trace_ust_h, lttng, urcubp)
26 genh += trace_ust_h
27 endif
28 trace_ss.add(trace_h, trace_c)
29 if 'CONFIG_TRACE_DTRACE' in config_host
30 trace_dtrace = custom_target(fmt.format('trace-dtrace', 'dtrace'),
31 output: fmt.format('trace-dtrace', 'dtrace'),
32 input: trace_events_file,
33 command: [ tracetool, group, '--format=d', '@INPUT@', '@OUTPUT@' ])
34 trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'),
35 output: fmt.format('trace-dtrace', 'h'),
36 input: trace_dtrace,
37 command: [ 'dtrace', '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ])
38 trace_ss.add(trace_dtrace_h)
39 if host_machine.system() != 'darwin'
40 trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'),
41 output: fmt.format('trace-dtrace', 'o'),
42 input: trace_dtrace,
43 command: [ 'dtrace', '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ])
44 trace_ss.add(trace_dtrace_o)
45 endif
46
47 genh += trace_dtrace_h
48 endif
49 endforeach
50
51 trace_events_all = custom_target('trace-events-all',
52 output: 'trace-events-all',
53 input: trace_events_files,
54 command: [ 'cat', '@INPUT@' ],
55 capture: true,
56 install: true,
57 install_dir: qemu_datadir)
58
59 foreach d : [
60 ['generated-tcg-tracers.h', 'tcg-h'],
61 ['generated-helpers.c', 'tcg-helper-c'],
62 ['generated-helpers.h', 'tcg-helper-h'],
63 ['generated-helpers-wrappers.h', 'tcg-helper-wrapper-h'],
64 ]
65 gen = custom_target(d[0],
66 output: d[0],
67 input: meson.source_root() / 'trace-events',
68 command: [ tracetool, '--group=root', '--format=@0@'.format(d[1]), '@INPUT@', '@OUTPUT@' ])
69 specific_ss.add(gen)
70 endforeach
71
72 if 'CONFIG_TRACE_UST' in config_host
73 trace_ust_all_h = custom_target('trace-ust-all.h',
74 output: 'trace-ust-all.h',
75 input: trace_events_files,
76 command: [ tracetool, '--group=all', '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ])
77 trace_ust_all_c = custom_target('trace-ust-all.c',
78 output: 'trace-ust-all.c',
79 input: trace_events_files,
80 command: [ tracetool, '--group=all', '--format=ust-events-c', '@INPUT@', '@OUTPUT@' ])
81 trace_ss.add(trace_ust_all_h, trace_ust_all_c)
82 genh += trace_ust_all_h
83 endif
84
85 trace_ss.add(when: 'CONFIG_TRACE_SIMPLE', if_true: files('simple.c'))
86 trace_ss.add(when: 'CONFIG_TRACE_FTRACE', if_true: files('ftrace.c'))
87 trace_ss.add(files('control.c'))
88 trace_ss.add(files('qmp.c'))