Pull request

-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmXwpoYACgkQnKSrs4Gr
 c8gE0wf/c0hNDKoV01N8IwfJdmIBySNeCYRQiwcR84iiPoGGAwYdKuLa7wHaQKiO
 iM0EV/ltJiiOGCHxlffVqLBzJurJHsHG6m429KBLRBXWc6gVzhCN9TjD8DwHxiTU
 qzczoev8NJ2y5mrxzPPPjMxSSJEe3Ynas6ngeHeYBUtu0PRNp79zceWdtS0sPzia
 sCI8EH/oCZQgVcwI/UkIOXjzbKK1lZWa2805//KIqvG27i9zHzLJ0l5eeLtbpZpy
 LnFGRyQGGf+jEKAJuT6598q6T+jCkLCMN6zpyKWGvcYleNvBnlw6+N8Il8zV7KSc
 TE5BNk+C7I9aimrRyaz3WrFCZW5DbQ==
 =q9Im
 -----END PGP SIGNATURE-----

Merge tag 'tracing-pull-request' of https://gitlab.com/stefanha/qemu into staging

Pull request

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmXwpoYACgkQnKSrs4Gr
# c8gE0wf/c0hNDKoV01N8IwfJdmIBySNeCYRQiwcR84iiPoGGAwYdKuLa7wHaQKiO
# iM0EV/ltJiiOGCHxlffVqLBzJurJHsHG6m429KBLRBXWc6gVzhCN9TjD8DwHxiTU
# qzczoev8NJ2y5mrxzPPPjMxSSJEe3Ynas6ngeHeYBUtu0PRNp79zceWdtS0sPzia
# sCI8EH/oCZQgVcwI/UkIOXjzbKK1lZWa2805//KIqvG27i9zHzLJ0l5eeLtbpZpy
# LnFGRyQGGf+jEKAJuT6598q6T+jCkLCMN6zpyKWGvcYleNvBnlw6+N8Il8zV7KSc
# TE5BNk+C7I9aimrRyaz3WrFCZW5DbQ==
# =q9Im
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 12 Mar 2024 19:01:26 GMT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'tracing-pull-request' of https://gitlab.com/stefanha/qemu:
  meson: generate .stp files for tools too
  tracetool: remove redundant --target-type / --target-name args

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2024-03-13 12:37:15 +00:00
commit bab9dabe7d
3 changed files with 46 additions and 44 deletions

View File

@ -357,8 +357,7 @@ probes::
scripts/tracetool.py --backends=dtrace --format=stap \ scripts/tracetool.py --backends=dtrace --format=stap \
--binary path/to/qemu-binary \ --binary path/to/qemu-binary \
--target-type system \ --probe-prefix qemu.system.x86_64 \
--target-name x86_64 \
--group=all \ --group=all \
trace-events-all \ trace-events-all \
qemu.stp qemu.stp

View File

