From patchwork Tue Jan 25 21:56:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12724243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 850DAC433EF for ; Tue, 25 Jan 2022 21:59:02 +0000 (UTC) Received: from localhost ([::1]:57626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCTq9-00039Z-9J for qemu-devel@archiver.kernel.org; Tue, 25 Jan 2022 16:59:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToR-0000LA-Vp for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:16 -0500 Received: from [2a01:111:f400:fe0e::730] (port=45285 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToQ-0002Hu-FD for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:15 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OXeIWgvwjLqWRjXK8q3hncuKmmV6wgNM9A/CyiNgCLxpbto5MDX24b9Xp84E2+oGtXiKZMdBZWdXbUsTBr66Bf9awVvO+S674TUfFOEDfGuBqyggkLMxgEFkktLOHrewZtMJNL15Onxukmc5reyiL8En/Wsvwq/4uMvKo5FYfYznZzMTbkPoDLBX04PrR+iSgMAd/Z7fmsXyg0yBFUFELKFL32REPu/kPXy3YYqJeBwdPYFB+O2JTXaxN/Ob8N1qimR33Z55C6z0N71nQ3D5sdC8EOQes600EVwCtZ0dzkJ1Qul+mIqjIvb/Pg671RwDJKU2wdOpaxmK22bCpgymew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZJXw1XbbFlWi8NF93qnESYcCJ4iSWrjY3fwRgXbqmLU=; b=jN760fNoEZHoi38+JjDUnqt4wAub2AF4MkqU4PlWUPCwo8eCtMo5xmUnnn7x9qoyLZEUT5qrnVW+TMWNzy/wHQ1/yyspC4LkFFvKvZyh9k776gqbMiEfXJVJ4+oA1OsAl8GTHIwuaq0sSoS06vilKq4HFAEtNewY7sDwqBGz+SO6VBIV4EeSeOIdWWXFKO1ErOH+D4bELPBUpdPU9ipQoFoBoEZCu8+xlYTLzLir1zhlNCbKQjzh80ELRqyva4mIuBhBkV0/2gt8XHEhhVj/prYewO8p+dvoBcag2bmJRIes3unZcQxb/ac4pmuKQ+8SiZyZWGoJHEvtiIVixDkrCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZJXw1XbbFlWi8NF93qnESYcCJ4iSWrjY3fwRgXbqmLU=; b=Tda+1RkojzS4H70nb0dRgrZYxa3rj0SEeIwZ8/H9D8G6oJuGMmBL2MgrluA4FCJhI8tR58A/B4fJmwCsrn6dhvZp/rP4x3oDP+xrZPNCTqRajnYZbK9cVoIeEwehUKE0Y6ebNZag6vPm740UiX3jA5XPOMqzy/Hl4KT6vcPJOMI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB7PR08MB3082.eurprd08.prod.outlook.com (2603:10a6:5:1d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Tue, 25 Jan 2022 21:57:08 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd%3]) with mapi id 15.20.4909.017; Tue, 25 Jan 2022 21:57:08 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, michael.roth@amd.com, armbru@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com Subject: [PATCH v5 1/7] scripts/qapi/gen.py: add FOO.trace-events output module Date: Tue, 25 Jan 2022 22:56:49 +0100 Message-Id: <20220125215655.3111881-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220125215655.3111881-1-vsementsov@virtuozzo.com> References: <20220125215655.3111881-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FR3P281CA0075.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::23) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 000a7b58-fd60-4153-6540-08d9e04da197 X-MS-TrafficTypeDiagnostic: DB7PR08MB3082:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:148; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u70wAeqDKKkQuiArALoVueQC+elJk7d179f/mbilLTDkXJrrY4SHtN48BhD0lZJnHSkK7FX/9nxcyxMpWtGozVw8Qkltv1cmFnVG7+RmungWXWW6NpikuFqGHSjh6uMkfXtnswb+UMuWDEARYZ65WCo4nTrJDrQWbXY3Afh3p04IZ9uwIe0MpAFZsQrXFN8OUi2A8pj6iokzS6wJDFWxyC6RDm3jGVy7o27sZHWKTWL0My8R6XQOEPH38XlvgxpBmBqSRiP1VI5ntpH9fTcIRx+dgYFmu1qpf+GkPHM1Oc+ekszfiY9ei4nTWdC7VMN7KDxQfSYvNtXSSP9C1zMvPob4OunpnJwtwGOMVBC31de3DXBx2/mJnJyLOgdq50uNAHp86h+sWToUzv630FXdpY1aZYADuQYdXcH19MaLxeXiuX6Y3/YQV99C+HRrksn93uHuZUI1a5Y6SaqxZV1UcPSxdXk++a/LwsITzfSYQn6RDPDwu8wumIL9nvEcY9PagAzKTGCKP9JMoIJJi1sbZhw1Yn7nwNs+QnRDsd9CZs5L8tXSBsg7vGVFJAMWhWRdDXUbqs8KpBgnXvDOkKsm1B8RLx/XD3SXXZz+3Kil6FNvi628oQIkn3cX5ZkUNQUHHSRbU8qHh7PSc5rgX0gy4JvZuJS0qLU6gWWx058WU1wZLJqAo6X8PLUE32R2q8TfhZwEWi5STCDpmvzYkbmLEg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(4326008)(2616005)(6916009)(86362001)(66946007)(186003)(36756003)(8676002)(38100700002)(8936002)(38350700002)(508600001)(66556008)(66476007)(5660300002)(52116002)(6512007)(6666004)(2906002)(83380400001)(6506007)(316002)(6486002)(26005)(1076003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kZ8xJr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nXfLxQou7rLX6xG2g6MXuN8hJw4C5ZM+hF1XbOJAEv9UIJKTaZ8Z3LEowdBgcAqO+GrbueJbsI0vA4PsvF4kCrwVnUJ55TBiXSg8dliZebuof4EidUEtO9MX1bIJaQ8xnA32nwQeEtrdrhOj+YtkB9O0yYWRdpe1Ld2cmcdx6xoNNT8TpiK1h29oOieoIj96jUnccshhDAMHPzoOKqXb3V8KIXqsyqr4N5Xksf9NXilquiGHVtgnxf9uTdcBKw5G1I5EOnt7NKc63xoH5jN3PXwHiy8qoto4X8PmSJHYA/HqOL/V/SH40vu6t2QVKKaWE5xPBcBHbl7wCAu3l6vIqYOsbL+qhrMehIrXpy2GDkjMajHNBPG4zf+MrLUGCy4G4i5Yj3g59EOu7S7dnAzJaw9YDhDKnOfQPtZ336RFdlDZBhQjAROQt6c7mXLZq6hlFq6d/wq3RF/XL77RcX7daDQ+xT25wLURXMVdZPJ1FHa/P6iDfoOoNaylhi3hVrZUXXbLHwKooxhbJ05ltkTI+UDqzb7LZw+vxEhxOkEOw71L9IkUgoqP/3xaNFFrhrBGWf3Z0NYypJ8lHubanrxHP5j9P1N4O9/0PrgH96iOA= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 000a7b58-fd60-4153-6540-08d9e04da197 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 21:57:08.1229 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZxLhV5Etp8I9gwetyEuwrhyhH9kFwh3Nm/NXOiQKKnEDAzzgm2lHq5CEHU6jc/X+yxNK1a9VqTiI0vh0ZooCITeLJRL7YzjuuoUao0R0tDg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3082 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:111:f400:fe0e::730 (failed) Received-SPF: pass client-ip=2a01:111:f400:fe0e::730; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We are going to generate trace events for QMP commands. We should generate both trace_*() function calls and trace-events files listing events for trace generator. So, add an output module FOO.trace-events for each FOO schema module. Since we're going to add trace events only to command marshallers, make the trace-events output optional, so we don't generate so many useless empty files. Currently nobody set add_trace_events to True, so new functionality is disabled. It will be enabled for QAPISchemaGenCommandVisitor in a further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/qapi/gen.py | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 995a97d2b8..a41a2c1d55 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -192,6 +192,11 @@ def _bottom(self) -> str: return guardend(self.fname) +class QAPIGenTrace(QAPIGen): + def _top(self) -> str: + return super()._top() + '# AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n' + + @contextmanager def ifcontext(ifcond: QAPISchemaIfCond, *args: QAPIGenCCode) -> Iterator[None]: """ @@ -244,15 +249,18 @@ def __init__(self, what: str, user_blurb: str, builtin_blurb: Optional[str], - pydoc: str): + pydoc: str, + gen_trace_events: bool = False): self._prefix = prefix self._what = what self._user_blurb = user_blurb self._builtin_blurb = builtin_blurb self._pydoc = pydoc self._current_module: Optional[str] = None - self._module: Dict[str, Tuple[QAPIGenC, QAPIGenH]] = {} + self._module: Dict[str, Tuple[QAPIGenC, QAPIGenH, + Optional[QAPIGenTrace]]] = {} self._main_module: Optional[str] = None + self._gen_trace_events = gen_trace_events @property def _genc(self) -> QAPIGenC: @@ -264,6 +272,14 @@ def _genh(self) -> QAPIGenH: assert self._current_module is not None return self._module[self._current_module][1] + @property + def _gent(self) -> QAPIGenTrace: + assert self._gen_trace_events + assert self._current_module is not None + gent = self._module[self._current_module][2] + assert gent is not None + return gent + @staticmethod def _module_dirname(name: str) -> str: if QAPISchemaModule.is_user_module(name): @@ -293,7 +309,14 @@ def _add_module(self, name: str, blurb: str) -> None: basename = self._module_filename(self._what, name) genc = QAPIGenC(basename + '.c', blurb, self._pydoc) genh = QAPIGenH(basename + '.h', blurb, self._pydoc) - self._module[name] = (genc, genh) + + gent: Optional[QAPIGenTrace] + if self._gen_trace_events: + gent = QAPIGenTrace(basename + '.trace-events') + else: + gent = None + + self._module[name] = (genc, genh, gent) self._current_module = name @contextmanager @@ -304,11 +327,13 @@ def _temp_module(self, name: str) -> Iterator[None]: self._current_module = old_module def write(self, output_dir: str, opt_builtins: bool = False) -> None: - for name, (genc, genh) in self._module.items(): + for name, (genc, genh, gent) in self._module.items(): if QAPISchemaModule.is_builtin_module(name) and not opt_builtins: continue genc.write(output_dir) genh.write(output_dir) + if gent is not None: + gent.write(output_dir) def _begin_builtin_module(self) -> None: pass From patchwork Tue Jan 25 21:56:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12724248 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 213CEC433EF for ; Tue, 25 Jan 2022 22:04:51 +0000 (UTC) Received: from localhost ([::1]:36882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCTvm-0008Jt-0N for qemu-devel@archiver.kernel.org; Tue, 25 Jan 2022 17:04:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToU-0000N1-9r for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:19 -0500 Received: from [2a01:111:f400:fe0e::730] (port=45285 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToS-0002Hu-9E for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cXK67VVu/mP1FxkPsqp7TMLGNpIAgTGPH3V3t4NT5xKQRVSM+izsfGfWFz01qJs9hl4QVHAv5IGIdIg1kFpGeQBkLrpCb/kTvWrqBb7Q9NT3w1sLyE3B/EjoK/mrXEFIjhP9vXTBwn4raSe5YgZagYN7NDinXhkuTQRPRqkReMyN+UaVRSrb98ZZPQrV6p3sZsB/8P7q38GZgcMseYS/CxmuxStalxt1YfHfb1fCou10PE7vYUTSHkki7Z2ice1WaT6kEJ7RvdPo2uPbU2PsLV07QH3xdr/7MHwG2Hnb5k8B8JsNx5JH6GL3f7Z7M51Vw1NWhH0bLMrRbkCWfSfucg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VRFQ0JsfCke1/wNAD9Z1HgO3BWeNqFg0wScqSQxuNOo=; b=RVP2V6d4SQ6gUVRfuCpc0mDhSoXs8t+4BXLgcGf0AykmGws0GNEfvT2/2ws+FVI6yhASoyCNhk70MDdUXd23k0RsH7yGGAdIMXFq/SR+Hp0STwn7m2oNu7t7KOjMPWZl2TCJqQyJPbVqxQSe3Lz8SrqOCKrPWZVbCXfydfODSZ1T/EyGgrpAtlVdj48pzB+BT+cgY93fiaQjsGfUAU+VpOEaylVQ2zEOvEmFte8Wr5JNAtcw5Ja4rXwgr5jnH7xnAxBftDdsQuaJSyJOcKXCTM8qv+WXVk6moGueAJd6t4HIYsAMv2yx2LsJSGtyzkSKosGAd2o0dhiadqXOF3m38w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VRFQ0JsfCke1/wNAD9Z1HgO3BWeNqFg0wScqSQxuNOo=; b=dKvFtN0tlq7i66ta8oXgYY+YmAKKRjE28P5WNnbBg9kIpOWd4YPxpqDZ3TOV/VemB+W9zcwuizSnBRjda9EX2mIgft/q7aDNPU3OlahQArFRB/GvdxycYkVeA2/X0EPelw2PHygtquEL0wYjB4+VinUxGduUdR9aqW58OrXCqoY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB7PR08MB3082.eurprd08.prod.outlook.com (2603:10a6:5:1d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Tue, 25 Jan 2022 21:57:08 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd%3]) with mapi id 15.20.4909.017; Tue, 25 Jan 2022 21:57:08 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, michael.roth@amd.com, armbru@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com Subject: [PATCH v5 2/7] qapi/commands: refactor error handling code Date: Tue, 25 Jan 2022 22:56:50 +0100 Message-Id: <20220125215655.3111881-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220125215655.3111881-1-vsementsov@virtuozzo.com> References: <20220125215655.3111881-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FR3P281CA0075.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::23) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: baf7de96-5dfa-422b-0251-08d9e04da20a X-MS-TrafficTypeDiagnostic: DB7PR08MB3082:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:29; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2tynbWwKWiJdVf82+YcvVjVj9aR8b3xvmQcenddcRtA+1IQkbnKBKjeFqy8UYzBeIoUkEyRIlINpet7zVDZrF98BWn0Ow1qH1Lfxr8oONdF4tp4+4XzizQxFyFqJd10PBB0jDdLXeF6XbF8wIPAHyVQslX2941XG/Ud74p66CeiDTVIMOi97/77mld+92uQ/x+YxNlUI+Bre7qgcDEyTBYoa0rcPsjpoiA+9lZBwPYe12TdUme0R9LpJphr1/PlUXTAGAq8fn+QQhVOeFitKZ/fg23tIzCQwP5Yvtqsu4GQbG73ac2hrCCfBen99uG8TGzifiFsVJ29Qa+WM/iOcRuj2Jyhs3be7JLXxaO6KKlZ5/M6Ola8W5YbC2PEAxYIlN4Ao7TaTQ0w+KCVW2QyKegNcLCc332t/VU/QDISNlg4bUUjBul+26tC5b68zRbZYpMabWV9friT2225A8CKkmRcXgXzRk7JH2z7f5fMfG8KnMgZ5ier0DgNRCdvDU56HLHE/MDjKUnjAmccOmNhIN+HS2UHkB+mZIdwBNTCt5rskWjzW5cGGsF1UtSo1V1UJJ4+B0aHu9vEX2lzaSrbtltk/ebSqn3a0BwS2p1Va/Hgsw+FBvOzsLCjXh1pTUs8C/NG2BvM9TFXW94GX5+q7LK5PFGkTUi9b0B1Sc5Os1WzBhVCJ1R8ePnX99vEIIUUf2TfahgILqzHqAx1GfAiQpQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(4326008)(2616005)(6916009)(86362001)(66946007)(186003)(36756003)(8676002)(38100700002)(8936002)(38350700002)(508600001)(66556008)(66476007)(5660300002)(52116002)(6512007)(6666004)(2906002)(83380400001)(6506007)(316002)(6486002)(26005)(1076003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BiPPlevg/obzjKIDU4ACK+7DbbGsUex63zqDQmh6BX9l7v52FGlvbBOhhJ4KjwGinBYMfEfV9QWJ2snEubdhqs59cZceeEZU3C28xANmkn8/z+WZicJo/TXWb0qITN7oUBh8/jhQmD3LaZK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c3u/7o5NLrGczgvNKJVbzh0nc6e5vXn8s10jf/iWIce6xfWrazqT4lZ67tw4vcKC6aaxXF7vzfkFuNr7MSiZrAzuf5h7V/mI7uLoxnPbg6jcRDbg6Bs980pQp5KXmkLE/P32UguJ6wTK3ecb72quMekgtODUb9ORtnJTvvoTOmXhw4+TRvHi/nz1kb6g+dxsBefOyMnfXqNnQDhleHM8havBRe9+IbeMyyC8RBgmn01ZgNThyTqM89VTONyNpssU0IuIErm4MB9eD0ZFfnViI2swB25z+P4pHGqGctPe5YgYhJN6jnrbs8BUV0RI4vwbEshJ35HmduLsNXJYY7oycGu11RcTydFD82ibRBTqlhJvGINo2PGaa8EZ48m4o7SZ6DowciNdMJ39ssH0HtCLZ/lkCKKwKqLmzQKfYul9HC5n2kbrajTiyjCDzhL329hLwG8TfTUgFBufxRlzGaOFQCnW1rL35Z2AOAdGt9c= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: baf7de96-5dfa-422b-0251-08d9e04da20a X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 21:57:08.8116 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lyCgkaWgJYKO0x5bMEdNgJA1wWEjIkDTBQZe4zEsnpbfb89SAocCkJXPLRJOLQN4ITvxrq6w7XYtoG6GJBafRxyxM7UjYcZdJKsrzfWEn8Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3082 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:111:f400:fe0e::730 (failed) Received-SPF: pass client-ip=2a01:111:f400:fe0e::730; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Move error_propagate() to if (err) and make "if (err)" block mandatory. This is to simplify further commit, which will bring trace events generation for QMP commands. Signed-off-by: Vladimir Sementsov-Ogievskiy --- docs/devel/qapi-code-gen.rst | 2 +- scripts/qapi/commands.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index a3b5473089..feafed79b5 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -1690,8 +1690,8 @@ Example:: } retval = qmp_my_command(arg.arg1, &err); - error_propagate(errp, err); if (err) { + error_propagate(errp, err); goto out; } diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 21001bbd6b..17e5ed2414 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -74,14 +74,18 @@ def gen_call(name: str, ret = mcgen(''' %(lhs)sqmp_%(c_name)s(%(args)s&err); - error_propagate(errp, err); ''', c_name=c_name(name), args=argstr, lhs=lhs) - if ret_type: - ret += mcgen(''' + + ret += mcgen(''' if (err) { + error_propagate(errp, err); goto out; } +''') + + if ret_type: + ret += mcgen(''' qmp_marshal_output_%(c_name)s(retval, ret, errp); ''', From patchwork Tue Jan 25 21:56:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12724249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68B9FC433FE for ; Tue, 25 Jan 2022 22:04:53 +0000 (UTC) Received: from localhost ([::1]:37092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCTvo-0008SD-8k for qemu-devel@archiver.kernel.org; Tue, 25 Jan 2022 17:04:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToW-0000P2-8s for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:20 -0500 Received: from [2a01:111:f400:fe0e::730] (port=45285 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToU-0002Hu-AH for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:19 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FEhBsqN3/I4oqrcCStie47zUyhNPWMKUJ7SC99ZYrIKvSM2Ok+Hy3ehcBQmy+B+v+HnlfpP/KQgqjJmiFIvAEIQNAlCmn+fuE7xP9m+PW8HoXOQa0rblUfpVOV0hSN9gGKvPa6lFWkqpW32/6MQRJKHU7YYW1FRvgMFUW7g3erdUIJ6vGUGutxo1fJ4RJ+InB2ltwf5jaLfG0Sek5gZPw7bPS/tJynwlmv0L37AOdmGpS5fGfg50pyXbMd83qO63iG24VfjNwm5R0DKDkX9FR5fu6EOYQVL/qnN2zEwKH9d/faatvaVGycjg7YpaXpn109wIw7ca4wTzb5bdZiSazw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZVAlJimHKjh/kHgoCYGOPONZamdUMESABFMuq1nxa5U=; b=Vr10cUuuF9UXNVZQgm6MW+uyQwcqhUz9ER8Um/4gFprVaHyLCamkPKKYOt6NQ/UMjW5v4gDzlopuJmPL1/0mkknyzB4z5vbOXM5uygsFVimF+qJtEMXHwxIteQqGh2ruxbjfitPR/ZpVqJSa4jxZQ7y2YZqNM9JOl6PzskK/vJ1Dkj//QvbOAXvrjhiLmtxTBvVglQ4DY4iA9Sw0FarxFeFuracuUQvd2CeRtf+U7X9bWMSmq/2z3VtGKQ60UE4nEWOZ7MgUzrSFZdyqsr3xvfLziApBJul0iCHZ1I2DmarAr029bdg7qoGvb8BcDVxmKg8lxJ7lMwrNnfQ3HR1OWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZVAlJimHKjh/kHgoCYGOPONZamdUMESABFMuq1nxa5U=; b=Y328pjhwCDKV7VtABVx4/g3mUjzBI50Ql9fmvNNHZVJiJClm4QNM3SlSAuNygKsGG1NLeVyL9Oj3SmESRW2NsGHXhIt/7ei6cglHk9H5Z6Ta2dEO2CcyO/Z3ZT7Vj1RtvsPhlJtZRR92EM1ZxmZlojctvI+A2r2zuOD0SXXai/g= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB7PR08MB3082.eurprd08.prod.outlook.com (2603:10a6:5:1d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Tue, 25 Jan 2022 21:57:09 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd%3]) with mapi id 15.20.4909.017; Tue, 25 Jan 2022 21:57:09 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, michael.roth@amd.com, armbru@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com Subject: [PATCH v5 3/7] qapi/commands: Optionally generate trace for QMP commands Date: Tue, 25 Jan 2022 22:56:51 +0100 Message-Id: <20220125215655.3111881-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220125215655.3111881-1-vsementsov@virtuozzo.com> References: <20220125215655.3111881-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FR3P281CA0075.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::23) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67f3f3d7-a9d9-4ec5-e4e5-08d9e04da272 X-MS-TrafficTypeDiagnostic: DB7PR08MB3082:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1728; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kxPBNa3MpRdTp50jgcucsGfNTNnnEJiqPt1dl54yolLTvxpUzuwE6ZNkUcp2v4ZD8xek7V9qhSR18y53F+2hVCDbrphL1JWkRYanQvQxuk9Lvy6HU37aOlSI6beyjrBnEV0klewXdCV+CsMR2uPjYtLQYeWhbURO78MrEnwFEu7Tv4MV1qxpR0DJKHYLqHqdJek4UxXM02HE/y/X0HXXk/nUL18CQFS15xzJHIJG8ssCeBhBx27B33AxsXbkDFB9e8Hlt+f1Dl9pF2B1XihcJ0k9JM9F15FMlaGudtbP+aesPyWQjgj20r2RYYz2mRXA0CIiGtMLx+jcNXu1irgnY7PR0/DtMGfxPg2CrnbLBhfu9TqDwrFksw01be9LCP/IbgMLIHZY2oGdDYpao/ERo3mmYmLanXQxWTIX1RyjIL8ARQeC5zM+aUXBrgJs18PjLM0FcgGu6tx8DEihg4koW13MlooZ3/qjPxzPhI+eHPFR2ZvxLm8GdMWi8x56leTCOrBMqggDgIKJdXrVgjxyrqujCliLYORLwpWwd371i6hskAZvHvwHmGCyL3xKtC5d2m+UYv/ZBuNKUMVTQPIJrMUae05RDvgThC/jNhPvNJKfb04Qp/O+zoI3YAkaFG1l90ty4+JsUec781uJZtwoDaMlkWIG03j9Dj8cs20vdaULXaKhiFcUTMGHRWWxEzFVwZmO2HTM98A2Lip/HFFr6w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(4326008)(2616005)(6916009)(86362001)(66946007)(186003)(36756003)(8676002)(38100700002)(8936002)(38350700002)(508600001)(66556008)(66476007)(5660300002)(52116002)(6512007)(6666004)(2906002)(83380400001)(6506007)(316002)(6486002)(26005)(1076003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WEAbLBdmY2S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U+DruqKIh538cmBKktlr4nmz8x/Hy3OJkEUU0BY+ErDmGaIx3p+X0GfEgW1Tm1Q8cL3Wyx73epGBzRjH/G/Ur2thhVafgzL7ZUmO4r1m7Gta08XjKaM86NOJmBkd0qQ3KAQpCONue5Y6OObb0xi6LJNgV2G+0Fz8zcibkIZYpVjxZJuxy8vjy+jIYYvfqxYI47ha1OBlNXJlsNpgdhPTZwhp94bcAvgInyyZhJz1Z7YZS7/WQyQ/UsR8HxteCzrMk1u10FAH/PyAfttG9MPVwtzyzRJvYiO502S3ed9iSJUiyimKDfzb4cYtA45tESB5HB3f9iRokwc972bOaoFCajb6VmfXGtvZVQQmAduT8hZ4VkCwO8iueeYXdkPJoGZyI6YiKMDqBAZBU57qv1mAWpRqG+gvF4+xQB8+BV0EmL/cgKILvBi8BHpfJoB8VwZBhzhpTCpv4daetkqw4xFAP6H7U1OlDKrHvLRmLAXKwpa1ktnUw24awoH+d24HcTpAeeqVU3Yngc+6QiEj6eeXzC1PzIaBrzPGpF9yV9owwl4Oa5uGOqWHoo3DACNeog94D+2gklSoGOUu0KJhdSzdXYFHLYw== X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67f3f3d7-a9d9-4ec5-e4e5-08d9e04da272 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 21:57:09.3897 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nmhcW5/LNeTaXf9H5mNkCCKyOpBW1S5YQ1Ue/ohx5CstBJBj4AzLapCBw1SLFysDPhs2yYVfmI43/a/+o+GGNH+igapC50uawOY5aTxkAAo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3082 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:111:f400:fe0e::730 (failed) Received-SPF: pass client-ip=2a01:111:f400:fe0e::730; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add trace generation disabled by default and new option --gen-trace to enable it. The next commit will enable it for qapi/, but not for qga/ and tests/. Making it work for the latter two would involve some Meson hackery to ensure we generate the trace-events files before trace-tool uses them. Since we don't actually support tracing there, we'll bypass that problem. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/qapi/commands.py | 91 +++++++++++++++++++++++++++++++++++----- scripts/qapi/main.py | 10 +++-- 2 files changed, 87 insertions(+), 14 deletions(-) diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 17e5ed2414..0c171cb880 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -53,7 +53,8 @@ def gen_command_decl(name: str, def gen_call(name: str, arg_type: Optional[QAPISchemaObjectType], boxed: bool, - ret_type: Optional[QAPISchemaType]) -> str: + ret_type: Optional[QAPISchemaType], + gen_trace_events: bool) -> str: ret = '' argstr = '' @@ -71,14 +72,37 @@ def gen_call(name: str, if ret_type: lhs = 'retval = ' - ret = mcgen(''' + name = c_name(name) + upper = name.upper() - %(lhs)sqmp_%(c_name)s(%(args)s&err); + if gen_trace_events: + ret += mcgen(''' + + if (trace_event_get_state_backends(TRACE_QMP_ENTER_%(upper)s)) { + g_autoptr(GString) req_json = qobject_to_json(QOBJECT(args)); + + trace_qmp_enter_%(name)s(req_json->str); + } + ''', + upper=upper, name=name) + + ret += mcgen(''' + + %(lhs)sqmp_%(name)s(%(args)s&err); ''', - c_name=c_name(name), args=argstr, lhs=lhs) + name=name, args=argstr, lhs=lhs) ret += mcgen(''' if (err) { +''') + + if gen_trace_events: + ret += mcgen(''' + trace_qmp_exit_%(name)s(error_get_pretty(err), false); +''', + name=name) + + ret += mcgen(''' error_propagate(errp, err); goto out; } @@ -90,6 +114,25 @@ def gen_call(name: str, qmp_marshal_output_%(c_name)s(retval, ret, errp); ''', c_name=ret_type.c_name()) + + if gen_trace_events: + if ret_type: + ret += mcgen(''' + + if (trace_event_get_state_backends(TRACE_QMP_EXIT_%(upper)s)) { + g_autoptr(GString) ret_json = qobject_to_json(*ret); + + trace_qmp_exit_%(name)s(ret_json->str, true); + } + ''', + upper=upper, name=name) + else: + ret += mcgen(''' + + trace_qmp_exit_%(name)s("{}", true); + ''', + name=name) + return ret @@ -126,10 +169,19 @@ def gen_marshal_decl(name: str) -> str: proto=build_marshal_proto(name)) +def gen_trace(name: str) -> str: + return mcgen(''' +qmp_enter_%(name)s(const char *json) "%%s" +qmp_exit_%(name)s(const char *result, bool succeeded) "%%s %%d" +''', + name=c_name(name)) + + def gen_marshal(name: str, arg_type: Optional[QAPISchemaObjectType], boxed: bool, - ret_type: Optional[QAPISchemaType]) -> str: + ret_type: Optional[QAPISchemaType], + gen_trace_events: bool) -> str: have_args = boxed or (arg_type and not arg_type.is_empty()) if have_args: assert arg_type is not None @@ -184,7 +236,7 @@ def gen_marshal(name: str, } ''') - ret += gen_call(name, arg_type, boxed, ret_type) + ret += gen_call(name, arg_type, boxed, ret_type, gen_trace_events) ret += mcgen(''' @@ -242,11 +294,13 @@ def gen_register_command(name: str, class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor): - def __init__(self, prefix: str): + def __init__(self, prefix: str, gen_trace_events: bool): super().__init__( prefix, 'qapi-commands', - ' * Schema-defined QAPI/QMP commands', None, __doc__) + ' * Schema-defined QAPI/QMP commands', None, __doc__, + gen_trace_events=gen_trace_events) self._visited_ret_types: Dict[QAPIGenC, Set[QAPISchemaType]] = {} + self._gen_trace_events = gen_trace_events def _begin_user_module(self, name: str) -> None: self._visited_ret_types[self._genc] = set() @@ -265,6 +319,17 @@ def _begin_user_module(self, name: str) -> None: ''', commands=commands, visit=visit)) + + if self._gen_trace_events and commands != 'qapi-commands': + self._genc.add(mcgen(''' +#include "trace/trace-qapi.h" +#include "qapi/qmp/qjson.h" +#include "trace/trace-%(nm)s_trace_events.h" +''', + nm=c_name(commands, protect=False))) + # We use c_name(commands, protect=False) to turn '-' into '_', to + # match .underscorify() in trace/meson.build + self._genh.add(mcgen(''' #include "%(types)s.h" @@ -326,7 +391,10 @@ def visit_command(self, with ifcontext(ifcond, self._genh, self._genc): self._genh.add(gen_command_decl(name, arg_type, boxed, ret_type)) self._genh.add(gen_marshal_decl(name)) - self._genc.add(gen_marshal(name, arg_type, boxed, ret_type)) + self._genc.add(gen_marshal(name, arg_type, boxed, ret_type, + self._gen_trace_events)) + if self._gen_trace_events: + self._gent.add(gen_trace(name)) with self._temp_module('./init'): with ifcontext(ifcond, self._genh, self._genc): self._genc.add(gen_register_command( @@ -336,7 +404,8 @@ def visit_command(self, def gen_commands(schema: QAPISchema, output_dir: str, - prefix: str) -> None: - vis = QAPISchemaGenCommandVisitor(prefix) + prefix: str, + gen_trace_events: bool) -> None: + vis = QAPISchemaGenCommandVisitor(prefix, gen_trace_events) schema.visit(vis) vis.write(output_dir) diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py index f2ea6e0ce4..ecff41910c 100644 --- a/scripts/qapi/main.py +++ b/scripts/qapi/main.py @@ -32,7 +32,8 @@ def generate(schema_file: str, output_dir: str, prefix: str, unmask: bool = False, - builtins: bool = False) -> None: + builtins: bool = False, + gen_trace_events: bool = False) -> None: """ Generate C code for the given schema into the target directory. @@ -49,7 +50,7 @@ def generate(schema_file: str, schema = QAPISchema(schema_file) gen_types(schema, output_dir, prefix, builtins) gen_visit(schema, output_dir, prefix, builtins) - gen_commands(schema, output_dir, prefix) + gen_commands(schema, output_dir, prefix, gen_trace_events) gen_events(schema, output_dir, prefix) gen_introspect(schema, output_dir, prefix, unmask) @@ -74,6 +75,8 @@ def main() -> int: parser.add_argument('-u', '--unmask-non-abi-names', action='store_true', dest='unmask', help="expose non-ABI names in introspection") + parser.add_argument('--gen-trace', action='store_true', + help="add trace events to qmp marshals") parser.add_argument('schema', action='store') args = parser.parse_args() @@ -88,7 +91,8 @@ def main() -> int: output_dir=args.output_dir, prefix=args.prefix, unmask=args.unmask, - builtins=args.builtins) + builtins=args.builtins, + gen_trace_events=args.gen_trace) except QAPIError as err: print(f"{sys.argv[0]}: {str(err)}", file=sys.stderr) return 1 From patchwork Tue Jan 25 21:56:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12724255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1E33C433FE for ; Tue, 25 Jan 2022 22:12:48 +0000 (UTC) Received: from localhost ([::1]:49788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCU3T-0000Yl-VN for qemu-devel@archiver.kernel.org; Tue, 25 Jan 2022 17:12:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToY-0000Xb-GY for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:22 -0500 Received: from [2a01:111:f400:fe0e::730] (port=45285 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToW-0002Hu-K7 for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:22 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nhwJNAU4tt00Z/ghWtUs6PHohDtlr82o9uIO1ElvmkI2vluC5z9MIy6Ny9KL/X8IP4Rfk90njUqveDE5jcCFZ3Y9GUWNDW71bhH/phELCNWczmul7nu46GCjb/pXhEdG/OgGP2xvWWeRAhTi7xpseowHUhH726ZiYdXZJOQaBoF1+oTuiSjrCzxQPRPeMWq4vQuebgNWzFDt/jRvIfWx5j6QnZQr30FnQ8l4EeCBhjTD1okLOTz6mFoRfK5UisjwctNzRul5nsFeIYlI+3E+rd+7O5rvyUREJBK7oqpbkrfZ5MopxZrJnsL2o4XFYUmZagpTnL/hZzBbxxJNEbO28g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qjrzWS3F+KmQWW0jiwNbgkSHwFbDoFobFwg2Ef0pAkA=; b=K8c1PEre+z2u5Tnd36I4BPzoIgvO2+uySUF51znW11ytsVS/JKStV7PGF2xuLu6ekYY4Xb8yGzgNHlGuICthJNjKMwbSJVKZuC8D70SjtnLoiSNruitQyj755BKdSjpAQrZINR0ln8OxkWL4iFJ04gMeSZaPCp+P6Wr9BG23iMXpPQQV2aa+/Ssef7v8+BWuTYisTbPa/lckKk8v4/t2MzWj4C6wjWTnzr2+Bmrn9xhsKcvvUGxsE/JBdyAQ31h44RdMeBsrZEkM1Ltm2thdCcnYM2Zi+e/Ice2InZM4LyBN63tMeg6Li4LWR+cBaCjd3EL+6GKOky+FC2FtKWaRgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qjrzWS3F+KmQWW0jiwNbgkSHwFbDoFobFwg2Ef0pAkA=; b=pChsrKmaGDmQNXBqhH1py+bWSXIobeaAZjnSq/cSdc7254ivRKAtBuPvpXZb3sFOIF4XM4tMiUbSctNhMQcL1ow9L0XDWTv5un9goBiRTdWy9iC3TEfOEravhqzaiA/QeecYEUdw4BRlER+4pfwuONjGXr3R2J5NgwfzUrPyzjA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB7PR08MB3082.eurprd08.prod.outlook.com (2603:10a6:5:1d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Tue, 25 Jan 2022 21:57:10 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd%3]) with mapi id 15.20.4909.017; Tue, 25 Jan 2022 21:57:10 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, michael.roth@amd.com, armbru@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com Subject: [PATCH v5 4/7] meson: generate trace events for qmp commands Date: Tue, 25 Jan 2022 22:56:52 +0100 Message-Id: <20220125215655.3111881-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220125215655.3111881-1-vsementsov@virtuozzo.com> References: <20220125215655.3111881-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FR3P281CA0075.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::23) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9af8c2b0-ebda-4adc-d42b-08d9e04da2d6 X-MS-TrafficTypeDiagnostic: DB7PR08MB3082:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NyBWizf9fpQm7ox2abWGnkm6LWClPZsonamU2Ax3UXNKV9YA51A08utXDVi58VmhmF2YFLZf9O3AZRyOGJl4/zEaVttovzDaT/aFmkVe8BZp+sRmv2QyxfHwjQTd8cuJXSgfiXLLVd7cSqtmWHFhORXhqpFSJpWqZ8xHwpFiQ95Kyt06DVkweT6WAGQwu8B0x/8kWR5lVSPsraVyw69GnwnqoLoFrJNOpOUf8ffn6T99LfGbeF+CsiNVO8NrKhci915LXfsdk9VY55NA1IF/0WMWK10Je/o1f8aUuyne9FCRqqleRHxzlZtVWeRox+BQoGIBYNEFHQVJDyB/oeEO09YI4hIuQwbaalyy/57l19kte212Nwh1g14wUhWz+9rwVWvpMwBIH/F4uQxMzKXF/oO9AMTDuHiN1EDcFd3LxmXsLwyuqh2Qp/aESTZEEdYBnvYQRWziu6aOjXh6GCFE4BgaYgvK5Xg50yzL1cVxfOg+tQNMGFo1abrmWc9GJ5pqtx3banJejrYKuskj5sUrjKECo7fD8HZnzBTlOw+q12ZuaF0WJ5jZep6tQiD4M2+oBgyBRDI3y/fPXdK02p0/rFeDfgDIQ8BwiWPZl+dy4/gghq3izBwRRffw3WqvEfok7TPIW6Tu7ZdUEdNtHGkxYd9Bdir1zgGBS/vMl+js6135W9IQvv3uF45pGqiiDwImJ5plYYiYPK2AxTMfxig+8Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(4326008)(2616005)(6916009)(86362001)(66946007)(186003)(36756003)(8676002)(38100700002)(8936002)(38350700002)(508600001)(66556008)(66476007)(5660300002)(52116002)(6512007)(6666004)(2906002)(83380400001)(6506007)(316002)(6486002)(26005)(1076003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EJYKsw04mrqxq+N5dPnV0t0mwfTBk9F4bApFZlB+tt+xOYObGXCw+Y6eE+LskUkI4CGz9Tnbht2Komv4R1911Lj5gyCWtHVmRDOZ/RR5z3djsIuHr2pHwiAjBcaxX55tS5AusMjhmvJpHWdzPgqCNLGrMSAZ4Cb8XR0EXlpFV83rOFo3KoglKWL2YU+FuEc3fastUi4JeruP0vfdAJGSObwuhyOuFx29Qd6BeQnaDj48EG5ffHkfwL2NgCwdOwoz3Ox5rBT75nWxwXLoC04bbQFre7fcyCLeZQBaCvouXjcEQEZw4BEhOug1xo7/fkexEYNko9zClkCxylfwmB2ieFYn8ZzeUrviqzv7FvxQ2bJSiKIkf4hVo8TJX4cw0NMNjnfyWQrxxzzrCKWs1h4SGoyMF3HXJkti4k973XZ4rqBkadICVtfVm86AIFgw7Pf9b5dtSAFAoFKufnEuT3e+O+XqZ7J6KzKnFktVEZe10UooJxWtQBI+oYZdGVWs6GHiEb6qKX3/oBggR3ctGLbax9grxMxvx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pV6/Kl2uU2LrWimDW+5TUQNaZg13kJB2lYfkx+h8/JJUen6I5Fgc3dwpy4CHTV+PBLZ8mZYLe0BAHow+9MM0JCV++g== X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9af8c2b0-ebda-4adc-d42b-08d9e04da2d6 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 21:57:10.3114 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YcqX2QyUGcSuq5NDgMAV7967WXpd0QA6Q1YKsoD7FSP5lcs309VmjuffWZusfQh3Y8BI9xMs+EQ4qfMxk461IewS5ay57YG9KZLDHuQW9A4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3082 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:111:f400:fe0e::730 (failed) Received-SPF: pass client-ip=2a01:111:f400:fe0e::730; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 1. Use --add-trace-events when generate qmp commands 2. Add corresponding .trace-events files as outputs in qapi_files custom target 3. Define global qapi_trace_events list of .trace-events file targets, to fill in trace/qapi.build and to use in trace/meson.build 4. In trace/meson.build use the new array as an additional source of .trace_events files to be processed Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Paolo Bonzini --- meson.build | 3 +++ qapi/meson.build | 9 ++++++++- trace/meson.build | 11 ++++++++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 833fd6bc4c..e0cfafe8d9 100644 --- a/meson.build +++ b/meson.build @@ -41,6 +41,7 @@ qemu_icondir = get_option('datadir') / 'icons' config_host_data = configuration_data() genh = [] +qapi_trace_events = [] target_dirs = config_host['TARGET_DIRS'].split() have_linux_user = false @@ -2557,6 +2558,8 @@ if 'CONFIG_VHOST_USER' in config_host vhost_user = libvhost_user.get_variable('vhost_user_dep') endif +# NOTE: the trace/ subdirectory needs the qapi_trace_events variable +# that is filled in by qapi/. subdir('qapi') subdir('qobject') subdir('stubs') diff --git a/qapi/meson.build b/qapi/meson.build index c0c49c15e4..b22558ca73 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -114,6 +114,7 @@ foreach module : qapi_all_modules 'qapi-events-@0@.h'.format(module), 'qapi-commands-@0@.c'.format(module), 'qapi-commands-@0@.h'.format(module), + 'qapi-commands-@0@.trace-events'.format(module), ] endif if module.endswith('-target') @@ -126,7 +127,7 @@ endforeach qapi_files = custom_target('shared QAPI source files', output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs, input: [ files('qapi-schema.json') ], - command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ], + command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@', '--gen-trace' ], depend_files: [ qapi_inputs, qapi_gen_depends ]) # Now go through all the outputs and add them to the right sourceset. @@ -137,6 +138,9 @@ foreach output : qapi_util_outputs if output.endswith('.h') genh += qapi_files[i] endif + if output.endswith('.trace-events') + qapi_trace_events += qapi_files[i] + endif util_ss.add(qapi_files[i]) i = i + 1 endforeach @@ -145,6 +149,9 @@ foreach output : qapi_specific_outputs + qapi_nonmodule_outputs if output.endswith('.h') genh += qapi_files[i] endif + if output.endswith('.trace-events') + qapi_trace_events += qapi_files[i] + endif specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: qapi_files[i]) i = i + 1 endforeach diff --git a/trace/meson.build b/trace/meson.build index 573dd699c6..c4794a1f2a 100644 --- a/trace/meson.build +++ b/trace/meson.build @@ -2,10 +2,15 @@ specific_ss.add(files('control-target.c')) trace_events_files = [] -foreach dir : [ '.' ] + trace_events_subdirs - trace_events_file = meson.project_source_root() / dir / 'trace-events' +foreach item : [ '.' ] + trace_events_subdirs + qapi_trace_events + if item in qapi_trace_events + trace_events_file = item + group_name = item.full_path().split('/')[-1].underscorify() + else + trace_events_file = meson.project_source_root() / item / 'trace-events' + group_name = item == '.' ? 'root' : item.underscorify() + endif trace_events_files += [ trace_events_file ] - group_name = dir == '.' ? 'root' : dir.underscorify() group = '--group=' + group_name fmt = '@0@-' + group_name + '.@1@' From patchwork Tue Jan 25 21:56:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12724247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BBF4EC433EF for ; Tue, 25 Jan 2022 22:04:17 +0000 (UTC) Received: from localhost ([::1]:36600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCTvE-00087Z-2C for qemu-devel@archiver.kernel.org; Tue, 25 Jan 2022 17:04:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39450) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToU-0000N2-Fg for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:19 -0500 Received: from mail-vi1eur05on2093.outbound.protection.outlook.com ([40.107.21.93]:28729 helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToS-0002I2-Sp for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mWnHTAbhcudap8Nlg54VoMt/0i+ISXjc5iRnPhE8SIg3dKw7VSG4ckVXEQ/NgDsfZN59BTMGQSKbBTbKsSxAeeaJTPKOT9phg7MZUKGmvXwUK8HDUHkz3t855nEEwA7Z9qAgpV7/AMX6ZOfRkzMXcNE1V1vKT+0XZz2iTs9G9kUSUPJ/s+0UvfHqI/KrDmYX7fB8X8jCnpN2yblFK3hREngxWO6V7ib7f4LqBzDk8TUORq6Y8DoKhX8olAPk4zJ7WZJUbDNZ+BHGmwMJUyU8JXo0RizKOv5pJiX2m6b7kcMLY6moK7U8Oy5e+8EUJ5AXxDdZxUUnEMxKC/u7cKIAKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NRTHyO+fl/HL+TkKMYwZEf2Aps2P3eZU8RX8CT6v93c=; b=d8JnwJlMOoVcxW8gfpw4pa7yOutxdbwp3y644D693uZeBhrKswX1j7tZGHnrbbyoA3un19L56jf1+ffOYeZcR7UGV20SLY4Wj7NbkvT9deR9WOmIMXhv4bH2FB0utjhylf4/eJRgG5yXw0aT8ZxtzK1qRIboEAfLmdIxu5O7vgOGTpBGXS+5yowUOlLIGhbDkrM3kFYqW2mkwpDqsF9Ac16O6DImNa5pjJPcjsWE6BxCNZxig6qBepvacGyZQlfiJeLqWO5hEMNIVYECr1kA8RX8v5eNrRH7Pen5PLomz4xbR8WwlhkITELXlihzsm37jqoY9c6s+jPVJiC7toE40A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NRTHyO+fl/HL+TkKMYwZEf2Aps2P3eZU8RX8CT6v93c=; b=uIkWTi2+1EH1M6nTUvhkxmUbOcX9PddcilAsRAgBAULLRYqFh9PdFfILhpbZSlehnEkpQcyMGZlkdusLAOGIpPyuTQ7woAcGAGn+fsXke5Epl1IXDpK0lkkYMnwuCbRzGMTsKc8NVUemOyhaiYh5pCJhCTo5tDsbOSb+fnFQC60= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by AM0PR08MB2946.eurprd08.prod.outlook.com (2603:10a6:208:56::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Tue, 25 Jan 2022 21:57:11 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd%3]) with mapi id 15.20.4909.017; Tue, 25 Jan 2022 21:57:11 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, michael.roth@amd.com, armbru@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com Subject: [PATCH v5 5/7] docs/qapi-code-gen: update to cover trace events code generation Date: Tue, 25 Jan 2022 22:56:53 +0100 Message-Id: <20220125215655.3111881-6-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220125215655.3111881-1-vsementsov@virtuozzo.com> References: <20220125215655.3111881-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FR3P281CA0075.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::23) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b67a3c50-605f-4578-1d21-08d9e04da379 X-MS-TrafficTypeDiagnostic: AM0PR08MB2946:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1w5mfhLGli9og1nKk76VUmNWIgvUbCLAe1A2LcQtF8rZ1OwWx2fR1KZog+RaxYRwpuW6uzrJQDQu0gcNmzSPF26ZoXxZZa21io9soUkdl7Ly4fRr16Un+3KWENwyV/VDbkP4rbvhbRsdC5fdormTiD/BslrUnyFpjCZ1+7OfKmWT3jduULJEX21enHzYs2hQnj/Hvrc2Hr7xgi6pT9RJVjMZ0QDvQ8xxtmZOskfrFfyrs11Q0fcmjGFsKh7Q2+LC1KV1gJByhnHKBbyIDUF7DZadBG2rP2g+9EoXhiUna6sj9ZThsfvI7bM2RqRAVrEJQK6T9bmxfofGOWpznzuvtYPq1W9CeFKq82CnJxK788qkBW39HMOXdECvrkZuMUu9SbxVBFucHIfYXWV2QExkPBChMdxfiFj+Tk44wmP0VshwK9013XhdQToUqyihtZbee/S9/IzhR8rOPTFcqqdQ3fQ3uCMcUAEOlECPvKcHlL0s2cY8lc66ARFBY+6N07Yhu1Qn+ckBvccGBI+fkXSvkBszTGQZ6MjVIRJ+4pNcvzaM4wF522Lo7TZAhfTbToNi5yA9i+1k0fKasB6k3KtUjItG9sgKpQxmJgiBiHJYGDQAYplksrbwq3bzZruV4QN7UUUIrK9t46wxuUBNIEtHjic6T5wiHr8x1di+4WsmdI4vBe94pT91ASs34cBpMS1flDBvAWv+o074oGPtHRzNLg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(508600001)(6916009)(66556008)(6506007)(66476007)(8936002)(186003)(36756003)(2616005)(52116002)(4326008)(83380400001)(6512007)(1076003)(38350700002)(5660300002)(6486002)(8676002)(38100700002)(15650500001)(316002)(86362001)(6666004)(2906002)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: guuqTeB8b9nq4WiItDbgQBu+fIELT+76qpGgFSDlnNue5Yy36vMQXOrWj3V/Itc3BTQHKGPpxUqZd3QJZqh+KxxZ0n5ct7JD5O7AR0eX/mjJJC6P4jha3Ef0L9jg2T/CDZ4vC+n4cBMjnknHOb84v+m0IG3qXFJoRGSC7cxKS5DzURqjHduewUt4KYhDH5kAHhicGTzXfG9JIQib9pXap+K3cZhmpBVkj4pYdhv/Vyc5serE5TL4qP3LEGMj/T3JiMI08Wf0q+p+GpZe7D6oUH/M9EEZYylP0FI8rcydee/ZJN/nwqm0ZcqMLTAMqYQFE+jXvD5WxgpRili1SK31xvEkWsIYADOKZNWjbo9Y1ukfVFaIw5Va5DHhapAQlA33by6TxgxZMLxcQ/2WLTCy3M6xKxUV5gXLwEj+/ABu4fScEz/YAMmPES/gY1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1b+ZnBDnS3DXxt51hCXLNvqBdHdS+QShCAQJv8wnfKZur7DPq0pXRGnOZOqYR4JbybaHYn8pchBhN8M/YYXIeyuPUZKfO82RlRT8QdtHG3wRVDXNI43ikrda2pb4kcpNi82MOTgrCx1e/O6g47+3HhPvyZQT792vlNUausA== X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b67a3c50-605f-4578-1d21-08d9e04da379 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 21:57:11.0456 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hNhjDNBvUz7CkNImwr6nmbzUOAN9ESc7MpNj4LvHvCGJrSMhTfNtvoF3C7/MHWmD1SMKSGWZe35OEC60OQxONz4oTuOjfeBVWquH5E/FlIk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB2946 Received-SPF: pass client-ip=40.107.21.93; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_H2=-0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Previous commits enabled trace events generation for most of QAPI generated code (except for tests/ and qga/). Let's update documentation to illustrate it. Signed-off-by: Vladimir Sementsov-Ogievskiy --- docs/devel/qapi-code-gen.rst | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index feafed79b5..a3430740bd 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -1619,7 +1619,10 @@ Code generated for commands These are the marshaling/dispatch functions for the commands defined in the schema. The generated code provides qmp_marshal_COMMAND(), and -declares qmp_COMMAND() that the user must implement. +declares qmp_COMMAND() that the user must implement. The generated code +contains trace events code. Corresponding .trace-events file with list +of trace events is generated too, and should be parsed by trace generator +later to generate trace event code, see `tracing `. The following files are generated: @@ -1630,6 +1633,9 @@ The following files are generated: ``$(prefix)qapi-commands.h`` Function prototypes for the QMP commands specified in the schema + ``$(prefix)qapi-commands.trace-events`` + Trace events file for trace generator, see `tracing `. + ``$(prefix)qapi-init-commands.h`` Command initialization prototype @@ -1689,14 +1695,27 @@ Example:: goto out; } + if (trace_event_get_state_backends(TRACE_QMP_ENTER_MY_COMMAND)) { + g_autoptr(GString) req_json = qobject_to_json(QOBJECT(args)); + + trace_qmp_enter_my_command(req_json->str); + } + retval = qmp_my_command(arg.arg1, &err); if (err) { + trace_qmp_exit_my_command(error_get_pretty(err), false); error_propagate(errp, err); goto out; } qmp_marshal_output_UserDefOne(retval, ret, errp); + if (trace_event_get_state_backends(TRACE_QMP_EXIT_MY_COMMAND)) { + g_autoptr(GString) ret_json = qobject_to_json(*ret); + + trace_qmp_exit_my_command(ret_json->str, true); + } + out: visit_free(v); v = qapi_dealloc_visitor_new(); From patchwork Tue Jan 25 21:56:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12724244 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 746CEC433F5 for ; Tue, 25 Jan 2022 21:59:12 +0000 (UTC) Received: from localhost ([::1]:58024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCTqJ-0003Ph-Id for qemu-devel@archiver.kernel.org; Tue, 25 Jan 2022 16:59:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToS-0000Lb-JD for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:17 -0500 Received: from mail-vi1eur05on2093.outbound.protection.outlook.com ([40.107.21.93]:28729 helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToQ-0002I2-H8 for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DQAF+U8ZRozDom6q9kZ7iEgrU3zoExLSOWI7SdXJ5KKh/u4JV2bO261cPBFuYKUHmQwdGjus/7LLPqeK0DqvqWeNGRwc1iLgtAlZlWu0DyNsoB+nxDPIXcoLlPa4foYeK7PEV+wBjYuT3uHPDUxnx2MMrTGOXIzNKjoAPPnmjsbyDQwU3wSqaGIC4yalJAuDvxxPIFiqs3I8gd6tdR+4A/wkpMIYdC+Sa6COFxnoFg68t5+vbPZGPHigkrjDlcF8cl1XcRy2xYkJec320pNbK/dQ171rMuSDs+KXD1Km8sWXdjJiarFlV+eyLb+Kn4uVRG6oOU+BdeZH115n4okQyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BG1EuzgNQGqMZ7TQb2cw5tZE13GEhErF95XCAykA+0Y=; b=JDa0mR4L9Gv7pnOr2hhR8/x3AmqQuoorXNTqJO2hNYMRHBwg0aoOIW2cdF7kz/+sv6Cy0D6CGSAtfyXDaKmKG3L1esYKbCtgfY0hv5HNHSZQUmImkzsK8FWISfB47C4ogVs1bHfaA+Vu4U0nVFv8yR1jEsmtms8+W0mo0lMneQbitOfPYGaRzzsCt0Wx/GL+Hp+dgQLNMpDp9zGvT2jAFUdks2P4nt2++ZWdz2Klx9K8FblAUVUv7wmLBmS4my6LvshY5b6lXrIlDQpm7QUS7Tj5vovdT5WmSLlPJtVO2Q03Hd0CovpcOeKw7jwMy/eiKAEzJRgoFO/X5UQPUjDLog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BG1EuzgNQGqMZ7TQb2cw5tZE13GEhErF95XCAykA+0Y=; b=FG41PX3P/cKvR6fQxJumo6EkKX78P+0L48PtqC92yoRGlZIXgHd5kOzLPeEhjryd3DOGyw2Oqr5n0K1o4T7Klv67r4sOtyDvyQepLyTKQF0QXjyTdu/5+ot+1AANp2Qx2Dc8jn2LhgpgjbjUk8JgDjXuQwShCdFJPkLbLh3fkFE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by AM0PR08MB2946.eurprd08.prod.outlook.com (2603:10a6:208:56::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Tue, 25 Jan 2022 21:57:11 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd%3]) with mapi id 15.20.4909.017; Tue, 25 Jan 2022 21:57:11 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, michael.roth@amd.com, armbru@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com Subject: [PATCH v5 6/7] meson: document, why we don't generate trace events for tests/ and qga/ Date: Tue, 25 Jan 2022 22:56:54 +0100 Message-Id: <20220125215655.3111881-7-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220125215655.3111881-1-vsementsov@virtuozzo.com> References: <20220125215655.3111881-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FR3P281CA0075.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::23) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9831dd2a-50da-433b-2b08-08d9e04da3ca X-MS-TrafficTypeDiagnostic: AM0PR08MB2946:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vJpboHkZxMl0eJGAEeDyY8L4c8SjgmkTEi7mCqR6GuAiq7FhiRN+9fD8lUHebuFTEE+ZRXDFZN0FNnD0GvIy8I7iV32YZ7rs9qboB5J9Yymz3bhoNj98sWO+6vDWDWdjdboSyUJk4fhhytjeT7mjF/ka4a2SSw/+uWzwJlnZBbviQwNF0tJ19L9UgwOQZOfBrbKt1YB2kHergy26q8K2ob+7VT3UJZiKf5M/cBR5AdxE+mku2WwhVAW32+w2YJT8A65GyjtRFSl8ilOT9t0GLQt+Jk3wp+Ill2aKlZhfKmb4DfvY9k3U+cZlZakFpzdPk0jLKjlBKDKZl0rRD63QnfL1LM88irh7EuqI9tANVswsv9OALiVugQEb59mQy25WeYbCcCk1lmzhLE3XmbsomHqS4RFg6LONn7I/AG8b1UwSPpjhjLn1K+JGGtfhZqty2pVyokGDPHH7hqWAhLObL+h2ctFB/9JnM7pbtLvoDpv5neJq9OOgovBNN2WzQZzMEc+g7m9mPgrLmnfOg0Qty7Vdqpd5u9TN28JT5dLNkUnmbhAO99zm0Xt2P0wV5ZYlYF4ZsrkVhJCQPqnpm5BVtzSYbFLVQPHoaFq9YfB3aORBOjV+nEawF+mhN4nxDdMTnkjLH2pBQ8qWDaUtGvhwJ65SMASAqID9VubXF3xRLLNZD8VAjhFKo8dSHYtEzWovXv3ljvGHPv/q4tNNVbgI5A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(508600001)(6916009)(66556008)(6506007)(66476007)(8936002)(186003)(36756003)(2616005)(52116002)(4326008)(6512007)(1076003)(38350700002)(5660300002)(6486002)(8676002)(38100700002)(316002)(86362001)(6666004)(2906002)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QZyPh8PUgxwnLZLalh4TTLMaC993erLRCbDuiDZV2aWg1+d43fGpoeDPu+/P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dkaaV7KKBfSsKmB16lV7ncPgF9W2d2B6SEAs4RCaiDDyA77JCzVi3LlqEa8ckslQv5q06tk8fRKX0mbD5Ne9rPgtWyAFDNTw1hHBZCx7wTypnX48BIB8o0lwrS5V3o643vcP2hKWj/LctibnY756tFSemBZKtvArY/D7JnWybwM5GknrT4SeKN0SV7kDqP7B0WdN3CmYFhaI7lrIVE+0oyZee6gkWBELA89tmqCiisazz6h6HREgM9ssHohQp/XiSTVnLvFEjtuIOno39+myLE7RzBvnQJCudx2vKFmvCkvqwcfff6vWP6WPe0ev15iaVooL8l8zxK30PmOC57bw3ub4sZ0e/KZ2N/76CHziON1u2XWDCL1Pu4e0D0cD2fDmZW7hS6pHK7tQBU+yN79K+4JA49yEviqNBWAoimi/inHitTgraKfsfQ+kTfjdeZYtZz6dupcVUqZp/M8YznVTttCuSR+dcNrD3ROA/VqXmSbeTnZKR673F31K8MR94gsDu4wNXQdB4/S858CTyyzsqoTCrS2HBiGCZHv8w== X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9831dd2a-50da-433b-2b08-08d9e04da3ca X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 21:57:11.5611 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tb/G0gHSY3lmRwxWhLfLCP2gmmqmuWicVsgEt8MrAdacU9mAnOskN6UqSMlDS4FVCfWSqbWp1Thz+ZpT/d5LTP3exg02QYEydhDs8cVpta4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB2946 Received-SPF: pass client-ip=40.107.21.93; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_H2=-0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Making trace generation work for tests/ and qga/ would involve some Meson hackery to ensure we generate the trace-events files before trace-tool uses them. Since we don't actually support tracing there anyway, we bypass that problem. Let's add corresponding comments. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qga/meson.build | 8 ++++++++ tests/meson.build | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/qga/meson.build b/qga/meson.build index cfb1fbc085..79fcf91751 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -15,6 +15,14 @@ qga_qapi_outputs = [ 'qga-qapi-visit.h', ] +# We don't generate trace-events, just because it's not simple. For do it, +# we also should add .trace-events file into qga_qapi_outputs, and than +# add corresponding element of qga_qapi_files into qapi_trace_events +# global list, which is processed than in trace/meson.build. +# This means, that we'll have to move subdir('qga') above subdir('trace') +# in root meson.build. But that in turn will break the dependency of +# qga on qemuutil (which depends on trace_ss). +# So, resolving these dependencies and drop --no-trace-events is a TODO. qga_qapi_files = custom_target('QGA QAPI files', output: qga_qapi_outputs, input: 'qapi-schema.json', diff --git a/tests/meson.build b/tests/meson.build index 3f3882748a..21857d8b01 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -31,6 +31,14 @@ test_qapi_outputs = [ 'test-qapi-visit.h', ] +# We don't generate trace-events, just because it's not simple. For do it, +# we also should add .trace-events file into test_qapi_outputs, and than +# add corresponding element of test_qapi_files into qapi_trace_events +# global list, which is processed than in trace/meson.build. +# This means, that we'll have to move subdir('tests') above subdir('trace') +# in root meson.build. But that in turn will break the dependency of +# tests on qemuutil (which depends on trace_ss). +# So, resolving these dependencies and drop --no-trace-events is a TODO. test_qapi_files = custom_target('Test QAPI files', output: test_qapi_outputs, input: files('qapi-schema/qapi-schema-test.json', From patchwork Tue Jan 25 21:56:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12724254 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E3B7C433F5 for ; Tue, 25 Jan 2022 22:08:46 +0000 (UTC) Received: from localhost ([::1]:43758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCTzZ-0004hc-Em for qemu-devel@archiver.kernel.org; Tue, 25 Jan 2022 17:08:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToW-0000R7-O5 for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:20 -0500 Received: from mail-vi1eur05on2093.outbound.protection.outlook.com ([40.107.21.93]:28729 helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCToU-0002I2-PB for qemu-devel@nongnu.org; Tue, 25 Jan 2022 16:57:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VLYD/D5pE8TcUAhw4HQuhqe6Xqrir9iayS0FQmI170Oc9c3P7PeX5Qf9G2cnaaYmksdv5rzRU1a/jKrVXmYNkDu+wtLDCI8NBXqbIDmFydmdM21/hYAJJBhybTXCe/LW1iiMLBBUgZDKPAJw5sEVFUK0E56mZ817Qyzwqrkd5hMx+ACmWrGEV9QTede9PQs2A6MCoie1PlTxuqYdjz3QPeA6GJ0a0YnNwbXoo4s+3L3EDc8g/hiuYSqDFPqCahof2mBFcou6600fwHftR0qwlshVL4pMA82wF6/jn+R0xh8h74A6zCT1vRWnooKDJF1Mj/Xz8/KM1tI5HOqAqXAHIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ytXxYm9ovkhSqtigacldQNz/bonN4YOUbPxQnBeJaOg=; b=nZafROPqpo4sLzGf7fxvdq3udf/tcN8C2iGJrErsWNKZoZkCKPD773yWQ53M4bJsfR1SqqPAYWI7wTAC5JnP+X4/XAlGKsVcWqidxYdi2PBV5mTkmVJ186y943sNM/KIrjxfYAuWRBIj0pBUK3/WvfjBvlhi9TW4aX/08exxoFdlo08CaFc4frfvFjZcGMU0I0foUrKos4zhCbCATI8Du0B4yNn1jpsauQFSurbOcMJ8XmT0ag4bJ9sa307EWaIln87VqXns6PAg97yMKTHIfWvNPDn/ooxdBaacoL2SOdDZheUQlF2VYJKbGtBv0ruN8dCK2xFzvexSHQebtMmYXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ytXxYm9ovkhSqtigacldQNz/bonN4YOUbPxQnBeJaOg=; b=LW3ZVY2+j4vz6hc9IHycX1/tRBDHZVYaEibIYu+ruptdNlTjKGV2NmBvbBRJX4mrWF+iQf4twNd7f8bL8wr2+7ZlH2vrNUprIPIRmym5VohpfbTSAUnPrerSuPBwseIQ91tBkWIJKbQCvvnNUYG4VVoQ8ZMar2YMcDrxhbfARP8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by AM0PR08MB2946.eurprd08.prod.outlook.com (2603:10a6:208:56::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Tue, 25 Jan 2022 21:57:12 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::4def:4b08:dfe6:b4bd%3]) with mapi id 15.20.4909.017; Tue, 25 Jan 2022 21:57:12 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, michael.roth@amd.com, armbru@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com Subject: [PATCH v5 7/7] qapi: generate trace events by default Date: Tue, 25 Jan 2022 22:56:55 +0100 Message-Id: <20220125215655.3111881-8-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220125215655.3111881-1-vsementsov@virtuozzo.com> References: <20220125215655.3111881-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FR3P281CA0075.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::23) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 11d8f37f-00a5-4474-0ea0-08d9e04da414 X-MS-TrafficTypeDiagnostic: AM0PR08MB2946:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:785; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fJRktqpwyixVi54Jndy+c+wf9OSZpaBbEFnnbQW1c2+WaSiVAb8sSNcs3Klx8jH2FiYwwOBH8SZlNjzKgqnu02hHy2vbqM0+FYN4bYRx8MHE0vhCQcBMn9EyhctAr9WaaBCavxf28sFaLtN/oFkPvth7jjWNkxh073oCAUZ6qhoutABP1+pWutg7Xf95bUnlIkgI2apNkdcMTRHA8WpXNTR+vV5zKcKXIu+AOaI6nyJrIheERYmP2QEsC+yaDJGAP1lyJUp7e0Rj+pT/jvveLdOE/8GlBJaHIvOXt+jv82VQ1/EyQgO9i28iDqLaQCOvt5zWDWHfCCNgHJBEwxjY+Usw6fvsut/OHeYuwlz9zFfPnQdebzO77q2PylkU8lr7tnSx8+4SyEFQ2mH8VxBrOSYc0V2yuonwNEAgpbENh5VZnDmD7DqSXE/rVVZRcea4M7J3GgZ4KMTQhcsJw2/CqIPLXQglQ4n2yKQllnDT7O89OvGGKFHmoLYNhj/y7ihzpAqp8MaNUXclF2aUhsk1kKR2GZpdieGA8aNfsV87F3JQzGjBSvupbApuqYZBrwFCTtJ8V6Et2KGk77h1KKafOErnvvQkeagn0lW8CFzud1cqTCEpbea/uHiwQnR3A666GrbnohDzYDMQWvcis70wM45/i0PW2IA1aL8RpxqbMwKue+R4chnUcLQMvoK7aixxsQ1+kEie3z2hdocKLHCf+Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(508600001)(6916009)(66556008)(6506007)(66476007)(8936002)(186003)(36756003)(2616005)(52116002)(4326008)(83380400001)(6512007)(1076003)(38350700002)(5660300002)(6486002)(8676002)(38100700002)(316002)(86362001)(6666004)(2906002)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DPSqspuXMOo2IAMZjfjErG1k1UwoP1C2Jl+SBVQQoqWUq5nGIPu4HS4abZ+LL427G/YdJlS2KabftTXWdqX4qwEVUoCYJP1VZh4mC+Kj6xT6aqNwRJ7k3E+IGRGz+mfV8gSTydN0ELQiAHjmGb7Vl674kHCcR8N1kKfUINTEJk+m9HomQVYu1qkKq+sQwPk0dU2mfTa0PW2m6nkN9RA/Ckk4veXI97KG92uAfVRAUexSMpGQ49C13NcNx6EnsCneDvopZej+f0hGKxKS0Fq+lTj3MttXLslvGKs1yNJ49r6MBB9Q2X4sPXWDqtGh1V69T2ej1f+UYvZvmHAr3Uwo1RrgJzW9SZzyrj0BI7m+otfC8uZmh4nlYuZQjrCl4PhThBs2wMEY6Av/0TSS9qntkArHa/nEHmSNtNelCIyC7VyVfFUaYmAuy33M1DPSWB1AaZoPdRJNv/RNRTLwrWBRPP6BSHLagT/FMWuHO5OC0ydUZVOsOB83LxaZYNVQbcOvwV8oeHtC3T5LDIKeqx1WEhY/9wMjq3x9NAJnabc74XSkJJcI6N5l5JDK+oQN3rnQgtYh1Vrdr4MRitJc8WD9SQ0QjYUcTcQNtb3f3wlBF/19ohz8rMREZqRY186LJrMufioKiZgU6tuQWwq57rAKQA/ouWIFg5B18TbyDD+jcw3ohXwDhXcDskluMI8BM9k+BS5KQ5gl8Coy3aIZX6x5skVWpEIhEFnarnuwr3TwreYXYB7o6EUfVjtM6CwHhJOWUqlYW9FOj0A+zGQkLI4bKBiJOpO1qVyqTsj66fMcxMdXc5mnrfLFWXlE5Ft6qe/Vz7Z2uhV5YpKsHp14Wta0hn0OkqQp8NeqUXC/SS03JX3ryIlWlMeWjLLDzROE6rWac8c2OG3yq2Hbgmb9ZDOcrETjFcDQLAQAjnBg9Nm611seMttvha1UA6kSCbmLfNXHQaJ17mkBZR0Q6AdNv8t6YQrdugRCmalp/lqaAwZ5ZWWjvfOqVBMgYuQ+y4hyiiFV61jeC+3dsTe9Io5zb1aHtCqQ5SrwgFasuv2o5zHSU+OSqKdOH/kOBlEJ5sh3fnDNeFyE/Kz6CnhjAPdjTT71P8sd3fkcPglhLTT5WCOFpu6kA7YYCz54q3TKSN+sb30Yh+Y3O58UXTvIM5nj9nYsvqFihr/+yspvAzcdOq3F6cmhgL/yM9p6/coKuC2eniSqKm7bElMxVc0e9Sq+HEdzgzRJPJ2/+2qUGQsTqtjmxIp07h7H2R3/um+PUUyH5PY4v1//oNXa9BX9911VH2rawL3ZHAmOLwPR4ClARJjsccWfxnkut1LKLb3lXIoLucP5Lks5t2QoRLTVy1h7HiIVLfyNIoWZvKINbMXTFQ5WcZ6IUIXnzvi5A4EnFIftN5OSkOfqvvAXIRqcWr12wGlSCIYMvqaXNyA+MQeN3azAhuBO/LUxYr84sxlt6JRLUDZBXoYXYr9XxguImLpL1smdmwlhh3OQv+KnUTU7pRQymnwX1Th9bpd4OMn1qBJ3WHZfEzNWEzd5nXCH5+q6Qc2Vkg3byJQ3pYhdUve6+zTV3Zn3AZNv5GnNWp/l5PtBQ5tWlu7NxPkgMlCHqAexxi/I71+HwouQqRqgqXAEjbjy96IGZXeq+ygQv6Ndv+AXSH6tiRSiUaa+G4VhPxOweHfWiQ== X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11d8f37f-00a5-4474-0ea0-08d9e04da414 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 21:57:12.0610 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0yQ7BcYlGJqiXR0ydfV2QROKKvMPmnQiFUNhYmvhQjvxvQdNlvTSufemThcCE+m8VnNRngbcfJMgeO8p+rx7ZA4nMvx77wAXfMWUBJzAjlw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB2946 Received-SPF: pass client-ip=40.107.21.93; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_H2=-0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We don't generate trace events for tests/ and qga/ because that it is not simple and not necessary. We have corresponding comments in both tests/meson.build and qga/meson.build. Still to not miss possible future qapi code generation call, and not to forget to enable trace events generation, let's enable it by default. So, turn option --gen-trace into opposite --no-trace-events and use new option only in tests/ and qga/ where we already have good comments why we don't generate trace events code. Note that this commit enables trace-events generation for qapi-gen.py call from tests/qapi-schema/meson.build and storage-daemon/meson.build. Still, both are kind of noop: tests/qapi-schema/ doesn't seem to generate any QMP command code and no .trace-events files anyway, storage-daemon/ uses common QMP command implementations and just generate empty .trace-events Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/meson.build | 2 +- qga/meson.build | 3 ++- scripts/qapi/main.py | 6 +++--- tests/meson.build | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/qapi/meson.build b/qapi/meson.build index b22558ca73..656ef0e039 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -127,7 +127,7 @@ endforeach qapi_files = custom_target('shared QAPI source files', output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs, input: [ files('qapi-schema.json') ], - command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@', '--gen-trace' ], + command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ], depend_files: [ qapi_inputs, qapi_gen_depends ]) # Now go through all the outputs and add them to the right sourceset. diff --git a/qga/meson.build b/qga/meson.build index 79fcf91751..1f2818a1b9 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -26,7 +26,8 @@ qga_qapi_outputs = [ qga_qapi_files = custom_target('QGA QAPI files', output: qga_qapi_outputs, input: 'qapi-schema.json', - command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@' ], + command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@', + '--no-trace-events' ], depend_files: qapi_gen_depends) qga_ss = ss.source_set() diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py index ecff41910c..ca1737aa2b 100644 --- a/scripts/qapi/main.py +++ b/scripts/qapi/main.py @@ -75,8 +75,8 @@ def main() -> int: parser.add_argument('-u', '--unmask-non-abi-names', action='store_true', dest='unmask', help="expose non-ABI names in introspection") - parser.add_argument('--gen-trace', action='store_true', - help="add trace events to qmp marshals") + parser.add_argument('--no-trace-events', action='store_true', + help="suppress adding trace events to qmp marshals") parser.add_argument('schema', action='store') args = parser.parse_args() @@ -92,7 +92,7 @@ def main() -> int: prefix=args.prefix, unmask=args.unmask, builtins=args.builtins, - gen_trace_events=args.gen_trace) + gen_trace_events=not args.no_trace_events) except QAPIError as err: print(f"{sys.argv[0]}: {str(err)}", file=sys.stderr) return 1 diff --git a/tests/meson.build b/tests/meson.build index 21857d8b01..b4b95cc198 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -45,7 +45,8 @@ test_qapi_files = custom_target('Test QAPI files', 'qapi-schema/include/sub-module.json', 'qapi-schema/sub-sub-module.json'), command: [ qapi_gen, '-o', meson.current_build_dir(), - '-b', '-p', 'test-', '@INPUT0@' ], + '-b', '-p', 'test-', '@INPUT0@', + '--no-trace-events' ], depend_files: qapi_gen_depends) # meson doesn't like generated output in other directories