From nobody Thu Dec 18 19:33:15 2025 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=1599725608; cv=none; d=zohomail.com; s=zohoarc; b=LO25EcP0M0Bc26ipcC7BfepS0QlT0mCVGWmnt5A95W9ovvGOnsRLgg+om9NojNMxFlEa2oMfrNqqezxeGknhIV7EK6CkSyNv2DxoEBBqx3l+o2sMCBHQA3xRIYrcTbozF83LUu/XdRXvXlHQOoZGySKD/ZQOo2LTc946dMeDv5k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599725608; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nMrDvCPiLS3qactv2cpG6RZ0nflNlVJiAcKxN681dHU=; b=NqkQDdnwq8szArX7xO2oj+zohCC/uTLsSSMeEnANE47mJD+qoC1O1oICmFN7F+/JGWU6EtB/JeKgmKGR+Ul+QbSNMCbH2jdE6jhK8wErmVFfuylsNIxUbBCrJpErhWzn4o7gnmPf/5iMElQIR5rZ0wCOIBb9shOJS0Ey5Y2cLcE= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599725608350584.5917279562639; Thu, 10 Sep 2020 01:13:28 -0700 (PDT) Received: from localhost ([::1]:53646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGHhv-0004z1-58 for importer@patchew.org; Thu, 10 Sep 2020 04:13:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGHfy-000212-FQ for qemu-devel@nongnu.org; Thu, 10 Sep 2020 04:11:27 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:21505 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kGHfw-0002w9-8g for qemu-devel@nongnu.org; Thu, 10 Sep 2020 04:11:26 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-446-DLr4MiqMMRmAe5WbZ201XA-1; Thu, 10 Sep 2020 04:11:21 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E34D8015A8; Thu, 10 Sep 2020 08:11:20 +0000 (UTC) Received: from localhost (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0950610013D0; Thu, 10 Sep 2020 08:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599725483; 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=nMrDvCPiLS3qactv2cpG6RZ0nflNlVJiAcKxN681dHU=; b=au/r8ub0nnrKEnDpKIlfIj1gmXR/zarqXaN2C2s5MyzTyk5Ku/6pbnclSdu/7ln3UgcvEo 7wJltCdJd9Cqxh3wEM8AppuoZFnFJ/LrlyKep4L5P/kzPU+FE2dQggmmH2kE+NUc4d1w1k C3mq9FmUySxBV6PuYcqjzTyBYAfG7F0= X-MC-Unique: DLr4MiqMMRmAe5WbZ201XA-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 2/8] scripts/tracetool: Fix dtrace generation for macOS Date: Thu, 10 Sep 2020 09:10:43 +0100 Message-Id: <20200910081049.38393-3-stefanha@redhat.com> In-Reply-To: <20200910081049.38393-1-stefanha@redhat.com> References: <20200910081049.38393-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=stefanha@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=205.139.110.120; envelope-from=stefanha@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/10 01:23:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MIME_BASE64_TEXT=1.741, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Roman Bolshakov dtrace USDT is fully supported since OS X 10.6. There are a few peculiarities compared to other dtrace flavors. 1. It doesn't accept empty files. 2. It doesn't recognize bool type but accepts C99 _Bool. 3. It converts int8_t * in probe points to char * in header files and introduces [-Wpointer-sign] warning. Cc: Cameron Esfahani Signed-off-by: Roman Bolshakov Reviewed-by: Stefan Hajnoczi Message-id: 20200717093517.73397-2-r.bolshakov@yadro.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/format/d.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/format/d.py b/scripts/tracetool/format/d.py index 0afb5f3f47..353722f89c 100644 --- a/scripts/tracetool/format/d.py +++ b/scripts/tracetool/format/d.py @@ -13,6 +13,7 @@ __email__ =3D "stefanha@redhat.com" =20 =20 from tracetool import out +from sys import platform =20 =20 # Reserved keywords from @@ -34,7 +35,8 @@ def generate(events, backend, group): =20 # SystemTap's dtrace(1) warns about empty "provider qemu {}" but is ha= ppy # with an empty file. Avoid the warning. - if not events: + # But dtrace on macOS can't deal with empty files. + if not events and platform !=3D "darwin": return =20 out('/* This file is autogenerated by tracetool, do not edit. */' @@ -44,6 +46,17 @@ def generate(events, backend, group): for e in events: args =3D [] for type_, name in e.args: + if platform =3D=3D "darwin": + # macOS dtrace accepts only C99 _Bool + if type_ =3D=3D 'bool': + type_ =3D '_Bool' + if type_ =3D=3D 'bool *': + type_ =3D '_Bool *' + # It converts int8_t * in probe points to char * in header + # files and introduces [-Wpointer-sign] warning. + # Avoid it by changing probe type to signed char * beforeh= and. + if type_ =3D=3D 'int8_t *': + type_ =3D 'signed char *' if name in RESERVED_WORDS: name +=3D '_' args.append(type_ + ' ' + name) --=20 2.26.2