From patchwork Fri Jan 31 11:02:58 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: 13955234 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2056.outbound.protection.outlook.com [40.107.94.56]) (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 579B4322E; Fri, 31 Jan 2025 11:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738321430; cv=fail; b=gPMLqf76NvJkglZUnsjlnkW7Wlv6tXz4WY9R24RIz08vjUVf+LF6VWUGLCMMzkufzFaIVXNQ0uFIDiyYBMv0IrKQozGDaW9n/P0hs3+/26pFjgL4bwtgAJrzKQA499GzAzK7bsdyMXnZ4xHxJAT0f244p/SBznovizDdT4pRh10= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738321430; c=relaxed/simple; bh=l00MDAwi5Ehc7XRTtoxvdtzQMExGa8Q/B5tFfyJtizU=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=RxeeD2qv7x8Xc+rdJlLmAZO+snYTrPURAzWS+OrGN3/wNY8XFv9yM7ipSxqx714LdHrvL2zaNn7NChG4p7VmoSCFF3m8Dn9tM8q2FQyT8CjkzE2x7incXdWsgNXup/mJDrH754vquoEG6nOA+SUrKxr7HFqKJyJqM6sAKYNyiRs= 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=dXsI0frC; arc=fail smtp.client-ip=40.107.94.56 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="dXsI0frC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OvZoWoYHygQu7kjhnH/0YoO8RO4s9xB4C3TH4Qy+tjIi0CtPWtsK3zud1tDRFmdVfd1v6iau0ECG4CzZ6vekUDJzKm+TJhF46Nq0NqmTrX7KwvxIJkX2bDMBQDFQDmieG2iQDfWMoc4Xxn8TGDSrUT5wI8EZ8OjjTHsyImuDso3eT65jwwEBPKO2B+Zcca2srdOGyipgdxaO9Zh168z4bJ7nG7UUfRUZxume3rnJbX1gjAokKgaiu5FcxOrhv6JpZEOo64hMwbufjV8drS7Q/LfLVs5tmvi6+62TDEKhyxu5soukvOefJexm9FODrBywl7Y9HaTzVdO2l4y8GnreLw== 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=8VAGDIpQcJp40PqoDAVHv40LV5uDu0hKJbH7NwMRjaM=; b=iXIsCy5bjeMYnHa7ENaDSsdLgh03Nn74XAcEVPeOVlx3HPrkWqKqT5JP32j9WBDgkd2j7qNc1fGLzg4Y8lfNbzvwWh9gCZeKtrqPav28jcl6i1c5IowIW3kNI7DvmmpFULuiOeTnyMpxXTG+r7a7k85w0ZlkEGxnSVwY8oDnQiUsdW7PvKUQRVz9JzKCdvOlF0mO1sRL7mmivJwIUG6pDLS2XmCnfhmGM8cWIqPgsQCy5TYrR4/9bW8kF6hr+rLHunwzI8rdG0yANZwbX8EGqOSHwdpnVt3DBcKqVowjyvsnU9j+qTTj/gyb8sDPNmdd3k1G6ej0u3/uQWC3Hzdmmg== 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=8VAGDIpQcJp40PqoDAVHv40LV5uDu0hKJbH7NwMRjaM=; b=dXsI0frCQkDC4ecWWMF1quaC++5bdVOPn62xd73q2K1mXV0TYG7h/gxVU5Ki6+Gr3t/MFivEyKLlAV8WuwxWuBELcWYTwhk4F2iM+3Y92wrQA4nJT325DRUF7hm7Jlm0hyyX/pPnMR6LFpdMUh+o0a7Z3P8LwiutiolByAFG7JY= Received: from BYAPR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:c0::22) by CY8PR12MB7514.namprd12.prod.outlook.com (2603:10b6:930:92::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.20; Fri, 31 Jan 2025 11:03:46 +0000 Received: from CO1PEPF000044F0.namprd05.prod.outlook.com (2603:10b6:a03:c0:cafe::de) by BYAPR05CA0009.outlook.office365.com (2603:10b6:a03:c0::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8398.18 via Frontend Transport; Fri, 31 Jan 2025 11:03:46 +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 CO1PEPF000044F0.mail.protection.outlook.com (10.167.241.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.14 via Frontend Transport; Fri, 31 Jan 2025 11:03:44 +0000 Received: from patedamande.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; Fri, 31 Jan 2025 05:03:40 -0600 From: Pierre-Eric Pelloux-Prayer To: CC: Pierre-Eric Pelloux-Prayer , , , , , , , , , , , , Subject: [PATCH v7 0/7] Improve gpu_scheduler trace events + uAPI Date: Fri, 31 Jan 2025 12:02:58 +0100 Message-ID: <20250131110328.706695-1-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.47.1 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: CO1PEPF000044F0:EE_|CY8PR12MB7514:EE_ X-MS-Office365-Filtering-Correlation-Id: 87ffd7f7-c1b1-4227-f93a-08dd41e6ee35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?I3dHLIsqYR1Cynst42YUxEDHO7Yro/y?= =?utf-8?q?RRZgicifCC1GHg9f028AyioivdS63uMEFzbspdRr3djlpno5f05EE4FTHwzzxdMRx?= =?utf-8?q?7v7FzRR9ERu+sORXD6Rs+hL72zJJbV6O70/0WqUC4yvXFFLYt/IlH9FfdkLSoyxZl?= =?utf-8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?q?T5TrBAGG9XEVJ/l0HnV8RhE3S8reIhvTzEAuziQGwgkennHqsGYY79PptwobZhIdb?= =?utf-8?q?BhI3lq1YUlV0FNbMSbLoa0zCU9PnwiepsSizLCqdUW5AT39emk4aqYQ4ZzU4mxeYE?= =?utf-8?q?+CKSkK2xCwiXkwXV0k6ciSStZ5Z073d2U7kVjLoex52j6E5KEiJXtbwEHDd/Y0fc2?= =?utf-8?q?bCRUfkcYi4hcuf4mSHx+n5o7bYhC75sKSH4+e0JPJcH3aS1MFpvuxUCPdNixxQY3b?= =?utf-8?q?9seLBlNwsbA+mq5pZ46xbOkRK56gVmuH29p2Lfo8iPwAg/Kqk8Qqjc0ZUdUYU907Q?= =?utf-8?q?LLp1CZ28fR2Cwi+1GDPV7TvZhO/8ik+JhLpsn8WvXrcdNYDY5FrYiMI=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)(376014)(7416014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2025 11:03:44.9557 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87ffd7f7-c1b1-4227-f93a-08dd41e6ee35 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: CO1PEPF000044F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7514 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. The last one adds a documentation entry in drm-uapi.rst. Changes since v6: * Addressed comments from Philipp, Tvrtko, Steven * The commit storing drm_client_id in sched_fence adds an extra field which looks like a duplicate of the owner field. Currently amdgpu uses the owner field with some magic values, so we have to have 2 separate fields for now, but ultimately one could be removed. Similarly storing the drm_client_id in the sched_entity is not really possible as there's nothing preventing a driver to use a sched_entity with multiple drm_file instances. Useful links: - userspace tool using the updated events: https://gitlab.freedesktop.org/tomstdenis/umr/-/merge_requests/37 - v6: https://lists.freedesktop.org/archives/dri-devel/2024-November/477644.html Pierre-Eric Pelloux-Prayer (7): 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/doc: document some tracepoints as uAPI 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/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 | 123 ++++++++++++++---- drivers/gpu/drm/scheduler/sched_entity.c | 8 +- drivers/gpu/drm/scheduler/sched_fence.c | 4 +- drivers/gpu/drm/scheduler/sched_main.c | 8 +- drivers/gpu/drm/v3d/v3d_submit.c | 2 +- drivers/gpu/drm/xe/xe_sched_job.c | 3 +- include/drm/gpu_scheduler.h | 12 +- 28 files changed, 192 insertions(+), 64 deletions(-)