From nobody Sat May 11 10:41:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1710270200; cv=none; d=zohomail.com; s=zohoarc; b=U2ch+FKazZXZ7kX436LsHcxyGFB+TGgzXKFslDyuxQ5w+x7denHnUKXqtG8EuLyxlRD3vNRYJHvYMd5ZpjmK6/H9XisPOSV9moCNZ/4TzE5lx6/j9vpAM5eGh2+HkTAeonHmX2azHMgnp3L7wLsaHUOd5+HQkIcAiPOemirh6vA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710270200; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4iRu6lQv+QNbYf+gPPgoTuDCHvhZOlOXKTSWrZLOITw=; b=XB5y1B/sSoQFujwTKTd/bBrXpm94qzUBnW3AXZKGX8nrLg4Z1IJv1SyQ7XvAAeY1qxAUu9+2pmXCsV4GNZ5IDM9BM7qW/mchuzyniFPwDR60VIYKq9KJzF3FLRDKWwRYtatNUdmCSELIhsXiB+C2W9o9ooIWKJl0GBbJPrGxuuo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710270200943987.0282242965072; Tue, 12 Mar 2024 12:03:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rk7OH-0002kP-St; Tue, 12 Mar 2024 15:02:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rk7OG-0002jV-7P for qemu-devel@nongnu.org; Tue, 12 Mar 2024 15:02:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rk7OE-0005Ht-KF for qemu-devel@nongnu.org; Tue, 12 Mar 2024 15:02:19 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-556-P75w82q7NcqyUJw0CFATrQ-1; Tue, 12 Mar 2024 15:02:14 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E217800262; Tue, 12 Mar 2024 19:02:14 +0000 (UTC) Received: from localhost (unknown [10.39.192.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7300B1121337; Tue, 12 Mar 2024 19:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710270138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4iRu6lQv+QNbYf+gPPgoTuDCHvhZOlOXKTSWrZLOITw=; b=Gb6Z27aI+rrzYHl0Ji8XU75JIz7Vhvo5D7+/3eqypyjdZig0xd221J//DLOlTaZH/0nPje UJ/TIqYwsihVVjQSDS1eD22kt7qy0oLdt2PlZDJRn47gQGS4M2Qla6Ude58qlQMkrewQIx 9DQw5Pom2pXbWSDpe21l4GZ/orzEJzg= X-MC-Unique: P75w82q7NcqyUJw0CFATrQ-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Mads Ynddal , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow Subject: [PULL 1/2] tracetool: remove redundant --target-type / --target-name args Date: Tue, 12 Mar 2024 15:01:43 -0400 Message-ID: <20240312190144.433336-2-stefanha@redhat.com> In-Reply-To: <20240312190144.433336-1-stefanha@redhat.com> References: <20240312190144.433336-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.687, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1710270202174100002 From: Daniel P. Berrang=C3=A9 The --target-type and --target-name args are used to construct the default probe prefix if '--probe-prefix' is not given. The meson.build will always pass '--probe-prefix', so the other args are effectively redundant. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Snow Message-id: 20240108171356.1037059-2-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- docs/devel/tracing.rst | 3 +-- meson.build | 2 -- scripts/tracetool.py | 24 +++++------------------- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst index d288480db1..043bed7fd0 100644 --- a/docs/devel/tracing.rst +++ b/docs/devel/tracing.rst @@ -357,8 +357,7 @@ probes:: =20 scripts/tracetool.py --backends=3Ddtrace --format=3Dstap \ --binary path/to/qemu-binary \ - --target-type system \ - --target-name x86_64 \ + --probe-prefix qemu.system.x86_64 \ --group=3Dall \ trace-events-all \ qemu.stp diff --git a/meson.build b/meson.build index f9dbe7634e..b8d40d7c0a 100644 --- a/meson.build +++ b/meson.build @@ -3991,8 +3991,6 @@ foreach target : target_dirs command: [ tracetool, '--group=3Dall', '--format=3D' + stp['f= mt'], '--binary=3D' + stp['bin'], - '--target-name=3D' + target_name, - '--target-type=3D' + target_type, '--probe-prefix=3Dqemu.' + target_type + '.' + tar= get_name, '@INPUT@', '@OUTPUT@' ], diff --git a/scripts/tracetool.py b/scripts/tracetool.py index ab7653a5ce..5de9ce96d3 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -44,12 +44,9 @@ def error_opt(msg =3D None): --help This help message. --list-backends Print list of available backends. --check-backends Check if the given backend is valid. - --binary Full path to QEMU binary. - --target-type QEMU emulator target type ('system' or 'user'= ). - --target-name QEMU emulator target name. - --group Name of the event group - --probe-prefix Prefix for dtrace probe names - (default: qemu--).\ + --binary Full path to QEMU binary (required for 'stap'= backend). + --group Name of the event group. + --probe-prefix Prefix for dtrace probe names (required for '= stap' backend). """ % { "script" : _SCRIPT, "backends" : backend_descr, @@ -67,7 +64,7 @@ def main(args): =20 long_opts =3D ["backends=3D", "format=3D", "help", "list-backends", "check-backends", "group=3D"] - long_opts +=3D ["binary=3D", "target-type=3D", "target-name=3D", "prob= e-prefix=3D"] + long_opts +=3D ["binary=3D", "probe-prefix=3D"] =20 try: opts, args =3D getopt.getopt(args[1:], "", long_opts) @@ -79,8 +76,6 @@ def main(args): arg_format =3D "" arg_group =3D None binary =3D None - target_type =3D None - target_name =3D None probe_prefix =3D None for opt, arg in opts: if opt =3D=3D "--help": @@ -102,10 +97,6 @@ def main(args): =20 elif opt =3D=3D "--binary": binary =3D arg - elif opt =3D=3D '--target-type': - target_type =3D arg - elif opt =3D=3D '--target-name': - target_name =3D arg elif opt =3D=3D '--probe-prefix': probe_prefix =3D arg =20 @@ -127,13 +118,8 @@ def main(args): if arg_format =3D=3D "stap": if binary is None: 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 gene= rator") - if probe_prefix is None and target_name is None: - error_opt("--target-name is required for SystemTAP tapset gene= rator") - if probe_prefix is None: - probe_prefix =3D ".".join(["qemu", target_type, target_name]) + error_opt("--probe-prefix is required for SystemTAP tapset gen= erator") =20 if len(args) < 2: error_opt("missing trace-events and output filepaths") --=20 2.44.0 From nobody Sat May 11 10:41:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1710270222; cv=none; d=zohomail.com; s=zohoarc; b=ZDn+hA6DOW4Py72MDNUbZyRejrC4v1ZGiOIWucvFRG8Kj7p97sRy+I3cCfpwUDG0V6NE6VkRAad8X+9YN5Xz1AgLZVGt0/gETWEm/lmOK2m0e+8IVtsxQTBfiWG7CVoGYveNBCex9z53IrvoPBAOA/kqfBAEPyEFeYUE2yPXFR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710270222; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RtHopwqj2zSve6yzyGJpkD7D5xz3ETDg+5TwNbJVrqw=; b=dG3YneMnoGQ07CkF9lKhXUzlzfxvlE6pk+bbGHPXx4mSE8hyxOxbmKjq3BM2HTp1XN1gmOhR7PdiFX61xgtzQBXUgpjhqSqDsAxdZOav8pDN9EWrBPwv7hBUE36vTKrk+oysNQ/1NVM0FiZacotQFy2cEioCt4PHpsZVFrF3LrM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710270222456425.58845511821744; Tue, 12 Mar 2024 12:03:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rk7OJ-0002ko-4f; Tue, 12 Mar 2024 15:02:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rk7OH-0002jy-3F for qemu-devel@nongnu.org; Tue, 12 Mar 2024 15:02:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rk7OF-0005I0-Hv for qemu-devel@nongnu.org; Tue, 12 Mar 2024 15:02:20 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-596-BF7NpRT_O-SUrbwFUleAPQ-1; Tue, 12 Mar 2024 15:02:17 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C023C87A38C; Tue, 12 Mar 2024 19:02:16 +0000 (UTC) Received: from localhost (unknown [10.39.192.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC7B2492BC6; Tue, 12 Mar 2024 19:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710270138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RtHopwqj2zSve6yzyGJpkD7D5xz3ETDg+5TwNbJVrqw=; b=TKJRAzY3uZgkNZRojF4kzpbE9naK+Dy3Rd2LQ+e2LH3b6DzncjB2QVl20CfLjBjszH958S XfiM0iA6KVtGu9RXXEt/P4hlWLrvEVfHIvQRPFd7lIWq5JawgeuHV44BC0tlOmmwHycgq3 TKpDBWaYuPvV+yIg2gx9Za6D3xw3+1M= X-MC-Unique: BF7NpRT_O-SUrbwFUleAPQ-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Mads Ynddal , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Eric Blake Subject: [PULL 2/2] meson: generate .stp files for tools too Date: Tue, 12 Mar 2024 15:01:44 -0400 Message-ID: <20240312190144.433336-3-stefanha@redhat.com> In-Reply-To: <20240312190144.433336-1-stefanha@redhat.com> References: <20240312190144.433336-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.687, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1710270224159100004 From: Daniel P. Berrang=C3=A9 The qemu-img, qemu-io, qemu-nbd, qemu-storage-daemon tools all have support for systemtap tracing built-in, so should be given corresponding .stp files to define their probes. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Eric Blake Message-id: 20240108171356.1037059-3-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- meson.build | 61 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/meson.build b/meson.build index b8d40d7c0a..520f862d7b 100644 --- a/meson.build +++ b/meson.build @@ -3808,6 +3808,7 @@ if host_os =3D=3D 'darwin' entitlement =3D find_program('scripts/entitlement.sh') endif =20 +traceable =3D [] emulators =3D {} foreach target : target_dirs config_target =3D config_target_mak[target] @@ -3976,27 +3977,11 @@ foreach target : target_dirs emulators +=3D {exe['name']: emulator} endif =20 - if stap.found() - foreach stp: [ - {'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_di= r() / exe['name'], 'install': false}, - {'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_o= ption('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/taps= et', - command: [ - tracetool, '--group=3Dall', '--format=3D' + stp['f= mt'], - '--binary=3D' + stp['bin'], - '--probe-prefix=3Dqemu.' + target_type + '.' + tar= get_name, - '@INPUT@', '@OUTPUT@' - ], - depend_files: tracetool_depends) - endforeach - endif + traceable +=3D [{ + 'exe': exe['name'], + 'probe-prefix': 'qemu.' + target_type + '.' + target_name, + }] + endforeach endforeach =20 @@ -4031,6 +4016,14 @@ if have_tools install: true) =20 subdir('storage-daemon') + + foreach exe: [ 'qemu-img', 'qemu-io', 'qemu-nbd', 'qemu-storage-daemon'] + traceable +=3D [{ + 'exe': exe, + 'probe-prefix': 'qemu.' + exe.substring(5).replace('-', '_') + }] + endforeach + subdir('contrib/rdmacm-mux') subdir('contrib/elf2dmp') =20 @@ -4063,6 +4056,32 @@ if have_tools endif endif =20 +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_opt= ion('bindir') / t['exe'], 'install': true}, + {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'i= nstall': true}, + {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true}, + ] + cmd =3D [ + tracetool, '--group=3Dall', '--format=3D' + stp['fmt'], + '--binary=3D' + stp['bin'], + '--probe-prefix=3D' + 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('tools') subdir('pc-bios') --=20 2.44.0