From patchwork Mon May 26 12:54:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Eric Pelloux-Prayer X-Patchwork-Id: 892637 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062.outbound.protection.outlook.com [40.107.244.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21FCA149DF0; Mon, 26 May 2025 12:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748264140; cv=fail; b=u8vUBixQaqZL9+48a52I4LfBQLrRQr3uxv9LVGwFh5+yfhNhSf7cSIB2gyiRPPHEBB992ZPyvH9AfKDSC+H2LxevkBJoPOmNps5p/4s0e5llIpfX5Eph0hByED5NrbyapniaKhrQYBANYlQyEM4e01jc9OZ+Y9zYa/5GmAAZWIw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748264140; c=relaxed/simple; bh=RbGAnDOwrTtwentdyW8ofGEWt7dqOvS4uUZvgioDNQg=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=CxW1IrdiOAR2vqimDOlMdOwxCVtHxjNIiDEuJlhTX3PgesAwoWhXfo5u6dpwtmihhu3CghbqXlu2Qg5ni2L+c5S70oZUsHGPHIFlAqQEOTdJHYy8e6+aBOW1/bJTxUMSL5tlvZUoR2eWi0mx8QftfcVN2IpYnv/YQpCwDOHjYIQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=U+MSisGj; arc=fail smtp.client-ip=40.107.244.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="U+MSisGj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WXg1ffKixIo5QLCu9LdPMNufWyb0j+2ysJ3g+6LLW8IMEF1VIH72LVnSaKJ2oU27Wk6rYRea64BVTyOsI0VgWiuraPgCnu+sEuPQ8KPXYDvGXr2j8oElVKuG99uAbAd1WqAqWu3sIVPcOH0YDaBEyo8qacgrCMvR5tkivMTm/SdsY65Cg2ZqVnoDP2wqiX6xpqLyamk6YQDhm17v70I7LtLBFNdHFMuCfLFR/Z+z9lRGU+LU6wdhluZmo/mJN9JuIY6g7w7XbbiXNF1nUee41wy072/sevzinkhniTtHSHTxVseYCJmbXHMIxnruHJwTJRzRrza7dpxJFyKKBRd0Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=6B8P1zxfJDoyoU0W3IawYc8DH8YXTlPWkpb4fSZ9TNA=; b=oLH/XTiqFnCu56FvOf+qnciryrf2CTTAPqNglGIq3iDsYtbbv8xzljBEkx0SRSjF52L7ZqmhVKxy8NRTgxA0T2RpF2JGMdzSVMDrF6iHckDW1wOD/gjolakB3YNdoJ5C6mKqG868VveWGv0UdALWBj0ZPBQXqn63UFdrNS90fbDc3RqdQx7f81NxzC27oyhkWhhbdH/ZdpN9D0tvpNk3lrVw33ZKkULO1euh4Whqx3yyohE/slFRzU8LVqYpv+MRLIzYWQqRkJE87vXaBFbElsch9wNoDF6GshR/TT5Xp4OqDYYwSxQT3hyU0jLMn5d5ZezdypdoumCvwDe2TfLWnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=igalia.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6B8P1zxfJDoyoU0W3IawYc8DH8YXTlPWkpb4fSZ9TNA=; b=U+MSisGj84SKPUI9CT14iXrTTQNrGD9tGGIv5zEqN4bWzlyQ9nukI4MhmlfmhBFtd+/h2KEyfNtxYa3aRQig/O8VmIHv7g+rUzZEcqGQW94A65GzzfboxHcdxLkHlvTn/luFCw58EuSja+HFbOzGD4oCMVKwzRMxGWZj42z5JX8= Received: from SJ0PR13CA0001.namprd13.prod.outlook.com (2603:10b6:a03:2c0::6) by IA1PR12MB6044.namprd12.prod.outlook.com (2603:10b6:208:3d4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8769.21; Mon, 26 May 2025 12:55:34 +0000 Received: from SJ1PEPF00001CEB.namprd03.prod.outlook.com (2603:10b6:a03:2c0:cafe::66) by SJ0PR13CA0001.outlook.office365.com (2603:10b6:a03:2c0::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8769.18 via Frontend Transport; Mon, 26 May 2025 12:55:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF00001CEB.mail.protection.outlook.com (10.167.242.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8769.18 via Frontend Transport; Mon, 26 May 2025 12:55:30 +0000 Received: from FRAPPELLOUX01.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 26 May 2025 07:55:22 -0500 From: Pierre-Eric Pelloux-Prayer To: CC: Pierre-Eric Pelloux-Prayer , =?utf-8?q?Christian_K=C3=B6nig?= , =?utf-8?q?Ma?= =?utf-8?q?=C3=ADra_Canal?= , =?utf-8?q?Thomas_Hellstr?= =?utf-8?q?=C3=B6m?= , Abhinav Kumar , Alex Deucher , Boris Brezillon , Danilo Krummrich , David Airlie , "Dmitry Baryshkov" , Felix Kuehling , "Frank Binns" , Jonathan Corbet , Liviu Dudau , Lizhi Hou , Lucas De Marchi , Lucas Stach , Lyude Paul , Maarten Lankhorst , Matt Coster , Matthew Brost , Maxime Ripard , Melissa Wen , Min Ma , Oded Gabbay , Philipp Stanner , Qiang Yu , Rob Clark , Rob Herring , Rodrigo Vivi , Simona Vetter , Steven Price , Sumit Semwal , "Thomas Zimmermann" , , , , , , , , , , , , Subject: [PATCH v11 00/10] Improve gpu_scheduler trace events + UAPI Date: Mon, 26 May 2025 14:54:42 +0200 Message-ID: <20250526125505.2360-1-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CEB:EE_|IA1PR12MB6044:EE_ X-MS-Office365-Filtering-Correlation-Id: 593ebef6-bda9-4046-d91f-08dd9c54986d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|82310400026|376014|7416014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Xr58TC0mac/qbLf0cC5Aq20R0F1ZIV2?= =?utf-8?q?XExTvlcLYSDIJsiRI5/hzmali/7tpJ05rqJQA0FBF/GaxjgOlIXcz880HjpnUb2B1?= =?utf-8?q?8s1eS1RClqc8kSbixewqOcpi3jsZue7gqcj3BnkS7uUF+nt9nTntfESBNR1k0WkPh?= =?utf-8?q?Uxv/kZ2Tc5F/KTrGRTVNfa4+352cvbm9frQcBFZJkQ/VSChgJxedtPx7Om9XxDHOk?= =?utf-8?q?XQ2w6gPVOcUbVuZok8vv3kdxw2FidTbuJt/jVCifWXdy+gQ6etLVlZDSUO6TNSK86?= =?utf-8?q?zrrbd0ODbI7xlQ5LRPu0owmHjX6XuOKFvp9/TV2OGwCCs58ESQw0vX7iU5ZtOY/K7?= =?utf-8?q?18xTHFjNgkBwqZO4RlGGW3ZpAMLF/08o94+AKn3j/LfahPTLHsvXTKeCoV5IhLroQ?= =?utf-8?q?9lDUVRUimPe6p907wU5YnXdq7hD+ZRjtvp4QEvu0HjbDWD4Bka3UJHAZeJcAZUiw2?= =?utf-8?q?kzP6FVH54E2mX+0EBzngkd4FTe+ZK0X/OG2gHxWnzdsvJOqdfJqL95GpEgwXt/aFK?= =?utf-8?q?bQdaSJrw2WpZbS0hnYnEQ0KGQHnld7DxmRLucHPi/abwTkD7wt4vG//miQS8u5KXm?= =?utf-8?q?ooxZcenSevHeUufHdQCjrQskJFPnNLv1WU+LZNWeTTZOSnYC6Gre+Bve9G+ZNl41k?= =?utf-8?q?GdVvxnVdfy0x6LCby9QYGrDBtNhaTlzHcAEPC5i4Q+M3Vzwr/E8h3J+BnUP2vBFe0?= =?utf-8?q?MdjwpVppDfLWhGVHmAwKYKPrMLJExzNDndkSDylb5Mpju5twIa0AQA0+fcHycAs1E?= =?utf-8?q?UTeo3gnG73sNQyjc8su6i+xoNoMxMKImFEr3wRKg+uj6W0T+3XTZT9TtH3UlNjsQi?= =?utf-8?q?o5lqPYfq5/KIIICktZNPCZQ0UhQiPj/6e2NYq2QP043mGzRj/PqBJ7WalqeI/gOiu?= =?utf-8?q?ki42BNl9drLbwAfJSz/yS4JOw+bqKVwxP/Cv/bgmwRu1744Uolik/I40MR9ow0ynl?= =?utf-8?q?UCIsB8uiBCor4SZP3BaBDEqZB7WrOwFtGDeZvSq7POETjfr13pGfY85v1Mj9ZsruB?= =?utf-8?q?yuROSVlWXNP6pht4uK74zcqGb0ybIEFdnuSf/jlGegUMgv3g2yfa6IttwGiaTGZnF?= =?utf-8?q?QQKUGciA90b3egNnLQ9cOZr0j60vcGwyYHpyBIKCjYzD9ZoO6Z+B0wScbV4gsr0u8?= =?utf-8?q?DRhcEDRSNq2CPh17wW3sRxWIUtuxbgGlyr06Tj0IBcw2VzjFIDw2hfFDodSgzcQEX?= =?utf-8?q?s/hCoU3F7zNPu80d9DC0LwItGG+6Q7dEaPhNU3rPOKFQ38p4CYqbUlEOll8s4lpDr?= =?utf-8?q?ke7Cj28WjGIhmRG4BuC8LPwpCicEzGMB/IN7jBidO7Qs6a6SgPu+w+jGi0vMgse9U?= =?utf-8?q?SVIb0Pras0BMO3wKj/pCEtKVmhIT1U7+JOwrJWp3opBu2QDcStYhbl0SpiN7c5ac9?= =?utf-8?q?8HA9quSdg7aSn9YFu0R+Ujf64QGHgVXAg=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2025 12:55:30.3756 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 593ebef6-bda9-4046-d91f-08dd9c54986d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CEB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6044 Hi, The initial goal of this series was to improve the drm and amdgpu trace events to be able to expose more of the inner workings of the scheduler and drivers to developers via tools. Then, the series evolved to become focused only on gpu_scheduler. The changes around vblank events will be part of a different series, as well as the amdgpu ones. Moreover Sima suggested to make some trace events stable uAPI, so tools can rely on them long term. The first patches extend and cleanup the gpu scheduler events, then add a documentation entry in drm-uapi.rst. The last 2 patches are new in v8. One is based on a suggestion from Tvrtko and gets rid of drm_sched_job::id. The other is a cleanup of amdgpu trace events to use the fence=%llu:%llu format. The drm_sched_job patches don't affect gpuvis which has code to parse the gpu_scheduler events but these events are not enabled. Changes since v10: * fixed 2 errors reported by kernel test robot * rebased on drm-misc-next Changes since v9: * fixed documentation link syntax * fixed typos in commit messages * spelled out that these events cannot be used before drm_sched_job_arm has been called Changes since v8: * swapped patches 8 & 9 * rebased on drm-next Changes since v7: * uint64_t -> u64 * reworked dependencies tracing (Tvrtko) * use common name prefix for all events (Tvrtko) * dropped drm_sched_job::id (Tvrtko) Useful links: - userspace tool using the updated events: https://gitlab.freedesktop.org/tomstdenis/umr/-/merge_requests/37 - v8: https://lists.freedesktop.org/archives/dri-devel/2025-March/496781.html Pierre-Eric Pelloux-Prayer (10): drm/debugfs: Output client_id in in drm_clients_info drm/sched: Store the drm client_id in drm_sched_fence drm/sched: Add device name to the drm_sched_process_job event drm/sched: Cleanup gpu_scheduler trace events drm/sched: Trace dependencies for GPU jobs drm/sched: Add the drm_client_id to the drm_sched_run/exec_job events drm/sched: Cleanup event names drm: Get rid of drm_sched_job.id drm/doc: Document some tracepoints as uAPI drm/amdgpu: update trace format to match gpu_scheduler_trace Documentation/gpu/drm-uapi.rst | 19 ++++ drivers/accel/amdxdna/aie2_ctx.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 32 ++---- drivers/gpu/drm/drm_debugfs.c | 10 +- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 2 +- drivers/gpu/drm/imagination/pvr_job.c | 2 +- drivers/gpu/drm/imagination/pvr_queue.c | 5 +- drivers/gpu/drm/imagination/pvr_queue.h | 2 +- drivers/gpu/drm/lima/lima_gem.c | 2 +- drivers/gpu/drm/lima/lima_sched.c | 6 +- drivers/gpu/drm/lima/lima_sched.h | 3 +- drivers/gpu/drm/lima/lima_trace.h | 6 +- drivers/gpu/drm/msm/msm_gem_submit.c | 8 +- drivers/gpu/drm/nouveau/nouveau_sched.c | 3 +- drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +- drivers/gpu/drm/panthor/panthor_drv.c | 3 +- drivers/gpu/drm/panthor/panthor_mmu.c | 2 +- drivers/gpu/drm/panthor/panthor_sched.c | 5 +- drivers/gpu/drm/panthor/panthor_sched.h | 3 +- .../gpu/drm/scheduler/gpu_scheduler_trace.h | 103 +++++++++++++----- drivers/gpu/drm/scheduler/sched_entity.c | 16 ++- drivers/gpu/drm/scheduler/sched_fence.c | 4 +- drivers/gpu/drm/scheduler/sched_internal.h | 2 +- drivers/gpu/drm/scheduler/sched_main.c | 12 +- .../gpu/drm/scheduler/tests/mock_scheduler.c | 3 +- drivers/gpu/drm/v3d/v3d_submit.c | 2 +- drivers/gpu/drm/xe/xe_sched_job.c | 3 +- include/drm/gpu_scheduler.h | 13 ++- 32 files changed, 191 insertions(+), 101 deletions(-)