]> git.proxmox.com Git - mirror_qemu.git/blame - trace/meson.build
tracetool: also strip %l and %ll from systemtap format strings
[mirror_qemu.git] / trace / meson.build
CommitLineData
aadac5b3 1
0e1309d0
MAL
2specific_ss.add(files('control-target.c'))
3
a81df1b6
PB
4trace_events_files = []
5foreach dir : [ '.' ] + trace_events_subdirs
6 trace_events_file = meson.source_root() / dir / 'trace-events'
7 trace_events_files += [ trace_events_file ]
8 group_name = dir == '.' ? 'root' : dir.underscorify()
9 group = '--group=' + group_name
10 fmt = '@0@-' + group_name + '.@1@'
11
12 trace_h = custom_target(fmt.format('trace', 'h'),
13 output: fmt.format('trace', 'h'),
14 input: trace_events_file,
c05012a3 15 command: [ tracetool, group, '--format=h', '@INPUT@', '@OUTPUT@' ])
a81df1b6
PB
16 genh += trace_h
17 trace_c = custom_target(fmt.format('trace', 'c'),
18 output: fmt.format('trace', 'c'),
19 input: trace_events_file,
c05012a3 20 command: [ tracetool, group, '--format=c', '@INPUT@', '@OUTPUT@' ])
a81df1b6
PB
21 if 'CONFIG_TRACE_UST' in config_host
22 trace_ust_h = custom_target(fmt.format('trace-ust', 'h'),
23 output: fmt.format('trace-ust', 'h'),
24 input: trace_events_file,
c05012a3 25 command: [ tracetool, group, '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ])
a81df1b6
PB
26 trace_ss.add(trace_ust_h, lttng, urcubp)
27 genh += trace_ust_h
28 endif
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,
c05012a3 34 command: [ tracetool, group, '--format=d', '@INPUT@', '@OUTPUT@' ])
a81df1b6
PB
35 trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'),
36 output: fmt.format('trace-dtrace', 'h'),
37 input: trace_dtrace,
4b265c79 38 command: [ 'dtrace', '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ])
568ac779
RB
39 trace_ss.add(trace_dtrace_h)
40 if host_machine.system() != 'darwin'
41 trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'),
42 output: fmt.format('trace-dtrace', 'o'),
43 input: trace_dtrace,
4b265c79 44 command: [ 'dtrace', '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ])
568ac779
RB
45 trace_ss.add(trace_dtrace_o)
46 endif
a81df1b6 47
a81df1b6
PB
48 genh += trace_dtrace_h
49 endif
50endforeach
51
10e1d263
MAL
52trace_events_all = custom_target('trace-events-all',
53 output: 'trace-events-all',
54 input: trace_events_files,
55 command: [ 'cat', '@INPUT@' ],
56 capture: true,
57 install: true,
ab4c0996 58 install_dir: qemu_datadir)
a81df1b6 59
71c782f5
MAL
60foreach d : [
61 ['generated-tcg-tracers.h', 'tcg-h'],
62 ['generated-helpers.c', 'tcg-helper-c'],
63 ['generated-helpers.h', 'tcg-helper-h'],
64 ['generated-helpers-wrappers.h', 'tcg-helper-wrapper-h'],
65]
0e1309d0 66 gen = custom_target(d[0],
71c782f5
MAL
67 output: d[0],
68 input: meson.source_root() / 'trace-events',
c05012a3 69 command: [ tracetool, '--group=root', '--format=@0@'.format(d[1]), '@INPUT@', '@OUTPUT@' ])
e921f1a7 70 specific_ss.add(when: 'CONFIG_TCG', if_true: gen)
71c782f5
MAL
71endforeach
72
a81df1b6
PB
73if 'CONFIG_TRACE_UST' in config_host
74 trace_ust_all_h = custom_target('trace-ust-all.h',
75 output: 'trace-ust-all.h',
76 input: trace_events_files,
c05012a3 77 command: [ tracetool, '--group=all', '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ])
a81df1b6
PB
78 trace_ust_all_c = custom_target('trace-ust-all.c',
79 output: 'trace-ust-all.c',
80 input: trace_events_files,
c05012a3 81 command: [ tracetool, '--group=all', '--format=ust-events-c', '@INPUT@', '@OUTPUT@' ])
a81df1b6
PB
82 trace_ss.add(trace_ust_all_h, trace_ust_all_c)
83 genh += trace_ust_all_h
84endif
85
86trace_ss.add(when: 'CONFIG_TRACE_SIMPLE', if_true: files('simple.c'))
87trace_ss.add(when: 'CONFIG_TRACE_FTRACE', if_true: files('ftrace.c'))
88trace_ss.add(files('control.c'))
89trace_ss.add(files('qmp.c'))