From patchwork Thu Mar 20 09:57:56 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: 14023649 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2063.outbound.protection.outlook.com [40.107.102.63]) (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 0009A21481B; Thu, 20 Mar 2025 09:59:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742464766; cv=fail; b=AHcdWMxkehZoQ5j8c191muDrQ6Aq6VOHrl6EfrU061+RHzXqYB2uAQRmfI1tKUrzmk2mu3OD+JJVLxTw8rU3OD7wAdou1ICu4OQRuhmX3WojOWKpC62jUgmJIIl6sB49X7IGFAc+WY/O4m5gxYM72E8F34G0jpAZlXfAWUr6tbM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742464766; c=relaxed/simple; bh=PANvXJOSaULYWWcjUQueSEII3T0SW/mSi2jHWw4MnPo=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Bm4n3i0NuD5XOZSFe9sYiqXdL3BR2O7vWq2BrvvQ79EvKJNb1BRVAG2RjTGqI718cQzT+bLqscIhBADFD6oael9jtspA5fQjUgcIi5ltZfzFveRILdSvX5C6gsALJ65osGepXGHIM4Id0CYEDTdmxo+5gCQHBODP9e8aWRkgrVU= 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=I0xkYI16; arc=fail smtp.client-ip=40.107.102.63 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="I0xkYI16" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=u45a4wujZF00zz+XE6sUV8Zt/W9HQIF/V5D1Xoaq350CdYu0+Iy6J8Uz5jJvqBEoR9DX0OIUM1haqc3PidPeq2doMy0sMM0cGjOHGbOLUUafpMBQIf/uwoyD0hZCv9PZVXFdtkuzOy7bz+uMXELhStwVV+GNxATCPiG/77vAmtvP9OaVRVXNb1xeEh+Sj03AP2wiBK3UD4xrAHZf9tkzu87z2KJodzDwKYosRg2gqeHB/0R2LTcQ0xRabAjPjSOG/v48aa+k7I4Ka/tIwkKCaAgKy5MyihjlwQ7CO3Xymeb32DTYlt5YqL4/CcGLVVDIKB5WeUKmdjbXrqoD2EBJMw== 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=uySjzVi0W3/hhvNq8nPGaasAt9phfmlmdxD4j+aHs/0=; b=WjSQ7BMdUMonauBGdqRM+CvP24fImXwyu6bmzruonnEpVpXkFkYtcpFLhnLWssYJlhMuxLtS/1cGsaoJwlVeE7raeMTWABzYzJxJX3CgYI+kAUe1/vQPjh65/5SJ+IGGiJTPPPZ3L/bZjFaTjKMgg2DkMwnSPt9qppQE5DrazCYrsa2bDpnI1ckB1XXaidDGZRinPPfxq1sapIyNrePoxnLpbxW1DRm6mMHzNTRXvswlC6u7NJU1Ps5PQDl0HmhPFfKv/+01A5jBlCsDTPDuNcSSEqi24XTvtXhH3Wn/Y2CeHj2y2bsEFCkDiXftqitL3zibdjl7f9jIoZ5ioUoW7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org 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=uySjzVi0W3/hhvNq8nPGaasAt9phfmlmdxD4j+aHs/0=; b=I0xkYI16vsUSsw0HD8Qd8f3Y5fOwAfBZRVGzPMUDACF6BWrW9oUlUZ3DK5yIZs6WOFBkDAnExqj4BOHPlxLYU47Qtd+G6GRRtH7hJuaEyXTkKMjLXI+WXHfsgQxgbZNmGvipz1jDzzuLaitqs57fqqIQ0V9Re58zUVP2AZoNHgg= Received: from BL0PR0102CA0054.prod.exchangelabs.com (2603:10b6:208:25::31) by DS0PR12MB7535.namprd12.prod.outlook.com (2603:10b6:8:13a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.34; Thu, 20 Mar 2025 09:59:21 +0000 Received: from BL02EPF0001A0F9.namprd03.prod.outlook.com (2603:10b6:208:25:cafe::31) by BL0PR0102CA0054.outlook.office365.com (2603:10b6:208:25::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8534.36 via Frontend Transport; Thu, 20 Mar 2025 09:59:20 +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 BL02EPF0001A0F9.mail.protection.outlook.com (10.167.242.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8534.20 via Frontend Transport; Thu, 20 Mar 2025 09:59:20 +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; Thu, 20 Mar 2025 04:59:18 -0500 From: Pierre-Eric Pelloux-Prayer To: CC: Pierre-Eric Pelloux-Prayer , , , , , , , , , , , , Subject: [PATCH v8 00/10] Improve gpu_scheduler trace events + UAPI Date: Thu, 20 Mar 2025 10:57:56 +0100 Message-ID: <20250320095818.40622-1-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0F9:EE_|DS0PR12MB7535:EE_ X-MS-Office365-Filtering-Correlation-Id: 91573c50-aabf-4281-e7f7-08dd6795e297 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014|7416014|13003099007; X-Microsoft-Antispam-Message-Info: =?utf-8?q?SDwTSyC1wEsEAbqgts+ee7sQAImoXsT?= =?utf-8?q?XtHivVa1V7q+bxvWOBG8CZwNVPpMV8REMard1helKbmTzFy8V4HOVvEwKv7PxpUKK?= =?utf-8?q?TAdFv2QbNUfhW0vlo+dTD6axgftF8tfU0qjhlKk1VDC+L23RspfGtnJW9rskyxDFs?=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?= =?utf-8?q?Vqh8TMKDB3G2Fpan6CUpCXJDse1uC5hKvNKpGRs0CvzJ18XemhhyPYQV01CqhN2y4?= =?utf-8?q?pRfz+duqZThJAkO1F3OMcNCumM1sJWD0AZPg+bBJa9jDrAlq3GJTf15BgslWbfdLw?= =?utf-8?q?bP0S2Vd6p/OsskMm80XjllfIkewBRmggAd3ZbgadMw+F9lNBo9vJ1IUIIZTWchLjO?= =?utf-8?q?ExTcxaW8zZwClmbxsTIxVJwY8Na09xLGfp50CYzX9xx01MR6BtbdwXh16AAyiH3K2?= =?utf-8?q?13cfuD3yvFsC5YFHqWFqetTjvcFF1K1/08DqcDtiDAKGC0bSYbKy+c2lDjTHtKyX3?= =?utf-8?q?vDMjVBQWqf2RdXTNKqmLRRP7WgI8kMJLCn9cW36U0ENPHxAh+1GFWA0=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)(1800799024)(82310400026)(36860700013)(376014)(7416014)(13003099007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2025 09:59:20.5403 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 91573c50-aabf-4281-e7f7-08dd6795e297 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: BL02EPF0001A0F9.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7535 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 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 - v7: https://lists.freedesktop.org/archives/dri-devel/2025-January/488117.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/doc: document some tracepoints as uAPI drm: get rid of drm_sched_job::id 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/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 | 11 +- drivers/gpu/drm/v3d/v3d_submit.c | 2 +- drivers/gpu/drm/xe/xe_sched_job.c | 3 +- include/drm/gpu_scheduler.h | 13 ++- 30 files changed, 186 insertions(+), 96 deletions(-)