From patchwork Thu Dec 23 11:07:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12698103 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 37987C433EF for ; Thu, 23 Dec 2021 11:10:13 +0000 (UTC) Received: from localhost ([::1]:44078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0Lz8-0002sb-B3 for qemu-devel@archiver.kernel.org; Thu, 23 Dec 2021 06:10:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0LxF-0000TT-PJ; Thu, 23 Dec 2021 06:08:13 -0500 Received: from mail-eopbgr50093.outbound.protection.outlook.com ([40.107.5.93]:38670 helo=EUR03-VE1-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 1n0LxB-0003iq-OA; Thu, 23 Dec 2021 06:08:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TDbAz6Mv2Caw21tUSE6wLa1rvRXmfMB5kmbtXpo0Xx7xz5wvjxuLUgIxU7KCyd/dJscO/A5FKGsLZjcAYXw80ESeSNIeJ2/8+jC/Gg3FxjXtx1KqYnnXPUbSiZpjvh2H4nm/hhPkAghhqejNy6MoD8RVP5vINgGdVy9ahTZSg7bmybONwcKoSDjdKOFVHKjHt95nGB4z0P68f7KqQLdy0I/IkQgAsCwWTZSl0MfIyr7oKtObG8wiDRrDSKt9vmfEco8qJCASzXNU4XEuPXPc6iaC5R1XKci9ZmtHjqIQr5mmCZ1i76Uo2MM9geyf+LdWGQd987+gJO4AaXOpwr18tg== 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=6iYRp1+YTZ7m/tutquYd2BA7bMAdLeLwMAkWwd3hFG8=; b=dCA21CMtXGyu8TZE9rqsVrYXo2j6G+VFQTRT78lsHJvgQJdxqoDQkHuoXqmI6X+Iu3a3cdW+K2/YhCtgPi8zlYmJ83fFzW/lUlKAqFWEC77FP8a4FdYgQRgJN31EA/9kx+/WF5OyJEmVQdGB8xnveiYqqAn7ox6K5b5Y2sKGfqAu47FCjSqT7d8rUo5m59n+qZDL1T/1qra11rXDS5qscI22U7AXxaz5wdUl2yfpubf+EQ08080wk5znMlRTB2kI7GsT4tmgJ4W+2h1R0XqXZ5yqYBYKufxl+DhspExigiM9oKdGvJIbcdPdTK1qAca5wGMHCUE8nmjYT9/YNONrZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; 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=6iYRp1+YTZ7m/tutquYd2BA7bMAdLeLwMAkWwd3hFG8=; b=KF1JRKBgIbchkHtUKDPdwW4bI1ml0l0RuXE+lRGJ4O3RLWE+JrJLbskQz9+7p7kQrBz1WdyhAtstXEHHBYaoLac9hQf46aIMaw1e7ipEma+ipOy9wbeoWAW2jyWyDcQqi4Ui/K8yf802CR+HCN20xOamcBl4qlrvXVInU55Rafw= 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 AM0PR08MB5393.eurprd08.prod.outlook.com (2603:10a6:208:18c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.18; Thu, 23 Dec 2021 11:08:06 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::b118:483a:d003:3112]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::b118:483a:d003:3112%5]) with mapi id 15.20.4823.019; Thu, 23 Dec 2021 11:08:05 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, stefanha@redhat.com, michael.roth@amd.com, vsementsov@virtuozzo.com, jsnow@redhat.com, armbru@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, philmd@redhat.com Subject: [PATCH v2 1/4] jobs: drop qmp_ trace points Date: Thu, 23 Dec 2021 12:07:53 +0100 Message-Id: <20211223110756.699148-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211223110756.699148-1-vsementsov@virtuozzo.com> References: <20211223110756.699148-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: AS9PR06CA0094.eurprd06.prod.outlook.com (2603:10a6:20b:465::7) 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: bd1b605f-adda-4fb4-4ab9-08d9c6047eac X-MS-TrafficTypeDiagnostic: AM0PR08MB5393:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:194; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IFMBkqiQQyS/KcSzLc0ZvquX+r7ahhJ7jXslr/SHVtZOaIoN5eXlWPR52GrfAPCpuJNVucOUqFsOFnr2HbWCM9Y1yiFJopaDtDKuiyhyJrRUeYcb+rwmMDWBbcJEB3OIDHNJGhH0BDOXgwS/Y6Gxz/psucLED07iO+bK40pA0RBrIYZ6gMTdOSYMIKW/2SxMPssFRF8hQz3X07nsocMDPV4Ipo9yXi4P3wIMuB1fr6yY7Df6bdqIx4SKSY4jk9ae6bPjNBpjLLVsZr2RjaHAOfXlc8XeufkWtDbwg2YOJJtcPYRS0+4KHMqFdMxIPLMd3pdZNxmJ1ARw3gd/9yhX8jZjvhPS3UB1cM8jG8dDeMOqgEjkqMlmCny/TgCxIVEJJK5uOnhCT2Gy/uexxhJYigCAH9ncIzThuMy22sVTYPRougIdQxTwyqj2TPBh7uE1DS+iLGinAPmRP82F25E0MmnwekVmnkwPq78bu4kduUgP5NXmvNW3Jz/Ys61ZYmRSBpnBmkQGg1yhCjHn1FHBhzHGbNF9tIDe/x3PLuqVL6ie8hYBmgXiXegxwdlGAxv8dwDNLERpHgUPPT9Z3a43bd+VyFRNQLBn/POTwJ07zG7GlnBRrzHXUDogOeGYKpoSPmkMMcWhmgk8qX8t+Dt1Qx6XP0H9BXsV+CY2hZ/+1NwX7scFXp4xXaP0igAQqNI7lspJN76lK7FWic0tzPrKs6fSG8NCb/LRualKaFnaKnFF3Nw7HHnBJWR79Bpfg0t5 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)(186003)(8936002)(26005)(6506007)(52116002)(6916009)(36756003)(8676002)(316002)(508600001)(6512007)(38350700002)(5660300002)(4326008)(38100700002)(7416002)(2616005)(1076003)(6666004)(6486002)(83380400001)(86362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aY0ffR4xenaLbOJERbJZSGM0t7YfB3uByk6dtQmd8XnJuH3mqUmeJZjjzgXyehAWlaXslKgvhXJ16/nTLNwWoNd+qQinqRRLj5tBT2Eo/N+4TVWw/Ma82GZSXW/uYiu1buzSLnNT0tO6g8boLD9GrB152Q+Rp2WjHGwzTw6DNmNpv44nhGOryX7xTwKzT69A0zQAFWYoefjenoQHwMfFGjCL18CLLIS7Fd23jZAiEcgWFDgm1UhI3q+sAkr9s03sW82fsb142EB73M9yqmY09i11gdLhehJ+1ZlGMjhSzROn+/Zs5b+1AV9NMkbNbTUjccbbGDPoSZ17aC7in0ynTQlLjx5DE4DGQl1YH+KmFsWIev/3NFApSAUKip8caqN+i53/Ihk/A56P7/xvh1lejN/dGrvvHR9btCJmD3UFt27RvpaWS2ft9TWApNSI6hrs108ygkhVrbqTq3KbLfq9PvDIhyf0ZEflmFvv2iKLkAqaKncSuQpK36WI1I7AsWzkpq2keQwfugBkNcBnroMbsEY1x9SB5cN8XnAFSQ3hk2XljuEvOCdP3dVuJCdu+oKYzPNkzwCpQk6KB7+mrmcx//ARcGlKYg350dkXLa9seF/y2k5KkYTf2RugEB22uxy5wNah33aLCiWd7ZWSmihesna+t4/wbCA1JCf/PA8efUyKpH1aq6C0rP0RtgLILk5sn0auH8v/6tnkekABM3UyDn9Y3e29q43wy5c= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd1b605f-adda-4fb4-4ab9-08d9c6047eac X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 11:08:05.8587 (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: UpxElNTsf7Ojs9UPILUDGo5lrJRUdLwl0dm83Ao7NSmzCMXkXxRq0Sq9DXby3caVkztrgFJKD3I0v+2iCMo0zffsKnikDrTxWjYNjTLxMFM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5393 Received-SPF: pass client-ip=40.107.5.93; envelope-from=vsementsov@virtuozzo.com; helo=EUR03-VE1-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 are going to implement automatic trace points for qmp commands. These several trace points are in conflict with upcoming ones. So, drop them now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- blockdev.c | 8 -------- job-qmp.c | 6 ------ block/trace-events | 9 --------- trace-events | 8 -------- 4 files changed, 31 deletions(-) diff --git a/blockdev.c b/blockdev.c index 0eb2823b1b..10961d81a4 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2586,8 +2586,6 @@ void qmp_block_stream(bool has_job_id, const char *job_id, const char *device, goto out; } - trace_qmp_block_stream(bs); - out: aio_context_release(aio_context); } @@ -3354,7 +3352,6 @@ void qmp_block_job_cancel(const char *device, goto out; } - trace_qmp_block_job_cancel(job); job_user_cancel(&job->job, force, errp); out: aio_context_release(aio_context); @@ -3369,7 +3366,6 @@ void qmp_block_job_pause(const char *device, Error **errp) return; } - trace_qmp_block_job_pause(job); job_user_pause(&job->job, errp); aio_context_release(aio_context); } @@ -3383,7 +3379,6 @@ void qmp_block_job_resume(const char *device, Error **errp) return; } - trace_qmp_block_job_resume(job); job_user_resume(&job->job, errp); aio_context_release(aio_context); } @@ -3397,7 +3392,6 @@ void qmp_block_job_complete(const char *device, Error **errp) return; } - trace_qmp_block_job_complete(job); job_complete(&job->job, errp); aio_context_release(aio_context); } @@ -3411,7 +3405,6 @@ void qmp_block_job_finalize(const char *id, Error **errp) return; } - trace_qmp_block_job_finalize(job); job_ref(&job->job); job_finalize(&job->job, errp); @@ -3435,7 +3428,6 @@ void qmp_block_job_dismiss(const char *id, Error **errp) return; } - trace_qmp_block_job_dismiss(bjob); job = &bjob->job; job_dismiss(&job, errp); aio_context_release(aio_context); diff --git a/job-qmp.c b/job-qmp.c index 829a28aa70..cf0cb9d717 100644 --- a/job-qmp.c +++ b/job-qmp.c @@ -57,7 +57,6 @@ void qmp_job_cancel(const char *id, Error **errp) return; } - trace_qmp_job_cancel(job); job_user_cancel(job, true, errp); aio_context_release(aio_context); } @@ -71,7 +70,6 @@ void qmp_job_pause(const char *id, Error **errp) return; } - trace_qmp_job_pause(job); job_user_pause(job, errp); aio_context_release(aio_context); } @@ -85,7 +83,6 @@ void qmp_job_resume(const char *id, Error **errp) return; } - trace_qmp_job_resume(job); job_user_resume(job, errp); aio_context_release(aio_context); } @@ -99,7 +96,6 @@ void qmp_job_complete(const char *id, Error **errp) return; } - trace_qmp_job_complete(job); job_complete(job, errp); aio_context_release(aio_context); } @@ -113,7 +109,6 @@ void qmp_job_finalize(const char *id, Error **errp) return; } - trace_qmp_job_finalize(job); job_ref(job); job_finalize(job, errp); @@ -136,7 +131,6 @@ void qmp_job_dismiss(const char *id, Error **errp) return; } - trace_qmp_job_dismiss(job); job_dismiss(&job, errp); aio_context_release(aio_context); } diff --git a/block/trace-events b/block/trace-events index 549090d453..5be3e3913b 100644 --- a/block/trace-events +++ b/block/trace-events @@ -49,15 +49,6 @@ block_copy_read_fail(void *bcs, int64_t start, int ret) "bcs %p start %"PRId64" block_copy_write_fail(void *bcs, int64_t start, int ret) "bcs %p start %"PRId64" ret %d" block_copy_write_zeroes_fail(void *bcs, int64_t start, int ret) "bcs %p start %"PRId64" ret %d" -# ../blockdev.c -qmp_block_job_cancel(void *job) "job %p" -qmp_block_job_pause(void *job) "job %p" -qmp_block_job_resume(void *job) "job %p" -qmp_block_job_complete(void *job) "job %p" -qmp_block_job_finalize(void *job) "job %p" -qmp_block_job_dismiss(void *job) "job %p" -qmp_block_stream(void *bs) "bs %p" - # file-win32.c file_paio_submit(void *acb, void *opaque, int64_t offset, int count, int type) "acb %p opaque %p offset %"PRId64" count %d type %d" diff --git a/trace-events b/trace-events index a637a61eba..1265f1e0cc 100644 --- a/trace-events +++ b/trace-events @@ -79,14 +79,6 @@ job_state_transition(void *job, int ret, const char *legal, const char *s0, con job_apply_verb(void *job, const char *state, const char *verb, const char *legal) "job %p in state %s; applying verb %s (%s)" job_completed(void *job, int ret) "job %p ret %d" -# job-qmp.c -qmp_job_cancel(void *job) "job %p" -qmp_job_pause(void *job) "job %p" -qmp_job_resume(void *job) "job %p" -qmp_job_complete(void *job) "job %p" -qmp_job_finalize(void *job) "job %p" -qmp_job_dismiss(void *job) "job %p" - ### Guest events, keep at bottom From patchwork Thu Dec 23 11:07:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12698104 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 087D7C433EF for ; Thu, 23 Dec 2021 11:12:43 +0000 (UTC) Received: from localhost ([::1]:50676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0M1a-0007P0-RP for qemu-devel@archiver.kernel.org; Thu, 23 Dec 2021 06:12:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0LxI-0000Xk-Fb; Thu, 23 Dec 2021 06:08:17 -0500 Received: from mail-eopbgr50093.outbound.protection.outlook.com ([40.107.5.93]:38670 helo=EUR03-VE1-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 1n0LxF-0003iq-MI; Thu, 23 Dec 2021 06:08:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RroFN2eoUAPVQZw7+6P/mjbVWbEPOU66UWaHe+4fLCGcocj8ogrVqi3TbVKJGlwco8YJnVW+XExHl6XaWHhSX1ctLHakoWj7HFO+lMrv2j6ejJduaBo5Yv6Rzt3RdC6CvEk+gSj+/OG6enSsaQOVbjPFPxzU7zymVW2xeUtsksHkmIHuQ/ObTAN1jcYg+gBF/bkHgLbJTuu+136+sDn0EDQPGRNxchNG/EpVt3sdu54B+nis5jl8FoxHKgwNtWi6tw/xAM4a9q+SUzIgoUiO43p9HU/zBv4DIPOuXwjLa8kpMZOaEuupCGfdBSuNVkDzc/9ZbodY6kMTf9vZFYZguQ== 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=RJaGIh/3xopj49PzeEdLsu8Tx6bAR649CU351bHiaaQ=; b=ZVQzPAPbX04RFP51BqlIngThsrJ1TeeVIsfYXj58Pit0R67flim9ksg86NkjIfXqtSox06f9RLVejgL29lckS4Mrp43iBFoGhUnOGCyHccau66UxyN1esnRrhOyggOK6PERsGv1PXhGpvw4N+tY9I0ORqOey4GWdFBL1oZ6syGZnToeAlRWH4thLcD62ldewE8AN/SyIdKQyhGS4s892QYlaqfG/vATX5fk4wT5mrSMFOW2xDC5n1UVi2sKzD23A91oULkkmVvkHV89uapJWgXtfGktNaVu6GGJGGhURglJapHiU8+EUjIspbD4riJnD4bKpyWLmxIPHln2c1Lu0lg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; 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=RJaGIh/3xopj49PzeEdLsu8Tx6bAR649CU351bHiaaQ=; b=WHggWozujgVahvwjDFZDPeNWix5QLvw5fIcB6ISy1A2/lt0Wg2fjPz+DeAzXJoCQcHGHdmN8vtctQ3j20M5lFrehJOixRWLgR5RRalc9rrDh0F2n8b1w9MZoKY9Iu8MEUdsGs5D8llGqshH74rHdd14kd6dQskVenEccBeXtobM= 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 AM0PR08MB5393.eurprd08.prod.outlook.com (2603:10a6:208:18c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.18; Thu, 23 Dec 2021 11:08:06 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::b118:483a:d003:3112]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::b118:483a:d003:3112%5]) with mapi id 15.20.4823.019; Thu, 23 Dec 2021 11:08:06 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, stefanha@redhat.com, michael.roth@amd.com, vsementsov@virtuozzo.com, jsnow@redhat.com, armbru@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, philmd@redhat.com Subject: [PATCH v2 2/4] scripts/qapi/commands: gen_commands(): add add_trace_points argument Date: Thu, 23 Dec 2021 12:07:54 +0100 Message-Id: <20211223110756.699148-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211223110756.699148-1-vsementsov@virtuozzo.com> References: <20211223110756.699148-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: AS9PR06CA0094.eurprd06.prod.outlook.com (2603:10a6:20b:465::7) 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: ae8dd8a2-d52b-48a7-1b48-08d9c6047f02 X-MS-TrafficTypeDiagnostic: AM0PR08MB5393:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:298; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: srf1f0N91xMpaLl1QHJJWh44xOyozWPh04zg+zdrCW8umjKnZC73f7DEptcEfDMtZJFwAmUQStNWgEPE41KLfd/WbV9+ZNVuT0k3iywqzryUcSogQm38WCcmILVRLlty2Va1Jkg/a7NCaN34KtukuRLJaCrkSACNLZfP07OteUyxprdLF4//TBn2zhuhPIwhcU+oS82/1lt1AvtUl8GvR4ezJrGnPmQHnJbe7Lb7fKRu4nhCbjF6grNGv8ZuqrhhtjUUXlCvizCo9h7CVtcLg97EiUsQpOLORSVgxsc3+cCeDNfjjOjBTNjvPdnvkaC6JLouvySbIGalOUVo0jtNyy3DQ7k8C4KtEyd7IyfQn93l60hL5cxSVPNYqo4sO31LZZCCTPS3TvmZilyonbvbJnaosVRRVgw+vL2y8d0qq1qkjlX+OSH+3g0N17QRZhT/MJIBONuyA8iqXFDnSici+2vTqGMLkIZP7fRGP4ytFJhQBUn3KIEN9fKPfTCJgaqm3L3xPff92hz97DVyVHN+JcujgQWvQGcjS0rXSD9tYZsO7Yr7+NlVuGGg1os5FdO6+3zZWprMHrb1w9rPN0ReD2b2rPPxAdImXp6xjitIgvourRadHaAHnW1fIK39l732zUdD3Ia0pSugWA6ylMt/GbgCSdu+dDpluirk2OQ4WiSijildOVtVZonqQ18MMc3Mkgqp1wdKsZjBIvOz+Qi6JXWcBKxbTAYrLLJ8eqG8INkhChRBLQxNPyGcn52Sprm1 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)(186003)(8936002)(26005)(6506007)(52116002)(6916009)(36756003)(8676002)(316002)(508600001)(6512007)(38350700002)(5660300002)(4326008)(38100700002)(7416002)(2616005)(1076003)(6666004)(6486002)(83380400001)(86362001)(66556008)(66476007)(2906002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: urnhwqb+pTFheB9suuFrQ4zOJYogUuM+mqVJUGwwTBktL9PbIgGlcT4yOLFviFmMBxb8vBBXApVrgXB6C/gPD0ArzB5eh68RBajZ8+tl5C/tMFtcnm2i4eiDu+CL7hf9/EJJCkxMRRv7iqfXUBSsDO8KapYiK6QvBQ7D3MyBOlkONdKPPOugW9KoQeEU0E4LWFtCSXPH1BwubAlJ8D14M3Ma7yy6Dkb+hy9V142EgxLuWEgM0pnv1GBkjlggrbZKufKY4+eDzxBXUJIM+WYJyvsztUqKcGnZwoLKnwrADi9E1J5gwe4y1JAcfpdESuVINByAHJOKV79da+s4S8JH9Rd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RPgcW16WKa1oTyNEPI/CFnvtYelF9CAT7Y+0fR0weuw1O7U9+iNv4ZWAZ6JeH+DB4Dpk0RpxzOq6ZddH1qoLAs81pWkFYmij793SUoMxflcaT/hmbW5AbeqVtN0Xau4A1CfsbPcPfgcp/hPvUp/dBX2BndpYpad8j5LYSjtoYjRGsE+bMsh5zFCaOKM2o1oCZwFT/Pjr7Hn0nkMCEf4wBMWcRfrcw1kHrExzo+znVRQvsDF6F0bskBPel7TJIAE9IH3Zm4or/xz/6cwwXVu/w= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae8dd8a2-d52b-48a7-1b48-08d9c6047f02 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 11:08:06.4536 (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: cHLdroIXTAdawZ0jLQC+tUFwMkOq+XgMq5NtCBNmKGFpisl10pIVg3Q4KWkh/ih4l334hoAlyi6888M3OuiRWyTeimAWlVP1LlJ7O14sJug= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5393 Received-SPF: pass client-ip=40.107.5.93; envelope-from=vsementsov@virtuozzo.com; helo=EUR03-VE1-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" Add possibility to generate trace points for each qmp command. We should generate both trace points and trace-events file, for further trace point code generation. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/qapi/commands.py | 84 ++++++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 11 deletions(-) diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 21001bbd6b..9691c11f96 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], + add_trace_points: bool) -> str: ret = '' argstr = '' @@ -71,21 +72,65 @@ def gen_call(name: str, if ret_type: lhs = 'retval = ' - ret = mcgen(''' + qmp_name = f'qmp_{c_name(name)}' + upper = qmp_name.upper() + + if add_trace_points: + ret += mcgen(''' + + if (trace_event_get_state_backends(TRACE_%(upper)s)) { + g_autoptr(GString) req_json = qobject_to_json(QOBJECT(args)); + trace_%(qmp_name)s("", req_json->str); + } + ''', + upper=upper, qmp_name=qmp_name) + + 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) { +''') + + if add_trace_points: + ret += mcgen(''' + trace_%(qmp_name)s("FAIL: ", error_get_pretty(err)); +''', + qmp_name=qmp_name) + + ret += mcgen(''' + error_propagate(errp, err); goto out; } +''') + + if ret_type: + ret += mcgen(''' qmp_marshal_output_%(c_name)s(retval, ret, errp); ''', c_name=ret_type.c_name()) + + if add_trace_points: + if ret_type: + ret += mcgen(''' + + if (trace_event_get_state_backends(TRACE_%(upper)s)) { + g_autoptr(GString) ret_json = qobject_to_json(*ret); + trace_%(qmp_name)s("RET:", ret_json->str); + } + ''', + upper=upper, qmp_name=qmp_name) + else: + ret += mcgen(''' + + trace_%(qmp_name)s("SUCCESS", ""); + ''', + qmp_name=qmp_name) + return ret @@ -122,10 +167,14 @@ def gen_marshal_decl(name: str) -> str: proto=build_marshal_proto(name)) +def gen_trace(name: str) -> str: + return f'qmp_{c_name(name)}(const char *tag, const char *json) "%s%s"\n' + def gen_marshal(name: str, arg_type: Optional[QAPISchemaObjectType], boxed: bool, - ret_type: Optional[QAPISchemaType]) -> str: + ret_type: Optional[QAPISchemaType], + add_trace_points: bool) -> str: have_args = boxed or (arg_type and not arg_type.is_empty()) if have_args: assert arg_type is not None @@ -180,7 +229,7 @@ def gen_marshal(name: str, } ''') - ret += gen_call(name, arg_type, boxed, ret_type) + ret += gen_call(name, arg_type, boxed, ret_type, add_trace_points) ret += mcgen(''' @@ -238,11 +287,12 @@ def gen_register_command(name: str, class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor): - def __init__(self, prefix: str): + def __init__(self, prefix: str, add_trace_points: bool): super().__init__( prefix, 'qapi-commands', ' * Schema-defined QAPI/QMP commands', None, __doc__) self._visited_ret_types: Dict[QAPIGenC, Set[QAPISchemaType]] = {} + self.add_trace_points = add_trace_points def _begin_user_module(self, name: str) -> None: self._visited_ret_types[self._genc] = set() @@ -261,6 +311,15 @@ def _begin_user_module(self, name: str) -> None: ''', commands=commands, visit=visit)) + + if self.add_trace_points and c_name(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))) + self._genh.add(mcgen(''' #include "%(types)s.h" @@ -322,7 +381,9 @@ 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.add_trace_points)) + self._gent.add(gen_trace(name)) with self._temp_module('./init'): with ifcontext(ifcond, self._genh, self._genc): self._genc.add(gen_register_command( @@ -332,7 +393,8 @@ def visit_command(self, def gen_commands(schema: QAPISchema, output_dir: str, - prefix: str) -> None: - vis = QAPISchemaGenCommandVisitor(prefix) + prefix: str, + add_trace_points: bool) -> None: + vis = QAPISchemaGenCommandVisitor(prefix, add_trace_points) schema.visit(vis) vis.write(output_dir) From patchwork Thu Dec 23 11:07:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12698105 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 09492C433F5 for ; Thu, 23 Dec 2021 11:12:49 +0000 (UTC) Received: from localhost ([::1]:51200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0M1g-0007k7-7l for qemu-devel@archiver.kernel.org; Thu, 23 Dec 2021 06:12:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0LxK-0000Zs-OG; Thu, 23 Dec 2021 06:08:19 -0500 Received: from mail-eopbgr50093.outbound.protection.outlook.com ([40.107.5.93]:38670 helo=EUR03-VE1-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 1n0LxJ-0003iq-2D; Thu, 23 Dec 2021 06:08:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WiwpVJTb+AWimniOOtvQsmZNdQm2EaxNea/VVP6yvdWaUaIisnqDOKU/56nKcBQd3U8QStXmXGYQ03LOt5t8VP70PbP4bBK4djm+y4lMy38UDS10lrc+ifELVhV5T/xZSrA+981fXq9mRNiLA6Lu6cz8NGDvmiQtrBpBCn+EkcigSpO+I7S7FQ0v2P+7G9mucnw/BvczSYHVaj6ZaxoJdIBXvoBOvV0fIhhxVF6zjJAgKoZ2ISJkO19LQYBtuDakqF4yNK8TN9BhODkWhE9PT0c/i9ihsjCZ1uiD5uiEOkHsPKk6HF/GVBL7FojjFz10na7dJhskHQrNtzgnDZSu0g== 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=f4mGe/IxL/nOoPOBwTgyQ8IiyoH/TlDZ5ZwUUt2Z7k0=; b=IwOk4ksjIhWUc1Ax9qK1UVpgrm+GKpm7EcK/69K440R3DTDipV8C0IKDnr2kt4Nk4D3Kg5iYMKF3MLyitUtbETmzmwAISAGKSwQlMmTk/tZbCXbw5enllHVAQnzXJ2Kiq3OfX45B7UkhM8vDP44pR5ekNVTuADvS6shG0hw1D8YDmHLBxgva255/A0TzCv2zZ2/m+UJH7ci7c6CM45SEOH+6tPlMbCSAlMH75H2D9CSGBXU1pbnLqr/aR8F0nN30R25S2WMdxJMFABUNeKMyyYe68HCsuULHM0xO/PAmau+6DmBC87d++u8SFtRvmSqjxq86IBSbHTGdw/VuU8y1wQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; 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=f4mGe/IxL/nOoPOBwTgyQ8IiyoH/TlDZ5ZwUUt2Z7k0=; b=wKVZ9tgwuBnIftsQrgVYzR8RTmOc/oYYHVDjJSgyLgaIz8cNbPXdcbLV361YldooTOK2do3+Egf0OyzQcgGkvpUhdy26zj0t+XWzuMjMJb5W5D2UnUjNWzwGmXaNp+JPYY5Wiil0ivshL/b5tslBGum0p3HEpkToyn+fRt6H2AU= 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 AM0PR08MB5393.eurprd08.prod.outlook.com (2603:10a6:208:18c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.18; Thu, 23 Dec 2021 11:08:07 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::b118:483a:d003:3112]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::b118:483a:d003:3112%5]) with mapi id 15.20.4823.019; Thu, 23 Dec 2021 11:08:07 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, stefanha@redhat.com, michael.roth@amd.com, vsementsov@virtuozzo.com, jsnow@redhat.com, armbru@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, philmd@redhat.com Subject: [PATCH v2 3/4] scripts/qapi-gen.py: add --add-trace-points option Date: Thu, 23 Dec 2021 12:07:55 +0100 Message-Id: <20211223110756.699148-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211223110756.699148-1-vsementsov@virtuozzo.com> References: <20211223110756.699148-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: AS9PR06CA0094.eurprd06.prod.outlook.com (2603:10a6:20b:465::7) 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: 3ff37a66-1942-4b91-1c91-08d9c6047f58 X-MS-TrafficTypeDiagnostic: AM0PR08MB5393:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kZz8VOBQPHxj2t8Da/QM9md4oHPF8ljFnocS3XEZ8pHVhtrW546j4XDYEGSZ6Nyktg0bwXmff5nPPPn6P3/9ENGJX8Gsx1kNI1rsF4hNNTCRaJ7hOxawjtdAVhFgdX24Kipg6MCtNpwuQjf/TokfqOFrvXlG0mt7/Y5RA8zeMqTQtBL1/m89rXUvOu2fQTSQoR4ibcfKfzhzXRe/7EOizb/qplW5/X068U09Mu0OfFWSx1yhwghmtIqylcFppr+SKx+g0/MUsujwVsElPuAlvXs3MU5s0s6LkaaZMXK5C/8PXUGra66XxCmnKKvSgLPA9lrM46ui8jRa9OGkTgtewWJnaI3RuGNhIjXcF0MXPRLaR+ly/afE9gkpiO69qikJ9c51tZZC6QZ2WOby7y/V4nJPjwkMaHpxCcX4AqaTQdqlZRZjc5rY1X8Oqc8NygdCu2OZ1xFnWtStwDZ1K/Jn1anko+GtxFsU7JFN3N4A4WOBgIjucXyVHjy8lM0XAjbxc0b22YvX5L+Z0hxkFmdXCtlmELD2A2FCzKha4GwadKq4K5Gej+FciZHvNghUL/J3GDfj8bqIX6qlAgErSmNN5gC8jRm+8npkFcNSvRjmpnCI43Qz2esjy8SMM/W/nq4SOiO+RXKUO/QDWpdxdQ0JcjkH+T3HVH55X+b72Fagx6sOZMI2z6IrJ5r/nJZ9NjjN14GtMGdFZL1Iursz0kLGNMB2qHS32Qx0BoChb3o0sxQ5hfeAlYthiVMHGLA5xvW7 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)(186003)(8936002)(26005)(6506007)(52116002)(6916009)(36756003)(8676002)(316002)(508600001)(6512007)(38350700002)(5660300002)(4326008)(38100700002)(7416002)(2616005)(1076003)(6666004)(6486002)(83380400001)(86362001)(66556008)(66476007)(2906002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?DXGtfyabyONCzaOzVdZK6K+imSe0?= =?utf-8?q?gvAEvIrKixDORh+yq4HKjfsDHtyB0PlXbOSli7dsp4HAqY8gsQ52glKE9OoDTIcnV?= =?utf-8?q?4cvXxbv1i3xW803wGRwrB9X71ZyVoNsUU3v/1TOMyBKVFzBNOgOZqPLpIoBZl7dA4?= =?utf-8?q?dtda3b9r51QUzMwggyXbWqFOnZbFkEqMLC3k5QLQanMUwuCBL5GJHR7KXR7ahe3+r?= =?utf-8?q?wTb0Q9L6FJG6mo95MIRday8Cy2KHjZGAZOdFWbA/jev47TWzM8tihRf8VFhzKOtYL?= =?utf-8?q?x1pdJsVZyYuvNImsEwPol7CC2rK7mu72nZElUPaWf+AOdaRYuO0dDBHPrBoCUeZK4?= =?utf-8?q?1CEkfryLOZrAxKWbsoYV2ShCSUJrL+VovrCVhLSqrI7saIAHaCWkpIvhAlhymtDac?= =?utf-8?q?A7WTuoMH/a16ySJk9rj57Bqmm6e/OuuV0QAOjZW48XhzZ7vPev3qrQqzb0iQu5vqv?= =?utf-8?q?f079ehbFH/wR0s9OszYBgxuvpKTd5C/A4YwfQsfKqnnqaEzlwJ5uhj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njTYo/vWIPM?= =?utf-8?q?F8Vn54ol9ffLegneIf1PdKZVAaPSxS58w7Bi/9YAO/A2uAiQS3/p/hBO+R3MB/3Eh?= =?utf-8?q?3N8REYX+uEi3iVgTo8LqC8Y69pBDRSYbA2EVLm/1dU9Nsaq2x8FsYqCHOJO84hCuh?= =?utf-8?q?S447yIOWjYFlHR5nSpK7bKErK+lW97sYrIEcgmfrsd2UtMwtHHelXmZgsUtaqf6qf?= =?utf-8?q?KncEEmRS66SeEamOPyWqsBJBi5K312HIRefRgO09prYtimObH4XtaM=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ff37a66-1942-4b91-1c91-08d9c6047f58 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 11:08:06.9691 (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: 86D2w8FrzUIKrG0QJARBqIovs8UikVUwX5ALlT0mqr+9txqcxCBxWbhCql437/EXRgDat31gSWXz9fBnC62jR35eBnufioS63YOGO2XanHg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5393 Received-SPF: pass client-ip=40.107.5.93; envelope-from=vsementsov@virtuozzo.com; helo=EUR03-VE1-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" Add and option to generate trace points. We should generate both trace points and trace-events files for further trace point code generation. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé --- scripts/qapi/gen.py | 13 ++++++++++--- scripts/qapi/main.py | 10 +++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 995a97d2b8..605b3fe68a 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -251,7 +251,7 @@ def __init__(self, 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, QAPIGen]] = {} self._main_module: Optional[str] = None @property @@ -264,6 +264,11 @@ def _genh(self) -> QAPIGenH: assert self._current_module is not None return self._module[self._current_module][1] + @property + def _gent(self) -> QAPIGen: + assert self._current_module is not None + return self._module[self._current_module][2] + @staticmethod def _module_dirname(name: str) -> str: if QAPISchemaModule.is_user_module(name): @@ -293,7 +298,8 @@ 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 = QAPIGen(basename + '.trace-events') + self._module[name] = (genc, genh, gent) self._current_module = name @contextmanager @@ -304,11 +310,12 @@ 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) + gent.write(output_dir) def _begin_builtin_module(self) -> None: pass diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py index f2ea6e0ce4..3adf0319cf 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, + add_trace_points: 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, add_trace_points) 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('--add-trace-points', action='store_true', + help="add trace points 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, + add_trace_points=args.add_trace_points) except QAPIError as err: print(f"{sys.argv[0]}: {str(err)}", file=sys.stderr) return 1 From patchwork Thu Dec 23 11:07:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12698106 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 C2BEDC433F5 for ; Thu, 23 Dec 2021 11:14:45 +0000 (UTC) Received: from localhost ([::1]:56746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0M3Y-00030l-Rg for qemu-devel@archiver.kernel.org; Thu, 23 Dec 2021 06:14:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0LxN-0000cw-1i; Thu, 23 Dec 2021 06:08:22 -0500 Received: from mail-eopbgr50093.outbound.protection.outlook.com ([40.107.5.93]:38670 helo=EUR03-VE1-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 1n0LxL-0003iq-Bp; Thu, 23 Dec 2021 06:08:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K8jqBztjURjmcR7MhR/uYfFNIbVsmcermqy19NOCb5FOmsvzYVMH1kfjMbxnZWbklCxQ6xZsJcwvRddwRcppiolzkeY6n+zM0Uv/5Gc16rNfqqJI1efpDU+2cbRhYcXeXb+FNrM2xxZGKAHoi/PBmQPcWtHY/jAKF8UueIg+HJxUmF7wsVKUBF7aY4Rq9Vx77eqf7puUi3VGXIWb1L6/tRc9tn202BvdwY3V5t5oKoZzBclgc7uYWCjDfEsRkd9DDrzaDX8Nx9lU+NM94aIsD2qIv7ZcvgVma9mUXpvc0dOLI72UgvcuePlkll1Ua8TYvbiQyjukNkws4Sfh9xtWVA== 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=ClSq4V4URK3cLfgjYqlGp9XRSmGRnwp0cdFihGfuRTU=; b=doMIrFpMkmnwmoZ65zJXryBw4vszdOaaKSnCU6DzG6d9puqIeV8Oplg9JtUsmuYi4c4li6WDZ2wZ3+2+jfLaHwfGjecqHw+lUqzUZWvFw3TY+ZpwkEuePAWbXOIcuR3BYqWrpR61MvbhjOrACWmjpTGG4RcoPqwIxzwlYxqOzu2StzkW2JK3AIfXqwL8dnebfBDJLCRL3Go24dk7cqaFOoD9asMst8zgiCuQ5D/33qarBB4c1xQv86ZBQUw90LIy5+Xr+POdcjTstTYoltSvzUm2mXl6GYw7v/K2ISo2oSAyR1IWGcBOTq4kjz1vcMyCrWY5Nqn76AGD15KZVLTieQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; 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=ClSq4V4URK3cLfgjYqlGp9XRSmGRnwp0cdFihGfuRTU=; b=qXkLp4kn2enWlQNVBX+A3+WfS/AjQGMJbP+WnTtWF7NCJQzjZRY+GDeLSwOeyS+6f1ddC5oWxQ9W25dqeibFOBmV+jofj7WQhAxUyvxyzNvkChPudVY2ZUAnuKMszVF52+ZP2ToZMoSiUQD1Z71wMW0k0LgaZL/AFLxKxe50MAA= 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 AM0PR08MB5393.eurprd08.prod.outlook.com (2603:10a6:208:18c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.18; Thu, 23 Dec 2021 11:08:07 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::b118:483a:d003:3112]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::b118:483a:d003:3112%5]) with mapi id 15.20.4823.019; Thu, 23 Dec 2021 11:08:07 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, stefanha@redhat.com, michael.roth@amd.com, vsementsov@virtuozzo.com, jsnow@redhat.com, armbru@redhat.com, hreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, philmd@redhat.com Subject: [PATCH v2 4/4] meson: generate trace points for qmp commands Date: Thu, 23 Dec 2021 12:07:56 +0100 Message-Id: <20211223110756.699148-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211223110756.699148-1-vsementsov@virtuozzo.com> References: <20211223110756.699148-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: AS9PR06CA0094.eurprd06.prod.outlook.com (2603:10a6:20b:465::7) 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: 1db8ee25-4080-4ab1-6455-08d9c6047fa4 X-MS-TrafficTypeDiagnostic: AM0PR08MB5393:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7L/2i3waU4XrKnZB2KrpJgLO4kmbpAObVnll4m8DBwm/IQiwNq2JHClXnFVhpLfqNSlb6JbqRX5ILR0yV3X+LNHi5oGiKKlcnGw2NGGi814UPmJLGeBgFz9uz29xTzK8gdJIVjy6qZ8btGry1bGCNAxp/or0q+e/YqBx0XUjQojWrdOZcEy1IZI67dvTRixmV5SARyL+M/rkqzKaCSDNMz3hrB5B6P5NLPQL4ksfVCo2jF3OaZO3826gZP7iYyuBHlTa1uyN4BS6MZ667KGIXWpto+zshFFq5rMauBa6oRZzpsvoZ9gfKlqwd5b3I63SVh357Ox1mpqzmJr0w34txXCjU2j/WEGVKyYnnxnIndblqq6a6E7hpJTKEgRYjDmQqzXpxXtZV2WSPOC0di0xcuY6+JrmtXJhkNmCwu9sJJ+grAbbkxPRmkXHqtIk2CCduNayCsw5DFtX2Ui00jkmMWQ3MsEGzg0DerzLrsAOgo9XhkQ81P0ofa+RKhcjEhoia7ijTyyr3+xP2i+pv7u8KzJtFeodKNnIo6KAJ26NoqLj2mUNnCYUEk8soz5HqyfmP7YQELYDOOPqVWSyPSv/Ro2upLdtWo9v+5E7zkARm9SdSeJHWmW7MreDv0oe8rjBkUmLYsu9HpHg6oIuA2ksevoGReFaZTQpE6qfl6EDkLKR34nTN4WQ62DUjK8Vjj3HdCr41LxvgMgsjEPiAJs34wglkIO2oUthsyWzkBDx45K7IVbfpjAtV4saEXHi/zRn 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)(186003)(8936002)(26005)(6506007)(52116002)(6916009)(36756003)(8676002)(316002)(508600001)(6512007)(38350700002)(5660300002)(4326008)(38100700002)(7416002)(2616005)(1076003)(6666004)(6486002)(83380400001)(86362001)(66556008)(66476007)(2906002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k4jUrucusE+1P5D7bnCw5A7SssO8fiDn2YkMusF2JeULsNSW55Yh/756i79PkwUvhadRBrzcXpS/zZVAYueGho5FjxTzZ+DH9dh1QFeTwLphe1ZP5Sbo+b+6l/dVD443DW2QfTE9LpVmbNBOEcRyW0RUf0hW1GMNGBigPyALSlL9QYC1qUcXWiCr/CXY3ngxaAKhucNxtPfqlfszAtv8Yo9/TLuBH4RexEKLGSnp9k2mbOsyiTpthVS7Xumbye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nUaPi56KrFADsxiL0Etk/1EJ4l0rZjc5NRf6AFzrtVbyDLDHHwSyDex3I/tKNhc+K4KYzlCaH2PjT0FIeSLsB9Rl12Ct1NkstcZNxksXNJFRboytInII84L1puVFUucPnxx16AIuM2zsHWEJfduDs8IkACS3moJqIVZH0Oc/tEdcUJcw34+LVPOUt6W20Ity0Tjd6Iv6PJY4zhAlRLXNJy6hYUVoiwwn357+B2pHrtLuJLGGdBIOt93mfybezDc7OrcKXYvAw7y9GPcSfqNVPtCEMVQfft47uGEE3nYTMCy1fam3LqM42RGNl1AAhra/kIoblLwYsQo+RmUKZRb0F+r866szARtEDy44vs= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1db8ee25-4080-4ab1-6455-08d9c6047fa4 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 11:08:07.5159 (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: +1P52gn9dLqw7CsBqHkFSWNs/GQIi7osAjgs1iIvvx+utvXwK2eMJHKJgNOILxHKCIzSOR6pboHXIMPO808DDt7t724mQHJLsgSVq8Sa93E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5393 Received-SPF: pass client-ip=40.107.5.93; envelope-from=vsementsov@virtuozzo.com; helo=EUR03-VE1-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" 1. Use --add-trace-points 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 --- meson.build | 1 + qapi/meson.build | 9 ++++++++- trace/meson.build | 11 ++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 17c7280f78..fcb130f163 100644 --- a/meson.build +++ b/meson.build @@ -38,6 +38,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 diff --git a/qapi/meson.build b/qapi/meson.build index c0c49c15e4..826e6c2a0a 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@', '--add-trace-points' ], 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@'