]> git.proxmox.com Git - mirror_qemu.git/blame - trace/meson.build
trace: remove vcpu_id from the TraceEvent structure
[mirror_qemu.git] / trace / meson.build
CommitLineData
29b62a10 1softmmu_ss.add(files('trace-hmp-cmds.c'))
aadac5b3 2
0e1309d0
MAL
3specific_ss.add(files('control-target.c'))
4
a81df1b6 5trace_events_files = []
b83a80e8
VSO
6foreach item : [ '.' ] + trace_events_subdirs + qapi_trace_events
7 if item in qapi_trace_events
8 trace_events_file = item
9 group_name = item.full_path().split('/')[-1].underscorify()
10 else
11 trace_events_file = meson.project_source_root() / item / 'trace-events'
12 group_name = item == '.' ? 'root' : item.underscorify()
13 endif
a81df1b6 14 trace_events_files += [ trace_events_file ]
a81df1b6
PB
15 group = '--group=' + group_name
16 fmt = '@0@-' + group_name + '.@1@'
17
18 trace_h = custom_target(fmt.format('trace', 'h'),
19 output: fmt.format('trace', 'h'),
20 input: trace_events_file,
0572d6cd
SH
21 command: [ tracetool, group, '--format=h', '@INPUT@', '@OUTPUT@' ],
22 depend_files: tracetool_depends)
a81df1b6
PB
23 genh += trace_h
24 trace_c = custom_target(fmt.format('trace', 'c'),
25 output: fmt.format('trace', 'c'),
26 input: trace_events_file,
0572d6cd
SH
27 command: [ tracetool, group, '--format=c', '@INPUT@', '@OUTPUT@' ],
28 depend_files: tracetool_depends)
9c29b741 29 if 'ust' in get_option('trace_backends')
a81df1b6
PB
30 trace_ust_h = custom_target(fmt.format('trace-ust', 'h'),
31 output: fmt.format('trace-ust', 'h'),
32 input: trace_events_file,
0572d6cd
SH
33 command: [ tracetool, group, '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ],
34 depend_files: tracetool_depends)
bbe47ed2 35 trace_ss.add(trace_ust_h, lttng)
a81df1b6
PB
36 genh += trace_ust_h
37 endif
38 trace_ss.add(trace_h, trace_c)
9c29b741 39 if 'dtrace' in get_option('trace_backends')
a81df1b6
PB
40 trace_dtrace = custom_target(fmt.format('trace-dtrace', 'dtrace'),
41 output: fmt.format('trace-dtrace', 'dtrace'),
42 input: trace_events_file,
0572d6cd
SH
43 command: [ tracetool, group, '--format=d', '@INPUT@', '@OUTPUT@' ],
44 depend_files: tracetool_depends)
a81df1b6
PB
45 trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'),
46 output: fmt.format('trace-dtrace', 'h'),
47 input: trace_dtrace,
d051d0e1 48 command: [ dtrace, '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ])
568ac779
RB
49 trace_ss.add(trace_dtrace_h)
50 if host_machine.system() != 'darwin'
51 trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'),
52 output: fmt.format('trace-dtrace', 'o'),
53 input: trace_dtrace,
d051d0e1 54 command: [ dtrace, '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ])
568ac779
RB
55 trace_ss.add(trace_dtrace_o)
56 endif
a81df1b6 57
a81df1b6
PB
58 genh += trace_dtrace_h
59 endif
60endforeach
61
10e1d263
MAL
62trace_events_all = custom_target('trace-events-all',
63 output: 'trace-events-all',
64 input: trace_events_files,
65 command: [ 'cat', '@INPUT@' ],
66 capture: true,
67 install: true,
ab4c0996 68 install_dir: qemu_datadir)
a81df1b6 69
9c29b741 70if 'ust' in get_option('trace_backends')
a81df1b6
PB
71 trace_ust_all_h = custom_target('trace-ust-all.h',
72 output: 'trace-ust-all.h',
73 input: trace_events_files,
0572d6cd
SH
74 command: [ tracetool, '--group=all', '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ],
75 depend_files: tracetool_depends)
a81df1b6
PB
76 trace_ust_all_c = custom_target('trace-ust-all.c',
77 output: 'trace-ust-all.c',
78 input: trace_events_files,
0572d6cd
SH
79 command: [ tracetool, '--group=all', '--format=ust-events-c', '@INPUT@', '@OUTPUT@' ],
80 depend_files: tracetool_depends)
a81df1b6
PB
81 trace_ss.add(trace_ust_all_h, trace_ust_all_c)
82 genh += trace_ust_all_h
83endif
84
9c29b741
PB
85if 'simple' in get_option('trace_backends')
86 trace_ss.add(files('simple.c'))
87endif
88if 'ftrace' in get_option('trace_backends')
89 trace_ss.add(files('ftrace.c'))
90endif
a81df1b6 91trace_ss.add(files('control.c'))
5ac034b1
PMD
92if have_system or have_tools or have_ga
93 trace_ss.add(files('qmp.c'))
94endif