@ -3812,6 +3812,7 @@ if host_os == 'darwin'
entitlement = find_program('scripts/entitlement.sh') entitlement = find_program('scripts/entitlement.sh')
endif endif
traceable = []
emulators = {} emulators = {}
foreach target : target_dirs foreach target : target_dirs
config_target = config_target_mak[target] config_target = config_target_mak[target]
@ -3980,29 +3981,11 @@ foreach target : target_dirs
emulators += {exe['name']: emulator} emulators += {exe['name']: emulator}
endif endif
if stap.found() traceable += [{
foreach stp: [ 'exe': exe['name'],
{'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / exe['name'], 'install': false}, 'probe-prefix': 'qemu.' + target_type + '.' + target_name,
{'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_option('bindir') / exe['name'], 'install': true}, }]
{'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
{'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
]
custom_target(exe['name'] + stp['ext'],
input: trace_events_all,
output: exe['name'] + stp['ext'],
install: stp['install'],
install_dir: get_option('datadir') / 'systemtap/tapset',
command: [
tracetool, '--group=all', '--format=' + stp['fmt'],
'--binary=' + stp['bin'],
'--target-name=' + target_name,
'--target-type=' + target_type,
'--probe-prefix=qemu.' + target_type + '.' + target_name,
'@INPUT@', '@OUTPUT@'
],
depend_files: tracetool_depends)
endforeach
endif
endforeach endforeach
endforeach endforeach
@ -4037,6 +4020,14 @@ if have_tools
install: true) install: true)
subdir('storage-daemon') subdir('storage-daemon')
foreach exe: [ 'qemu-img', 'qemu-io', 'qemu-nbd', 'qemu-storage-daemon']
traceable += [{
'exe': exe,
'probe-prefix': 'qemu.' + exe.substring(5).replace('-', '_')
}]
endforeach
subdir('contrib/rdmacm-mux') subdir('contrib/rdmacm-mux')
subdir('contrib/elf2dmp') subdir('contrib/elf2dmp')
@ -4069,6 +4060,32 @@ if have_tools
endif endif
endif endif
if stap.found()
foreach t: traceable
foreach stp: [
{'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / t['exe'], 'install': false},
{'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_option('bindir') / t['exe'], 'install': true},
{'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
{'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
]
cmd = [
tracetool, '--group=all', '--format=' + stp['fmt'],
'--binary=' + stp['bin'],
'--probe-prefix=' + t['probe-prefix'],
'@INPUT@', '@OUTPUT@'
]
custom_target(t['exe'] + stp['ext'],
input: trace_events_all,
output: t['exe'] + stp['ext'],
install: stp['install'],
install_dir: get_option('datadir') / 'systemtap/tapset',
command: cmd,
depend_files: tracetool_depends)
endforeach
endforeach
endif
subdir('scripts') subdir('scripts')
subdir('tools') subdir('tools')
subdir('pc-bios') subdir('pc-bios')

View File

@ -44,12 +44,9 @@ Options:
--help This help message. --help This help message.
--list-backends Print list of available backends. --list-backends Print list of available backends.
--check-backends Check if the given backend is valid. --check-backends Check if the given backend is valid.
--binary <path> Full path to QEMU binary. --binary <path> Full path to QEMU binary (required for 'stap' backend).
--target-type <type> QEMU emulator target type ('system' or 'user'). --group <name> Name of the event group.
--target-name <name> QEMU emulator target name. --probe-prefix <prefix> Prefix for dtrace probe names (required for 'stap' backend).
--group <name> Name of the event group
--probe-prefix <prefix> Prefix for dtrace probe names
(default: qemu-<target-type>-<target-name>).\
""" % { """ % {
"script" : _SCRIPT, "script" : _SCRIPT,
"backends" : backend_descr, "backends" : backend_descr,
@ -67,7 +64,7 @@ def main(args):
long_opts = ["backends=", "format=", "help", "list-backends", long_opts = ["backends=", "format=", "help", "list-backends",
"check-backends", "group="] "check-backends", "group="]
long_opts += ["binary=", "target-type=", "target-name=", "probe-prefix="] long_opts += ["binary=", "probe-prefix="]
try: try:
opts, args = getopt.getopt(args[1:], "", long_opts) opts, args = getopt.getopt(args[1:], "", long_opts)
@ -79,8 +76,6 @@ def main(args):
arg_format = "" arg_format = ""
arg_group = None arg_group = None
binary = None binary = None
target_type = None
target_name = None
probe_prefix = None probe_prefix = None
for opt, arg in opts: for opt, arg in opts:
if opt == "--help": if opt == "--help":
@ -102,10 +97,6 @@ def main(args):
elif opt == "--binary": elif opt == "--binary":
binary = arg binary = arg
elif opt == '--target-type':
target_type = arg
elif opt == '--target-name':
target_name = arg
elif opt == '--probe-prefix': elif opt == '--probe-prefix':
probe_prefix = arg probe_prefix = arg
@ -127,13 +118,8 @@ def main(args):
if arg_format == "stap": if arg_format == "stap":
if binary is None: if binary is None:
error_opt("--binary is required for SystemTAP tapset generator") error_opt("--binary is required for SystemTAP tapset generator")
if probe_prefix is None and target_type is None:
error_opt("--target-type is required for SystemTAP tapset generator")
if probe_prefix is None and target_name is None:
error_opt("--target-name is required for SystemTAP tapset generator")
if probe_prefix is None: if probe_prefix is None:
probe_prefix = ".".join(["qemu", target_type, target_name]) error_opt("--probe-prefix is required for SystemTAP tapset generator")
if len(args) < 2: if len(args) < 2:
error_opt("missing trace-events and output filepaths") error_opt("missing trace-events and output filepaths")