Peter Maydell | aadac5b | 2021-01-06 15:55:29 +0000 | [diff] [blame] | 1 | |
Marc-André Lureau | 0e1309d | 2019-09-03 16:47:00 +0400 | [diff] [blame] | 2 | specific_ss.add(files('control-target.c')) |
| 3 | |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 4 | trace_events_files = [] |
Vladimir Sementsov-Ogievskiy | b83a80e | 2022-01-26 17:11:27 +0100 | [diff] [blame] | 5 | foreach item : [ '.' ] + trace_events_subdirs + qapi_trace_events |
| 6 | if item in qapi_trace_events |
| 7 | trace_events_file = item |
| 8 | group_name = item.full_path().split('/')[-1].underscorify() |
| 9 | else |
| 10 | trace_events_file = meson.project_source_root() / item / 'trace-events' |
| 11 | group_name = item == '.' ? 'root' : item.underscorify() |
| 12 | endif |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 13 | trace_events_files += [ trace_events_file ] |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 14 | group = '--group=' + group_name |
| 15 | fmt = '@0@-' + group_name + '.@1@' |
| 16 | |
| 17 | trace_h = custom_target(fmt.format('trace', 'h'), |
| 18 | output: fmt.format('trace', 'h'), |
| 19 | input: trace_events_file, |
Stefan Hajnoczi | 0572d6c | 2021-01-25 11:09:58 +0000 | [diff] [blame] | 20 | command: [ tracetool, group, '--format=h', '@INPUT@', '@OUTPUT@' ], |
| 21 | depend_files: tracetool_depends) |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 22 | genh += trace_h |
| 23 | trace_c = custom_target(fmt.format('trace', 'c'), |
| 24 | output: fmt.format('trace', 'c'), |
| 25 | input: trace_events_file, |
Stefan Hajnoczi | 0572d6c | 2021-01-25 11:09:58 +0000 | [diff] [blame] | 26 | command: [ tracetool, group, '--format=c', '@INPUT@', '@OUTPUT@' ], |
| 27 | depend_files: tracetool_depends) |
Paolo Bonzini | 9c29b74 | 2021-10-07 15:08:14 +0200 | [diff] [blame] | 28 | if 'ust' in get_option('trace_backends') |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 29 | trace_ust_h = custom_target(fmt.format('trace-ust', 'h'), |
| 30 | output: fmt.format('trace-ust', 'h'), |
| 31 | input: trace_events_file, |
Stefan Hajnoczi | 0572d6c | 2021-01-25 11:09:58 +0000 | [diff] [blame] | 32 | command: [ tracetool, group, '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ], |
| 33 | depend_files: tracetool_depends) |
Paolo Bonzini | bbe47ed | 2021-07-12 17:57:10 +0200 | [diff] [blame] | 34 | trace_ss.add(trace_ust_h, lttng) |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 35 | genh += trace_ust_h |
| 36 | endif |
| 37 | trace_ss.add(trace_h, trace_c) |
Paolo Bonzini | 9c29b74 | 2021-10-07 15:08:14 +0200 | [diff] [blame] | 38 | if 'dtrace' in get_option('trace_backends') |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 39 | trace_dtrace = custom_target(fmt.format('trace-dtrace', 'dtrace'), |
| 40 | output: fmt.format('trace-dtrace', 'dtrace'), |
| 41 | input: trace_events_file, |
Stefan Hajnoczi | 0572d6c | 2021-01-25 11:09:58 +0000 | [diff] [blame] | 42 | command: [ tracetool, group, '--format=d', '@INPUT@', '@OUTPUT@' ], |
| 43 | depend_files: tracetool_depends) |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 44 | trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'), |
| 45 | output: fmt.format('trace-dtrace', 'h'), |
| 46 | input: trace_dtrace, |
Paolo Bonzini | d051d0e | 2021-09-07 19:23:49 +0200 | [diff] [blame] | 47 | command: [ dtrace, '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ]) |
Roman Bolshakov | 568ac77 | 2020-08-23 12:05:47 +0300 | [diff] [blame] | 48 | trace_ss.add(trace_dtrace_h) |
| 49 | if host_machine.system() != 'darwin' |
| 50 | trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'), |
| 51 | output: fmt.format('trace-dtrace', 'o'), |
| 52 | input: trace_dtrace, |
Paolo Bonzini | d051d0e | 2021-09-07 19:23:49 +0200 | [diff] [blame] | 53 | command: [ dtrace, '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ]) |
Roman Bolshakov | 568ac77 | 2020-08-23 12:05:47 +0300 | [diff] [blame] | 54 | trace_ss.add(trace_dtrace_o) |
| 55 | endif |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 56 | |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 57 | genh += trace_dtrace_h |
| 58 | endif |
| 59 | endforeach |
| 60 | |
Marc-André Lureau | 10e1d26 | 2019-08-20 12:29:52 +0400 | [diff] [blame] | 61 | trace_events_all = custom_target('trace-events-all', |
| 62 | output: 'trace-events-all', |
| 63 | input: trace_events_files, |
| 64 | command: [ 'cat', '@INPUT@' ], |
| 65 | capture: true, |
| 66 | install: true, |
Marc-André Lureau | ab4c099 | 2020-08-26 15:04:16 +0400 | [diff] [blame] | 67 | install_dir: qemu_datadir) |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 68 | |
Paolo Bonzini | 9c29b74 | 2021-10-07 15:08:14 +0200 | [diff] [blame] | 69 | if 'ust' in get_option('trace_backends') |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 70 | trace_ust_all_h = custom_target('trace-ust-all.h', |
| 71 | output: 'trace-ust-all.h', |
| 72 | input: trace_events_files, |
Stefan Hajnoczi | 0572d6c | 2021-01-25 11:09:58 +0000 | [diff] [blame] | 73 | command: [ tracetool, '--group=all', '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ], |
| 74 | depend_files: tracetool_depends) |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 75 | trace_ust_all_c = custom_target('trace-ust-all.c', |
| 76 | output: 'trace-ust-all.c', |
| 77 | input: trace_events_files, |
Stefan Hajnoczi | 0572d6c | 2021-01-25 11:09:58 +0000 | [diff] [blame] | 78 | command: [ tracetool, '--group=all', '--format=ust-events-c', '@INPUT@', '@OUTPUT@' ], |
| 79 | depend_files: tracetool_depends) |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 80 | trace_ss.add(trace_ust_all_h, trace_ust_all_c) |
| 81 | genh += trace_ust_all_h |
| 82 | endif |
| 83 | |
Paolo Bonzini | 9c29b74 | 2021-10-07 15:08:14 +0200 | [diff] [blame] | 84 | if 'simple' in get_option('trace_backends') |
| 85 | trace_ss.add(files('simple.c')) |
| 86 | endif |
| 87 | if 'ftrace' in get_option('trace_backends') |
| 88 | trace_ss.add(files('ftrace.c')) |
| 89 | endif |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 90 | trace_ss.add(files('control.c')) |
| 91 | trace_ss.add(files('qmp.c')) |