1 trace_events_files = []
2 foreach dir : [ '.' ] + trace_events_subdirs
3 trace_events_file = meson.source_root() / dir / 'trace-events'
4 trace_events_files += [ trace_events_file ]
5 group_name = dir == '.' ? 'root' : dir.underscorify()
6 group = '--group=' + group_name
7 fmt = '@0@-' + group_name + '.@1@'
9 trace_h = custom_target(fmt.format('trace', 'h'),
10 output: fmt.format('trace', 'h'),
11 input: trace_events_file,
12 command: [ tracetool, group, '--format=h', '@INPUT@' ],
15 trace_c = custom_target(fmt.format('trace', 'c'),
16 output: fmt.format('trace', 'c'),
17 input: trace_events_file,
18 command: [ tracetool, group, '--format=c', '@INPUT@' ],
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@' ],
26 trace_ss.add(trace_ust_h, lttng, urcubp)
29 trace_ss.add(trace_h, trace_c)
30 if 'CONFIG_TRACE_DTRACE' in config_host
31 trace_dtrace = custom_target(fmt.format('trace-dtrace', 'dtrace'),
32 output: fmt.format('trace-dtrace', 'dtrace'),
33 input: trace_events_file,
34 command: [ tracetool, group, '--format=d', '@INPUT@' ],
36 trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'),
37 output: fmt.format('trace-dtrace', 'h'),
39 command: [ 'dtrace', '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ])
40 trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'),
41 output: fmt.format('trace-dtrace', 'o'),
43 command: [ 'dtrace', '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ])
45 trace_ss.add(trace_dtrace_h, trace_dtrace_o)
46 genh += trace_dtrace_h
50 custom_target('trace-events-all',
51 output: 'trace-events-all',
52 input: trace_events_files,
53 command: [ 'cat', '@INPUT@' ],
56 install_dir: config_host['qemu_datadir'])
59 ['generated-tcg-tracers.h', 'tcg-h'],
60 ['generated-helpers.c', 'tcg-helper-c'],
61 ['generated-helpers.h', 'tcg-helper-h'],
62 ['generated-helpers-wrappers.h', 'tcg-helper-wrapper-h'],
66 input: meson.source_root() / 'trace-events',
67 command: [ tracetool, '--group=root', '--format=@0@'.format(d[1]), '@INPUT@' ],
68 build_by_default: true, # to be removed when added to a target
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@' ],
78 trace_ust_all_c = custom_target('trace-ust-all.c',
79 output: 'trace-ust-all.c',
80 input: trace_events_files,
81 command: [ tracetool, '--group=all', '--format=ust-events-c', '@INPUT@' ],
83 trace_ss.add(trace_ust_all_h, trace_ust_all_c)
84 genh += trace_ust_all_h
87 trace_ss.add(when: 'CONFIG_TRACE_SIMPLE', if_true: files('simple.c'))
88 trace_ss.add(when: 'CONFIG_TRACE_FTRACE', if_true: files('ftrace.c'))
89 trace_ss.add(files('control.c'))
90 trace_ss.add(files('qmp.c'))