From patchwork Thu Nov 14 10:01:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Eric Pelloux-Prayer X-Patchwork-Id: 13874809 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 88C2AD65C69 for ; Thu, 14 Nov 2024 10:01:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0398A10E7C9; Thu, 14 Nov 2024 10:01:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="mPlmNzcM"; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2061.outbound.protection.outlook.com [40.107.244.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 67FD710E7C9 for ; Thu, 14 Nov 2024 10:01:43 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oPPsRfzWN5PziSkJAA5HVbQ4qsIulTF6vybVFqRvOUGsY1swQuhl7YnTMo3dmu2jQrtXC9GS2wn5gZGZecQb7hWXM91U6CqHEUhwXeimQdJuIKtJGnaPb2zdw2xD32geUcjHhzP3rDUgyA9sKdrulroWJ/7+1It5C+FoDwlgXY2OekhCJhaw8nwqn6nt9svK67MnpcRXowe85Tnjpogptxt/CigCm4V9aFhxPRHX5Xu1wX2m0XOUNR2O/nDieqzKyhjq7+0iq1Mlx+0J1tHyMdozkCiYGCajZ9tP93Oxt+tlxbKpWD5NMHy7ySB8VeRZhQnjNJy6rVXqJnRLhN88aQ== 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=gjzXDpxYOqIvLecheoRvT7gV4zYnqS5q+qGXgJoODPw=; b=PP/e60Ln0AR0gShQlwJdV1W39VAwbzLJat0MObgilqZSqVsrb18rVhagBbXi99biGLGR22fBb3l/f1Sod8YO/8Y4gc2H9JocDj/QdOMOVqz2JAGGKr/V4NSJsA1Rqm1gmmbPu51BEq74TQAYFrgueCXPIKcPsNKocTg8XbiW8jrqNCebuJU/HA8V3ikNcs8Udhu3LveJPt/CfCnPhZ1pUNS6hsWa3d7rLCP3pkyUhBclVU2zhX/D1DFiF/ptf9Zhc/MFWpCZSnxPd91k0sDMoBv109PCW+WVkoEzrI5h701ZDIM4pONz/hjRkeHKU+mFty9DVSSKCvtIWwyoBnH/5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.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=gjzXDpxYOqIvLecheoRvT7gV4zYnqS5q+qGXgJoODPw=; b=mPlmNzcM/k7wfxnF/aqUjN12XSh6/DHkd9tcMo5pUzd3UArFZkfgaKgTXtctlmImvjfst2c1HodYn2x2+vY8BJlnEuOYeccVj4CehDN6Vy/M0N6Ul+NMnFqesS8/86McizluN489rxHt93TKuMGX8Ri4JWDAphXsJXGL63vMyYM= Received: from SA9PR03CA0010.namprd03.prod.outlook.com (2603:10b6:806:20::15) by BY5PR12MB4082.namprd12.prod.outlook.com (2603:10b6:a03:212::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17; Thu, 14 Nov 2024 10:01:38 +0000 Received: from SA2PEPF000015CB.namprd03.prod.outlook.com (2603:10b6:806:20:cafe::4) by SA9PR03CA0010.outlook.office365.com (2603:10b6:806:20::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.16 via Frontend Transport; Thu, 14 Nov 2024 10:01:38 +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 SA2PEPF000015CB.mail.protection.outlook.com (10.167.241.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Thu, 14 Nov 2024 10:01:38 +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; Thu, 14 Nov 2024 04:01:32 -0600 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , , , , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v6 0/7] Improve gpu_scheduler trace events + uAPI Date: Thu, 14 Nov 2024 11:01:03 +0100 Message-ID: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: SA2PEPF000015CB:EE_|BY5PR12MB4082:EE_ X-MS-Office365-Filtering-Correlation-Id: 45f2199d-282e-46ab-6a41-08dd049354a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|1800799024|82310400026|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?tf0blRmhnteo2/iZwPCGbqAPmwy9MOm?= =?utf-8?q?p3OWgQiQQbw6D9RAMPJJPDjQJSrvVKKc4hzDuVcFWb18DJ6WN9D7S7pecU5dp9STM?= =?utf-8?q?juy7EIex8VMqZAR7p1YIqooTb1f8/C8nmVtJAw0zAVhHXysi50JoePwnuDCN8R62C?= =?utf-8?q?8NSaz5oVL+KAvr+TKidPW4TZcoDLZQRR89CdNpkVUjVtG7OOw+GlQ37iuLUPrWHzr?= =?utf-8?q?ztyVaAlzsXj4C7ofQhkQbyEy+k40W0rauXyTZxpU0ZMtzjrXxawSGYABNcPI/xRzp?= =?utf-8?q?gw4UD6xAVuVC17TUmtBMh0pXlh7h8Fb8IKhVhYNLc4r+BQes2esBcpnOfQt61PZR8?= =?utf-8?q?Z3tpUGl/q7Xx/4zHs9NtxwlP/d5xsQAF1kuktDDM4JG8o4uN1wKZwPtijhPoTCtpg?= =?utf-8?q?lDJJCjaTnR5/+URnGALrGOsxDnNuBWTR3LZZeunUenz3GXukZ+roy5j7UZJu4+CuP?= =?utf-8?q?J9PUY8KbhnAHWWiCokwCnir9qgehb3v+J4M7p76eHdZzCCYR6iyR6ZXw0XFchAb48?= =?utf-8?q?5G7wtPfJBSq20qz3IWYznLDoFvC5yHnA8PLZ4DL56lQ72UGCXhEqqBQ7/TZf3ZdTZ?= =?utf-8?q?CBcN5ahLbktOtdrhBSK+KRqSLnYqUF/tdag1kxZxNfE3FKhGMzxX57ghXBa5nDQOg?= =?utf-8?q?LZ7k8sbDJ0Iq0s/pKPCWDbFRy31JKHDp/6d/A1m3nzR5zmsuh4oWPAVLqn2FuAiR9?= =?utf-8?q?i0vTxVeSOsZrlFfPJGgOC5IuJH73j9Z1Q+o8GBDkuavXaUWR39pSHXVgFpkl74Ff0?= =?utf-8?q?bv/zEjaXMRS/mRm6nkJsLB987oopAuHLi786i1hRZ0w4b4Vn5ch0hVPIzyDnOoSEC?= =?utf-8?q?TT9bUgww88x05wqRLWxIrIF4E/XUzmMetlgKqyR1dyp/XessdhNfl3/vCCimbx+EA?= =?utf-8?q?JSmQQmhYE9wmiIYqmgMGxVTBRUika4ih0xy9eJYbv1AVTieTE0E4GlIZy2N4f6Pjj?= =?utf-8?q?KPNyfYQVM87dueeH0GQ9P394ifWjrdMn7tn+BRUke7CTXB4i7EQ45JszRp5w+vKwi?= =?utf-8?q?y/Om2SfPopDDSy3ChHz4JtHXSycW5YA9Tzhho/A+qiq+yVyMnC/k4679r+yPPNKJI?= =?utf-8?q?/WaH7G0zwedx7h9UmELYMKdVJ5CFtqjA4bltlqOVHFlDei9DmugwNSLwdA0hs6REb?= =?utf-8?q?zMF5h1TP5K3dP8nYfPBI4Ut9oXdmHX3RArzlFBaZzllaMW6LpkYVeL3q9aJ26+iD8?= =?utf-8?q?+vFznhx8BPspwyx+hl98NZkMI9JjGUVpYxovkLS6wvWznocGnvEQxRG7NVfLei6YW?= =?utf-8?q?k4J1jzeMxWDkLFzKyRZzogo52BPgD1pY9k9v2/2pISEExr9OdUVUeZEstIh6nxtb2?= =?utf-8?q?62ZzrRam1SHX?= 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)(7416014)(376014)(1800799024)(82310400026)(36860700013)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 10:01:38.2109 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45f2199d-282e-46ab-6a41-08dd049354a1 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: SA2PEPF000015CB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4082 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 v5: * Addressed Christian, MaĆ­ra and Lucas' comments. * Added patch 1, 2, 6 to include drm_client_id to the events. This is required when a single app uses multiple fds for the same device. * Validated that the patches don't break gpuvis Useful links: - userspace tool using the updated events: https://gitlab.freedesktop.org/tomstdenis/umr/-/merge_requests/37 - v5: https://lists.freedesktop.org/archives/dri-devel/2024-June/457827.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/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 +- .../gpu/drm/scheduler/gpu_scheduler_trace.h | 121 ++++++++++++++---- 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 +- 23 files changed, 181 insertions(+), 57 deletions(-)