From patchwork Thu Nov 14 10:01:04 2024 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: 13874810 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 2119FD65C69 for ; Thu, 14 Nov 2024 10:01:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 885E610E7CC; Thu, 14 Nov 2024 10:01:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="ZE/j7YOc"; dkim-atps=neutral Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2055.outbound.protection.outlook.com [40.107.94.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6531510E7CC for ; Thu, 14 Nov 2024 10:01:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gM40HjJQLnlniJ5JOpp+N+Uky/w5yeb5lcOWrnL4f87+r8zsxgJKf4SCNaO5Z8sADTi5D5Zr/X3fukCmOY5PoGGlVzIxcMmX/nAbR1hlEl87QcNxsc9cM41PFwk2I+X3wtTzzugU8YnR5s+eY5LMpOW2kGAOhltAkYyNVhi/s85zdm0TlnrthCeDa3A0uKCWxFxcuwuGVX+OJsHhvXuiz/iRqeUKrHyve01Hcgue6ovr98HU/+PLnjSAvyR6j5Y2nH1QdXu472rCzfb/ezDa120sBNNJorEHh8roMVxUaacpoePFSnlMM5m5Z+eGqUhXzLEupmvPYtpazeq9erUn/g== 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=CT7pBok1+LVJy31/Y3uGkr34gtZwA9XZBX7iD2Da99k=; b=nNIrD1U5rvJYEsS6xEuPHF1eKGk9+qVFsedzHP/ghCgyqPDDjGxMN5BFzQlUnSGvHmscDj5tiAhz/hocTnIUM/hSOFVkZD+uSwuSMwQ7UzEeedw0ktp5pz9oB2i8oUUZ41Qj0NqPmzf1aW5hckPmfDqcBIKyYQqDuXdg7b7C+Upj7lOQZmzYHgdDX5kcV3k/oOz14H/ZRVp0/8a9onvRAi8tE1lm+Yol/bNKnlN8KK6PecqSrQjbOVmKTdqgv5m3CjCYPnqGCuqiKYkapW/CXLsoTFlxb0nzump5h8eeeTwQZsHWY7+1UWIGOGm+pPaPNGCATmAlm9ZiVB0je0pOPQ== 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=CT7pBok1+LVJy31/Y3uGkr34gtZwA9XZBX7iD2Da99k=; b=ZE/j7YOcOz4NujLfoszA9K9zGxrtDOPBtxNu0j5igu/8f5LKptUmuFTee8qcDFeZEWXxmn+zLUu7vkpE4wpkPp0dZWMtM/hUVrfK29PjlhDWAgFqtwHqnBC2e+QF3y6qmiBQ/vqRjhfAJYavtGPCpvKNH1lokgc6bQvysND2fVc= Received: from SN6PR01CA0028.prod.exchangelabs.com (2603:10b6:805:b6::41) by MW4PR12MB7384.namprd12.prod.outlook.com (2603:10b6:303:22b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Thu, 14 Nov 2024 10:01:46 +0000 Received: from SA2PEPF000015CD.namprd03.prod.outlook.com (2603:10b6:805:b6:cafe::13) by SN6PR01CA0028.outlook.office365.com (2603:10b6:805:b6::41) 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: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 SA2PEPF000015CD.mail.protection.outlook.com (10.167.241.203) 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:46 +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:38 -0600 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , , , , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v6 1/7] drm/debugfs: output client_id in in drm_clients_info Date: Thu, 14 Nov 2024 11:01:04 +0100 Message-ID: <20241114100113.150647-2-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> References: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> 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: SA2PEPF000015CD:EE_|MW4PR12MB7384:EE_ X-MS-Office365-Filtering-Correlation-Id: 0485cb01-c6ea-44c5-aad2-08dd04935964 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|7416014|82310400026|921020; X-Microsoft-Antispam-Message-Info: 5bOU26PYYqRdBHNv1EFPuwtxx8OXphMtMcsZIOD4jDu8XUUsL+Ri9/mTpcrNGsatY2hQbYNz5XOXcJa8ypPynXNtv4aeUBHZAo3J2rUqSYoS1Y2Sns/d0fLZ0QNCsLPkrKq5+tnwHDoXsK8ZUJ/ZO4Wz/V5OO5O0tj4yHdWfp63qMw2cBsHJ4M0NsMxyPOT5NBwoABnSaoNBGX1PZb3YLJNlu1kdvMtHJkMQTLE3RmmLOF/r6A2gR724X7NQRXUROKVJLAcgbF0LD9NHx9LGNXpl+U22ANijVNBqf4ZS7TpT4wNh8FfhDO4qatObz9A/SQaNU2K6FqIKISx4YK0OIdVjjWU3pK/JzLe4xRcLWCfxjk0LrJda+7xpSfgwsmx+obPS08T1fjddP1jWqjAXekuescUd5a0btRNMm0XjhNf7bmNd0VpqFSJD/whDE4DlIraOmI2mCY1u7rH+PLSOfJ5iHSMYCQjDruK0XiS4dtIZhjnUuxQRnbxqEMylcN2sz5n2YhOA16vaFP041PKA2iz5NnTiPSigK2TIXa0BhhwajIXHCyYjqet4btSqoYHuo/9SKT5qKYqKYNsGoi6rGwX2kgdpHMHuQYwmgtXnao2EHch6h5Zz7ME4B6F6Rya7kgJlfZu4+LUU7jk4lJdZNSb3UkdcYqAEaggXykimljkwlt8p2bTXc7/0jX21/L0HdCXTZIDpHg9Ce0BHwVE3kMQcZ2wNH0Z259BwOKGh4/FJhnJyoZALd6pfmavdKE/2nWWOIDSy8TyhrZpbxtSHve/ATLsPjekYlHsoFe1hu38QPbKP0T7vNQIvvDfVJ3DoBc/kGJXsS2/spS13MyMxGwnWO5N5XOxNPDDr1Ki0HfDOAVQtJpqzlIFJQMswf/Rcxd2+YwxgI/f4XjFkw17w2XJS/lvhLyTAyPlWAoG+wNicRHn6GTd1ZqSUFlPdq4F/cb1WAeyJlFpMHqVE/706guQ02x/YEzYN5DACPrzVzVz3dPoNZhDBfUvi708zN1oGhTuVM6WgWguaGWnwDgvJgZmHXcSPxqHHfj+K+PQjiolw8hx2/AKVlBVGFWIQ2u9AuycD25Bc7nzZn6U0hnUoQmvuhHC46mHJxA0WhEBpy9sWltKPY735c4Dy9lW20ORG5i9BUyzbcj3nCK9FketbZSixVFXvP4vQqgiY+B7A59e+9W4KyOA4pIL8YT/LKuMNnrmvdHRPVtuat4BIl6cNL4ze9XPmBg5UjCVYj6EOU5CsFX1fBM9ZGJ+ZUfA11WG6g6JUIFkLzfo95XPprK4IjKq3BOXViug6fNTnESezg1D+cAeGLdX2zvUuL47GPPYKFSRZUvfBRaiOw30D1by4fDw0jZ8urHccylC0hHR6I7Vt/nWs61bt001aNOOFZ4hBWtDXhB0CzUwrcKh5XLs0l8Olgy4qMu5/M02Z/2MKAfA= 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)(36860700013)(376014)(7416014)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 10:01:46.2170 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0485cb01-c6ea-44c5-aad2-08dd04935964 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: SA2PEPF000015CD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7384 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" client_id is a unique id used by fdinfo. Having it listed in 'clients' output means a userspace application can correlate the fields, eg: given a fdinfo id get the fdinfo name. Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/drm_debugfs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 536409a35df4..4c0bd0cb5480 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -77,14 +77,15 @@ static int drm_clients_info(struct seq_file *m, void *data) kuid_t uid; seq_printf(m, - "%20s %5s %3s master a %5s %10s %*s\n", + "%20s %5s %3s master a %5s %10s %*s %20s\n", "command", "tgid", "dev", "uid", "magic", DRM_CLIENT_NAME_MAX_LEN, - "name"); + "name", + "id"); /* dev->filelist is sorted youngest first, but we want to present * oldest first (i.e. kernel, servers, clients), so walk backwardss. @@ -100,7 +101,7 @@ static int drm_clients_info(struct seq_file *m, void *data) pid = rcu_dereference(priv->pid); task = pid_task(pid, PIDTYPE_TGID); uid = task ? __task_cred(task)->euid : GLOBAL_ROOT_UID; - seq_printf(m, "%20s %5d %3d %c %c %5d %10u %*s\n", + seq_printf(m, "%20s %5d %3d %c %c %5d %10u %*s %20lld\n", task ? task->comm : "", pid_vnr(pid), priv->minor->index, @@ -109,7 +110,8 @@ static int drm_clients_info(struct seq_file *m, void *data) from_kuid_munged(seq_user_ns(m), uid), priv->magic, DRM_CLIENT_NAME_MAX_LEN, - priv->client_name ? priv->client_name : ""); + priv->client_name ? priv->client_name : "", + priv->client_id); rcu_read_unlock(); mutex_unlock(&priv->client_name_lock); } From patchwork Thu Nov 14 10:01:05 2024 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: 13874811 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 37BD4D65C6A for ; Thu, 14 Nov 2024 10:01:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF18510E7CE; Thu, 14 Nov 2024 10:01:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="Mb9OhTsz"; dkim-atps=neutral Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2079.outbound.protection.outlook.com [40.107.93.79]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D9DC10E7CD for ; Thu, 14 Nov 2024 10:01:56 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eSc1n5j8IgHtTrLG+TvlHyACU7UYy4p/KY3cu6+O3yi/urhy3BMvn+iy3BRLPA+qTuCDO8IH+dZquAL5oTZ90Ow6adCeI6fx/XXMCPxrn8I22QcLqTrdy1Wz6v4e9pi6hWWGSv7zByUxseZ4b5GgPG9JD7HQxfGeCs/fwWNsdFHyODJ8pxfGJAIEJls3x4SINhJL7mBlYJGrBT7SyHwKX2d+NWiY/MH9W8nv39LNWqTOQyKCThL5ReGTqYCjx0BlQmM706kSXMjmLsG7rfS3IDuNAr6CTHd4CnVj6vCM8CcYuYzzn9rkKgDfEBmASJ+20CcDCELNZpXOybL+RqJfmg== 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=8637LFeQCzjYVLwj0HcFc5vxwI3DRZpMj3Y4cKiDAq4=; b=xrS97C25esuBVoeI6scQqEdBZQTmmT6nZk5HHtSidOjU8kcAkoGcBpP6kRAQqbdKEGnZm91JT7GRENFaLSW8HVW51m3jHF0YxBx0ZCNQcL6zEoZm7YrgzrQ4qNOMo9yu1e9y8XF0g36tKACVnR/VZNeUbx0BLimtxPHdvupm05EKqvlR+okErjc17PiHvBU+AWRD5WwnU+w8GkuibISEURgItSCSQdC5Id+ahO5LZ9BV2m6e6YFFtQSjdOVaLtNuOq7YGoI0hvkCmwcCdGsRxbrU1kMvXHRJSYdkOIZJfT6XwENsI9RwylEbKbPM4pS4yL2RtRbifWRG6kbszenhaw== 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=8637LFeQCzjYVLwj0HcFc5vxwI3DRZpMj3Y4cKiDAq4=; b=Mb9OhTsz11TUj3kJLoQeFwYmiBZ041oCSjrTvJwNbyM57irOZZulK4TPpeoqEz0iTPV85ZHGWRfIyWtDwq34aiS6+JbZSH4hRFJe88KRg+0qG4hhSmo+LfuR7Kz1LqfsWE9B4FjSkqBJt3YP8SCt0Is4N5XVQ5XKkDr77VV8vvA= Received: from SN6PR05CA0021.namprd05.prod.outlook.com (2603:10b6:805:de::34) by PH8PR12MB7133.namprd12.prod.outlook.com (2603:10b6:510:22e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29; Thu, 14 Nov 2024 10:01:50 +0000 Received: from SA2PEPF000015C6.namprd03.prod.outlook.com (2603:10b6:805:de:cafe::f4) by SN6PR05CA0021.outlook.office365.com (2603:10b6:805:de::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17 via Frontend Transport; Thu, 14 Nov 2024 10:01:50 +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 SA2PEPF000015C6.mail.protection.outlook.com (10.167.241.196) 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:50 +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:44 -0600 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , , , , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v6 2/7] drm/sched: store the drm client_id in drm_sched_fence Date: Thu, 14 Nov 2024 11:01:05 +0100 Message-ID: <20241114100113.150647-3-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> References: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> 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: SA2PEPF000015C6:EE_|PH8PR12MB7133:EE_ X-MS-Office365-Filtering-Correlation-Id: c8daace3-9aaf-48dc-662f-08dd04935c1a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|82310400026|36860700013|1800799024|921020; X-Microsoft-Antispam-Message-Info: Ueg1Jh/ginqy8C92K505dQklYq+CpyF8QRRc+zco/srpcb6NbGxOOuebBHywGoVxWTn5KOlApaBTvCY3ZG0Jlfv6Xfa8VpqPU9LaHahjpU8x5UNNuoJNDPUtg6QeCgOrjbtAWW882pbH3jygficzW4fANp+FzeyXhGgX5O4cop+lxQOPV2prwg752/WIW5P5gr1PShPv5UTQK+ekElEjHfgopyji/wvWopk4gk8vbdisvgkTkylQ44j0unVra+xnuhTecLpeGXi0t8ocQ4HyKqaq2QwuWloGe8mmidtTEzFmRjNsNJx/lFsczYlhyKp7eqydo2K7UYlG8GtfY37kVE9vU/2L9udX3KmWjaxn44M5AuOMdebJWBOQHVHDc3/hGQ/+KXRi++PNomv6QOJXucPOeI7nRLj3kB5sd1hkMaadoLNyryG2oe+E1CtMQ8ocLS7acVy37eD43N6Qxylo6I9cmBE482AuHNMFQzL47u0Zac6RK/FSsP7KFrpuUFMGIFo9YyHBg6QcklITGmes5j8bJRMGd+/wpnUULNE3AAl3pXCWJOLTAs4S2MDfuldiKjCU4VeIQ+stxXg3SFMz7rgUpNy4r1/cl2Ty/39c5Zut31ab3F9n0U3JfD1UxIsGHsODV+EbVh4GbXvEF1jvunv87Z2d8KLrRP+bwp64Or7d0MfnmlTKfEYXdVbMAjHTYn938zPuoRHOJPNSDtUIPVVwdHhWYjQhCwwMEMzgkNnXoiMBo5z5UwcYZg3ICQwtEQSQwILCBhZW3JDHxm5zl5XLvWYTdQ50Dv7OMHKEUdnw8p4XzXQpBtL6AapcPUZYbF8fYDR4YJmuZcPNbUm6HXF/rGoQEdPykiCMUh3oGT8ChZJKV0jnpprJoUYeYHbf5CgD/XBQjZWEfwMRDlgq6XU3D4X14utO4Kn7S/9hw48Rsep/RbX4Zri9GeUca5wSix93Yzb1oQzbvzRZRy6RKK65dUcGo1xTJt4CtmFzYBCD8bFME7x1dazrvMKzqWM+T4AFE9pwE+zKhijjoxtlpgsCtIyHkBnhTKMNCf627TWq1uUVEV3ESgvlQkPnE00ZFtO2Gfi81l8fVMBlo96by8sRfzifF5F45Y5EEHVYdV1BexXvMyNKGd36iASjttWJ3rrDzpjnNxHhAJcxjJeHaDvZoyZjk4ml5XuZ0nyKBapu3xvS42bYJEmzzQEtWNf84/c3aCHjy4IolXjMVqF8d0a0ogXaI3bzkaPBkmXBM6pUKhe6j5DYZ2l4LzzXBu+t697SUJtrs/joJJXSXN5wHIFd/g9mgqGLDuwOeH1Wz29RphjPdSiSteWAcFSWMZY49UU+6dHkKQX2Z7rNQ6qDc6Y/sxp7icHZj0cEPeUy5/1YonfL7D6gUolDliW7NNv6+kZZ4YwY3OTEPLKDt8UKwYVyVXvGCiAPV+IsVnOWsM8= 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)(82310400026)(36860700013)(1800799024)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 10:01:50.7634 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8daace3-9aaf-48dc-662f-08dd04935c1a 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: SA2PEPF000015C6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7133 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" This will be used in a later commit to trace the drm client_id in some of the gpu_scheduler trace events. Signed-off-by: Pierre-Eric Pelloux-Prayer --- 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/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/scheduler/sched_fence.c | 4 +++- drivers/gpu/drm/scheduler/sched_main.c | 6 ++++-- drivers/gpu/drm/v3d/v3d_submit.c | 2 +- drivers/gpu/drm/xe/xe_sched_job.c | 3 ++- include/drm/gpu_scheduler.h | 12 ++++++++++-- 19 files changed, 51 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index b545940e512b..eede43701d51 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c @@ -681,7 +681,7 @@ int amdgpu_amdkfd_submit_ib(struct amdgpu_device *adev, goto err; } - ret = amdgpu_job_alloc(adev, NULL, NULL, NULL, 1, &job); + ret = amdgpu_job_alloc(adev, NULL, NULL, NULL, 1, &job, 0); if (ret) goto err; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 98aa4beee36a..a0a129405323 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -293,7 +293,8 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, for (i = 0; i < p->gang_size; ++i) { ret = amdgpu_job_alloc(p->adev, vm, p->entities[i], vm, - num_ibs[i], &p->jobs[i]); + num_ibs[i], &p->jobs[i], + p->filp->client_id); if (ret) goto free_all_kdata; p->jobs[i]->enforce_isolation = p->adev->enforce_isolation[fpriv->xcp_id]; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index c774cd019a10..1dd8e940d1e9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -186,7 +186,8 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job) int amdgpu_job_alloc(struct amdgpu_device *adev, struct amdgpu_vm *vm, struct drm_sched_entity *entity, void *owner, - unsigned int num_ibs, struct amdgpu_job **job) + unsigned int num_ibs, struct amdgpu_job **job, + uint64_t drm_client_id) { if (num_ibs == 0) return -EINVAL; @@ -209,7 +210,8 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, struct amdgpu_vm *vm, if (!entity) return 0; - return drm_sched_job_init(&(*job)->base, entity, 1, owner); + return drm_sched_job_init(&(*job)->base, entity, 1, owner, + drm_client_id); } int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, @@ -219,7 +221,7 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, { int r; - r = amdgpu_job_alloc(adev, NULL, entity, owner, 1, job); + r = amdgpu_job_alloc(adev, NULL, entity, owner, 1, job, 0); if (r) return r; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h index ce6b9ba967ff..41a03477ba5d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h @@ -90,7 +90,8 @@ static inline struct amdgpu_ring *amdgpu_job_ring(struct amdgpu_job *job) int amdgpu_job_alloc(struct amdgpu_device *adev, struct amdgpu_vm *vm, struct drm_sched_entity *entity, void *owner, - unsigned int num_ibs, struct amdgpu_job **job); + unsigned int num_ibs, struct amdgpu_job **job, + uint64_t drm_client_id); int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, struct drm_sched_entity *entity, void *owner, size_t size, enum amdgpu_ib_pool_type pool_type, diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c index 3d0f8d182506..70294ca6202f 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c @@ -535,7 +535,7 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data, ret = drm_sched_job_init(&submit->sched_job, &ctx->sched_entity[args->pipe], - 1, submit->ctx); + 1, submit->ctx, file->client_id); if (ret) goto err_submit_put; diff --git a/drivers/gpu/drm/imagination/pvr_job.c b/drivers/gpu/drm/imagination/pvr_job.c index 618503a212a7..64152b57e8b1 100644 --- a/drivers/gpu/drm/imagination/pvr_job.c +++ b/drivers/gpu/drm/imagination/pvr_job.c @@ -446,7 +446,7 @@ create_job(struct pvr_device *pvr_dev, if (err) goto err_put_job; - err = pvr_queue_job_init(job); + err = pvr_queue_job_init(job, pvr_file->file->client_id); if (err) goto err_put_job; diff --git a/drivers/gpu/drm/imagination/pvr_queue.c b/drivers/gpu/drm/imagination/pvr_queue.c index c4f08432882b..598180fca141 100644 --- a/drivers/gpu/drm/imagination/pvr_queue.c +++ b/drivers/gpu/drm/imagination/pvr_queue.c @@ -1059,6 +1059,7 @@ static int pvr_queue_cleanup_fw_context(struct pvr_queue *queue) /** * pvr_queue_job_init() - Initialize queue related fields in a pvr_job object. * @job: The job to initialize. + * @drm_client_id: drm_file.client_id submitting the job * * Bind the job to a queue and allocate memory to guarantee pvr_queue_job_arm() * and pvr_queue_job_push() can't fail. We also make sure the context type is @@ -1068,7 +1069,7 @@ static int pvr_queue_cleanup_fw_context(struct pvr_queue *queue) * * 0 on success, or * * An error code if something failed. */ -int pvr_queue_job_init(struct pvr_job *job) +int pvr_queue_job_init(struct pvr_job *job, uint64_t drm_client_id) { /* Fragment jobs need at least one native fence wait on the geometry job fence. */ u32 min_native_dep_count = job->type == DRM_PVR_JOB_TYPE_FRAGMENT ? 1 : 0; @@ -1085,7 +1086,7 @@ int pvr_queue_job_init(struct pvr_job *job) if (!pvr_cccb_cmdseq_can_fit(&queue->cccb, job_cmds_size(job, min_native_dep_count))) return -E2BIG; - err = drm_sched_job_init(&job->base, &queue->entity, 1, THIS_MODULE); + err = drm_sched_job_init(&job->base, &queue->entity, 1, THIS_MODULE, drm_client_id); if (err) return err; diff --git a/drivers/gpu/drm/imagination/pvr_queue.h b/drivers/gpu/drm/imagination/pvr_queue.h index e06ced69302f..bc556169b2cf 100644 --- a/drivers/gpu/drm/imagination/pvr_queue.h +++ b/drivers/gpu/drm/imagination/pvr_queue.h @@ -139,7 +139,7 @@ struct pvr_queue { bool pvr_queue_fence_is_ufo_backed(struct dma_fence *f); -int pvr_queue_job_init(struct pvr_job *job); +int pvr_queue_job_init(struct pvr_job *job, uint64_t drm_client_id); void pvr_queue_job_cleanup(struct pvr_job *job); diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c index 9bb997dbb4b9..f46f961afc56 100644 --- a/drivers/gpu/drm/lima/lima_gem.c +++ b/drivers/gpu/drm/lima/lima_gem.c @@ -341,7 +341,7 @@ int lima_gem_submit(struct drm_file *file, struct lima_submit *submit) err = lima_sched_task_init( submit->task, submit->ctx->context + submit->pipe, - bos, submit->nr_bos, vm); + bos, submit->nr_bos, vm, file->client_id); if (err) goto err_out1; diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c index b40c90e97d7e..84599549661a 100644 --- a/drivers/gpu/drm/lima/lima_sched.c +++ b/drivers/gpu/drm/lima/lima_sched.c @@ -113,7 +113,8 @@ static inline struct lima_sched_pipe *to_lima_pipe(struct drm_gpu_scheduler *sch int lima_sched_task_init(struct lima_sched_task *task, struct lima_sched_context *context, struct lima_bo **bos, int num_bos, - struct lima_vm *vm) + struct lima_vm *vm, + uint64_t drm_client_id) { int err, i; @@ -124,7 +125,8 @@ int lima_sched_task_init(struct lima_sched_task *task, for (i = 0; i < num_bos; i++) drm_gem_object_get(&bos[i]->base.base); - err = drm_sched_job_init(&task->base, &context->base, 1, vm); + err = drm_sched_job_init(&task->base, &context->base, 1, vm, + drm_client_id); if (err) { kfree(task->bos); return err; diff --git a/drivers/gpu/drm/lima/lima_sched.h b/drivers/gpu/drm/lima/lima_sched.h index 85b23ba901d5..4041468586bd 100644 --- a/drivers/gpu/drm/lima/lima_sched.h +++ b/drivers/gpu/drm/lima/lima_sched.h @@ -88,7 +88,8 @@ struct lima_sched_pipe { int lima_sched_task_init(struct lima_sched_task *task, struct lima_sched_context *context, struct lima_bo **bos, int num_bos, - struct lima_vm *vm); + struct lima_vm *vm, + uint64_t drm_client_id); void lima_sched_task_fini(struct lima_sched_task *task); int lima_sched_context_init(struct lima_sched_pipe *pipe, diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index fba78193127d..ceeedd4186ef 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -30,7 +30,7 @@ static struct msm_gem_submit *submit_create(struct drm_device *dev, struct msm_gpu *gpu, struct msm_gpu_submitqueue *queue, uint32_t nr_bos, - uint32_t nr_cmds) + uint32_t nr_cmds, uint64_t drm_client_id) { static atomic_t ident = ATOMIC_INIT(0); struct msm_gem_submit *submit; @@ -54,7 +54,8 @@ static struct msm_gem_submit *submit_create(struct drm_device *dev, return ERR_PTR(ret); } - ret = drm_sched_job_init(&submit->base, queue->entity, 1, queue); + ret = drm_sched_job_init(&submit->base, queue->entity, 1, queue, + drm_client_id); if (ret) { kfree(submit->hw_fence); kfree(submit); @@ -702,7 +703,8 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, } } - submit = submit_create(dev, gpu, queue, args->nr_bos, args->nr_cmds); + submit = submit_create(dev, gpu, queue, args->nr_bos, args->nr_cmds, + file->client_id); if (IS_ERR(submit)) { ret = PTR_ERR(submit); goto out_post_unlock; diff --git a/drivers/gpu/drm/nouveau/nouveau_sched.c b/drivers/gpu/drm/nouveau/nouveau_sched.c index 4412f2711fb5..ebc31adea39a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sched.c +++ b/drivers/gpu/drm/nouveau/nouveau_sched.c @@ -87,7 +87,8 @@ nouveau_job_init(struct nouveau_job *job, } ret = drm_sched_job_init(&job->base, &sched->entity, - args->credits, NULL); + args->credits, NULL, + job->file_priv->client_id); if (ret) goto err_free_chains; diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 04d615df5259..a8135bd75cae 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -312,7 +312,7 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data, ret = drm_sched_job_init(&job->base, &file_priv->sched_entity[slot], - 1, NULL); + 1, NULL, file->client_id); if (ret) goto out_put_job; diff --git a/drivers/gpu/drm/scheduler/sched_fence.c b/drivers/gpu/drm/scheduler/sched_fence.c index 0f35f009b9d3..909b886cd379 100644 --- a/drivers/gpu/drm/scheduler/sched_fence.c +++ b/drivers/gpu/drm/scheduler/sched_fence.c @@ -204,7 +204,8 @@ struct drm_sched_fence *to_drm_sched_fence(struct dma_fence *f) EXPORT_SYMBOL(to_drm_sched_fence); struct drm_sched_fence *drm_sched_fence_alloc(struct drm_sched_entity *entity, - void *owner) + void *owner, + uint64_t drm_client_id) { struct drm_sched_fence *fence = NULL; @@ -213,6 +214,7 @@ struct drm_sched_fence *drm_sched_fence_alloc(struct drm_sched_entity *entity, return NULL; fence->owner = owner; + fence->drm_client_id = drm_client_id; spin_lock_init(&fence->lock); return fence; diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 7ce25281c74c..28ac709750e9 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -776,6 +776,7 @@ EXPORT_SYMBOL(drm_sched_resubmit_jobs); * @credits: the number of credits this job contributes to the schedulers * credit limit * @owner: job owner for debugging + * @drm_client_id: drm_file.client_id of the owner * * Refer to drm_sched_entity_push_job() documentation * for locking considerations. @@ -796,7 +797,8 @@ EXPORT_SYMBOL(drm_sched_resubmit_jobs); */ int drm_sched_job_init(struct drm_sched_job *job, struct drm_sched_entity *entity, - u32 credits, void *owner) + u32 credits, void *owner, + uint64_t drm_client_id) { if (!entity->rq) { /* This will most likely be followed by missing frames @@ -822,7 +824,7 @@ int drm_sched_job_init(struct drm_sched_job *job, job->entity = entity; job->credits = credits; - job->s_fence = drm_sched_fence_alloc(entity, owner); + job->s_fence = drm_sched_fence_alloc(entity, owner, drm_client_id); if (!job->s_fence) return -ENOMEM; diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm/v3d/v3d_submit.c index d607aa9c4ec2..a086da31f441 100644 --- a/drivers/gpu/drm/v3d/v3d_submit.c +++ b/drivers/gpu/drm/v3d/v3d_submit.c @@ -168,7 +168,7 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv, job->file = file_priv; ret = drm_sched_job_init(&job->base, &v3d_priv->sched_entity[queue], - 1, v3d_priv); + 1, v3d_priv, file_priv->client_id); if (ret) return ret; diff --git a/drivers/gpu/drm/xe/xe_sched_job.c b/drivers/gpu/drm/xe/xe_sched_job.c index eeccc1c318ae..6617555e7a51 100644 --- a/drivers/gpu/drm/xe/xe_sched_job.c +++ b/drivers/gpu/drm/xe/xe_sched_job.c @@ -113,7 +113,8 @@ struct xe_sched_job *xe_sched_job_create(struct xe_exec_queue *q, kref_init(&job->refcount); xe_exec_queue_get(job->q); - err = drm_sched_job_init(&job->drm, q->entity, 1, NULL); + err = drm_sched_job_init(&job->drm, q->entity, 1, NULL, + q->xef->drm->client_id); if (err) goto err_free; diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 95e17504e46a..42c381449443 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -311,6 +311,13 @@ struct drm_sched_fence { * @owner: job owner for debugging */ void *owner; + + /** + * @drm_client_id: + * + * The client_id of the drm_file who owned the job. + */ + uint64_t drm_client_id; }; struct drm_sched_fence *to_drm_sched_fence(struct dma_fence *f); @@ -563,7 +570,8 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, void drm_sched_fini(struct drm_gpu_scheduler *sched); int drm_sched_job_init(struct drm_sched_job *job, struct drm_sched_entity *entity, - u32 credits, void *owner); + u32 credits, void *owner, + uint64_t drm_client_id); void drm_sched_job_arm(struct drm_sched_job *job); int drm_sched_job_add_dependency(struct drm_sched_job *job, struct dma_fence *fence); @@ -624,7 +632,7 @@ bool drm_sched_entity_is_ready(struct drm_sched_entity *entity); int drm_sched_entity_error(struct drm_sched_entity *entity); struct drm_sched_fence *drm_sched_fence_alloc( - struct drm_sched_entity *s_entity, void *owner); + struct drm_sched_entity *s_entity, void *owner, uint64_t drm_client_id); void drm_sched_fence_init(struct drm_sched_fence *fence, struct drm_sched_entity *entity); void drm_sched_fence_free(struct drm_sched_fence *fence); From patchwork Thu Nov 14 10:01:06 2024 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: 13874812 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 3B93ED65C68 for ; Thu, 14 Nov 2024 10:02:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B32A610E7D0; Thu, 14 Nov 2024 10:02:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="pCUMduTL"; dkim-atps=neutral Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2042.outbound.protection.outlook.com [40.107.223.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id E341310E7CD for ; Thu, 14 Nov 2024 10:01:59 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VIqgf2q++bDfEKkEkiNjUvuuCPOHmRKsSyF9OImJyrZX+kkozXsZwfuPVqV9N8R3hf4KUHKnsRkLQUG+ftLon7+KFaxUz/xnwNYXxfz1ggwEg9zhuBxz+fQfroByGYrpUOoZOzKGsz1RHE2/kXCS1tOqLxJm2DYSWezl7CTJSab6loXsUY1fDVncAzB3MBaTs3Usy5RqZeTmoTg57A7MZndBZoM7DgHl/VT5zYK1pcwTMxXHykdgCIQ2xqzJMfDCPiYtzkbmvOM9OCq0+l4hQqb/h/NtetET/xqubuJnIXVvwCMKrmM3GHPGfqRIl8i43s4JdnVq7SoO1k8OFyD/jw== 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=mqbtxBEpnmsCpJS4X5VKJq9FMfpmtcyBL6OHT75UPcs=; b=K+FfDybB3Z1vsAEx3Zz4hsHLYbgLDzWUZ/lW9MXr6KWHMsFjTTN2OIP2yov6mJ0gyTcRGjgNUy4vbda5Ka5AnHaJar9oxKlxaR4Mw1bodMogM6qeYGTYRZLBZ7lVEUEColMw/OzuNEp5KiWcC5CFqnPcE/26VOnsufZakr0Lz+LfLevl1nGiIyEURqGpgEramY2p0jc92FhP9wHr27QxyoLJToZ+CeppxXUS7EfWr8/a15a8rWLw8EJd7ZNvBZ6syH1rAjCs1Vwv6yHqioHHm9+nYEYa93I9y8+7EjHQK0YZhTPnBqZ1RzEB4vmOR7jhQWsCksKCcANl+JJWoFrL0g== 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=mqbtxBEpnmsCpJS4X5VKJq9FMfpmtcyBL6OHT75UPcs=; b=pCUMduTLyr/Xa1OhccH6LiBCs7+mAtgSV3SlEBNFabGxC+4tlcJSwfm1EKekRwzRrx9jiRolrMB1934iIWTrwBJsvMuHX8pk96FMkpBFwaoeO75rn1m+YsTTKGCEt/hinwG0xbhCYLA0WJpo34FbHj5VvSlJRvepPbfzN6Uofzg= Received: from SA1PR03CA0001.namprd03.prod.outlook.com (2603:10b6:806:2d3::12) by SN7PR12MB7323.namprd12.prod.outlook.com (2603:10b6:806:29a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Thu, 14 Nov 2024 10:01:57 +0000 Received: from SA2PEPF000015CC.namprd03.prod.outlook.com (2603:10b6:806:2d3:cafe::12) by SA1PR03CA0001.outlook.office365.com (2603:10b6:806:2d3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17 via Frontend Transport; Thu, 14 Nov 2024 10:01:57 +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 SA2PEPF000015CC.mail.protection.outlook.com (10.167.241.202) 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:56 +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:50 -0600 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , , , , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v6 3/7] drm/sched: add device name to the drm_sched_process_job event Date: Thu, 14 Nov 2024 11:01:06 +0100 Message-ID: <20241114100113.150647-4-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> References: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> 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: SA2PEPF000015CC:EE_|SN7PR12MB7323:EE_ X-MS-Office365-Filtering-Correlation-Id: 25e134e8-1a70-4cbd-7c25-08dd04935f80 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|7416014|1800799024|376014|82310400026|921020; X-Microsoft-Antispam-Message-Info: DenPFGQqvcRI1VRg7Fbu5BUq+R6NbT/jHyrnNj5E+YtpTvPkNgGMSNMWuQPAR1j9JVeB/vbKPQvG5WDNlidfVio02m2b1enXl/Lx5P3ozUBnD7SRBFUWBi8v3YcA0Cu3sMX/dBW2lLwJYt/R4UHx/N+gnSllK2gAxTspa1CGXdu5JbHH5cEiMO5OC1d/LoxrrxkhFcy+Seh1+02A/a7r8M+QDUyM0MiE+xZsQdW8/2QyfzBhrpFB55oJpe8mrjpxE4PifSiL9QmxHH6ydTFvaerMktKl3lBeOZc+xJtKUvIGah2GsvodusxRkTGi/RsKS0k161oUSWcopHyjRLKuaV9YVnkSRblHjYX3YcqKEbSca35cgDy8DpNvJlWv4leG6XNaWJegOduv13h6f7M3IGItv+ux5mDLUvIo+BLyoaJ6SOw+SaNOjAmpYDctlBJVGYwx+kk7iRH6I5Qa+26A0ZtaEf4rE640VbTImwdXPIlStfpZg80N7e6xrlcDxnb1N2aeojmLfW0ipaOmRxKLR/VPFfVD/llWX29cfhjBapXRVVuWuHAynxW7wEnJIdNLEJjoD0X6Q+PGWkQOUs60CKYD8+3GLBv0JDgdVUEAil0azeOrfQEVUF5/NFSLvrcNPLJ4p9vAZXHR657fvK8MP5WNHtrhxP3Kj4aRREFbKzbBPsj0yjMB/UXOibfq+uwyDGYQUxVTVYaxjKN0Cc1s7ZX0Jfd7S+5lnYdr7UKKeDBeYyyUTPfu9LGcG+mg9PGO1VBtYV1SvunHs9bUnh6rm/Dtkzc90/ysPYM4QSAVA8248yQog0cGEsNx6mh62FUj+mNhbm4CxMlmDNo0pQJKcanrDNnZHaJ46GJCRXl9FkF8HwJuNVp+Es3+CORJmhJknVP0dCyWPHVFp5rv9QN6LhB7T03nzyfQbKRykOm1KHYLU41YnIn1wv5/RG6o8MdgxzH3dOmVWttm0UPkAlzNZF5E+0huKAe7/460L+khkZjzEaBuU6sf7NuT6rlw1XZwJZDKau46ATRR/xKGHQh4euv8e7oE/96TFJWZxCXQPEYo06GXTSj0sBjQcvmk9u1CLWskUUSbSOiC8xnsonc37KBud8FqlkBi+HWnWqCya0MXc+GfYmgLprKPbWamAOXGxSxWBPNaa3DLfI0m99GoFVEQmeSpjd6q/u83L8U7VeTlPTBr67mgmaoBtWPIsIq/Qy/uJr1sOWN97l9bkLAGM98Z58XQhUEATn4ieBvwsAAqlrCypHkhoLRar//w1B7YYT5M+4Fd6/YjYlmR+lwby8PZNju0gbw9PZ/y9urGfb7ueg0MshN0asLKowk5UU2XVhRxZ37211uWTGPYxsGHtukVIyQ+nOAh7MwtF+eLBHNV+6GfipprKLx1Tettojvx4XJgCmkD2VkF8PdlatVus4f2PTKT3ckM4AvIXVnEJWk= 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)(7416014)(1800799024)(376014)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 10:01:56.4656 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25e134e8-1a70-4cbd-7c25-08dd04935f80 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: SA2PEPF000015CC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7323 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" Until the switch from kthread to workqueue, a userspace application could determine the source device from the pid of the thread sending the event. With workqueues this is not possible anymore, so the event needs to contain the dev_name() to identify the device. Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/scheduler/gpu_scheduler_trace.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h index c75302ca3427..c4ec28540656 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h +++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h @@ -42,6 +42,7 @@ DECLARE_EVENT_CLASS(drm_sched_job, __field(uint64_t, id) __field(u32, job_count) __field(int, hw_job_count) + __string(dev, dev_name(sched_job->sched->dev)) ), TP_fast_assign( @@ -52,9 +53,10 @@ DECLARE_EVENT_CLASS(drm_sched_job, __entry->job_count = spsc_queue_count(&entity->job_queue); __entry->hw_job_count = atomic_read( &sched_job->sched->credit_count); + __assign_str(dev); ), - TP_printk("entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d", - __entry->entity, __entry->id, + TP_printk("dev=%s, entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d", + __get_str(dev), __entry->entity, __entry->id, __entry->fence, __get_str(name), __entry->job_count, __entry->hw_job_count) ); From patchwork Thu Nov 14 10:01:07 2024 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: 13874813 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 30926D65C68 for ; Thu, 14 Nov 2024 10:02:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AAF5810E7CF; Thu, 14 Nov 2024 10:02:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="Ysz3rM00"; dkim-atps=neutral Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2070.outbound.protection.outlook.com [40.107.223.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id 457C110E7CF for ; Thu, 14 Nov 2024 10:02:08 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N55rMY3quoYmt5m76sP+8BTasXU639SujvkutUoF1KNX2YmBmPkTlWVnz0LrLaCgEaq6L9Z/n464mcEhd+ac1hnkH53z2ugKmGerJWrt3FGhDnM3Ee8r8mlEQGZWjbK5YlNjZi4597vKTAH4nZp/fayzxckMHlSZ8EZOGz3Gjnj4nJgacCGjcue12mEsBwe3I8aRD2GQJGsn+nbe1RZO4DZygJARkFQ7Zp3NiZU28HP8gEFHGP/sVfU7Fpd/OwMdg2LdKqLw8C+hW9lUEJPKx+Jrm7YDwW2kXMPYY8FmyD0JeXxxX50nImyW4oQ/ddoQ7/u4jDVK4NEJtfl29Gx+OQ== 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=xm15NrbvwV/HfM1vkvYivOfevE7KGpn2AuMZ4DKTkLU=; b=HArcT4NK9zVxo3AgUPgq/kXLpfbyT6h/pbVDH5WdPk+oVn9i0f46HtNnIN969VFZ6cwqRDdO2h+Msin++pije8tjVMHoiN/QG/XNFPOrkCskHM9m867nMIMflXRe+wN5KpcbSs0S807ItBhFfY6G0evzfwGU3eeaCTAzMKz2e8dwbo0PaSC+0+67g1hmCwDQOVYGaDJT5QSxEWme4LrWL9OFDbVurALKPV+rsTBseq6mzcJeIxHp34AxCezpfD3D7bzUmdIV0sRoaYg3b+iPuNsEY4JUNeHz2Qz7P+97is1eMwit+y/Lyg/Na67aXw7//c39yE1uT2pPYa59VfAWOg== 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=xm15NrbvwV/HfM1vkvYivOfevE7KGpn2AuMZ4DKTkLU=; b=Ysz3rM00OGBnp0j2GE8JuKWqA83tU7xpPHA7fq1BrwbvlNnxJPQBsg3iGB0aISQB3QbVb1LJGyYlpt37KGeoBIDWgQsavjsvDWZQO8ytV2tO+3zKvBR771t0wFI13OFVrG5p+tRMZjrafSzzJVneGNVj5DZvi2Tn7+Z7jyuMF8c= Received: from SN6PR05CA0020.namprd05.prod.outlook.com (2603:10b6:805:de::33) by DS0PR12MB6488.namprd12.prod.outlook.com (2603:10b6:8:c3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Thu, 14 Nov 2024 10:02:04 +0000 Received: from SA2PEPF000015C6.namprd03.prod.outlook.com (2603:10b6:805:de:cafe::f5) by SN6PR05CA0020.outlook.office365.com (2603:10b6:805:de::33) 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:02:04 +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 SA2PEPF000015C6.mail.protection.outlook.com (10.167.241.196) 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:02:04 +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:56 -0600 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , , , , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v6 4/7] drm/sched: cleanup gpu_scheduler trace events Date: Thu, 14 Nov 2024 11:01:07 +0100 Message-ID: <20241114100113.150647-5-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> References: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> 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: SA2PEPF000015C6:EE_|DS0PR12MB6488:EE_ X-MS-Office365-Filtering-Correlation-Id: 14a46569-23ed-4748-a72b-08dd04936453 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026|7416014|921020; X-Microsoft-Antispam-Message-Info: wZQJFw/IfTNm11Xby2SwyfRSANV6FJeucmuZpINTZGD8NE8L/GdA7TwzSjL3DcNWTJ59DD6rJCWA6QN1om3abVikC1qSscnG2fkn8BCJhk8EZzV67eP8epVerf6aQ89cf8H1lcMR9Zv5Op9LvCoqk4FeXyeTlfOCq1c8FQSIK7M2QHvpRiyfBJ8a35eH4TLb2wmZWF5toHtV2ImPyA/NuLXVll7g1vbzXU4cCZN1ITVbkyezNEhYl5TkjZBax7GGYrYEDBmgPQEf7v2GJXatB7lPxZARanBLLaijZ01QY+Wzc5UOMrAtTgipiyQDIpn42eC1tRnwIDNd0RQtsIwatNTI3gPmk7WsmdkxXLU282q2CP5fH5W3Fcv/YH7Go3JNI8Vh9DHMYI1AMmbOuzOXWAef1QjTIwcaH1GeB4lnejs6BqF9ytplk0LiTvDlP9ja21Dg431T6j7DTWEzQuzZym2NdE2PLmj7/RjgGWf01S5/AR+nXD46OP26t0+aASILM8ZxK5Dr0DRD3TcqmaJLXweTIPmTkLnJIsLYrxnei2bjNrsksQBl5ptdgCzwVZIDHo03a5sYyfEpvK9NAc6b1oKpVM4zmqlP9ysuTS/cOMdiPBX9suwnBNmDn96BMAC262DEphdDJ5G7yvE0z5p/y/AKgIdnDKKYuS00zC5f67Wh0wgRdGw+y8vUIq94WaQmLvaTjF4gUHzxXxtgZ8dJMkTRdEr4HWOprvv0S7Iu1GT6+huGWHLRSJXXrDWvNxYByPrQLWi43XH9N03rHn7xencuqntoxXKnBXmZ+nqnhjyx8uTrxpGs/XEc3aUWn6GnRPaBUZ4rAAf2iPWi2cE5jewwfiZ8JLK3Tkn6XV+3G1rGkaFASFecWiTwzPpw25734vntjD3FJEQDzGp/116ZyfAKs/ezp5SHcUb5inPpMW19cejw2ayTcOq/ljl4RvZD5phpASYrBPZivddvkLE3xXvuGRtUvmJ+My+UtGjAyGjwl0ySl2SP+DMtsTluxz4GWZLK55uOYvFDMnSOA9swJ/D2ZUxKJj7xu9Ixs7gBFgEgsJD/x1QIQfahRueNnaMdxd3qjk4rNa3TWJYYBZUq6AsAq/sTM6H8u/Igqdq6xEImbFFrRX86GEOxPFWE4K6D9k5eMiyNI23wlrra/49wUKzLj0SezOg4SuXrKoE/DRehPsKW6snxA8d2SLchAp/BpFMKRVfjYxxy2SPPhnHsGcoFpWt5O65Nbj7SysOmk/BFO2i3KxIn+ewDxNbmnjxB14zMEx1IBOOA9y7M2iSLnvb+pWkQKGCXgYofkuYtoNDXsGPinPKKlo+5TxJHNd7+dlYQfo6jNcDfrPCjJRcTMgTOrvOu/uojHkvWwXwVrhfc31wcfHP4zL1kTUAT/61V1RxtpWTKx9M+LbqoNQ3hybc3Uq4/NLFb0dXC6f8lJbw= 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)(376014)(36860700013)(82310400026)(7416014)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 10:02:04.5604 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14a46569-23ed-4748-a72b-08dd04936453 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: SA2PEPF000015C6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6488 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" A fence uniquely identify a job, so this commits updates the places where a kernel pointer was used as an identifier by: "fence=(context:%llu, seqno:%lld)" Signed-off-by: Pierre-Eric Pelloux-Prayer --- .../gpu/drm/scheduler/gpu_scheduler_trace.h | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h index c4ec28540656..24358c4d5bbe 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h +++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h @@ -36,28 +36,29 @@ DECLARE_EVENT_CLASS(drm_sched_job, TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity), TP_ARGS(sched_job, entity), TP_STRUCT__entry( - __field(struct drm_sched_entity *, entity) - __field(struct dma_fence *, fence) __string(name, sched_job->sched->name) __field(uint64_t, id) __field(u32, job_count) __field(int, hw_job_count) __string(dev, dev_name(sched_job->sched->dev)) + __field(uint64_t, fence_context) + __field(uint64_t, fence_seqno) ), TP_fast_assign( - __entry->entity = entity; __entry->id = sched_job->id; - __entry->fence = &sched_job->s_fence->finished; __assign_str(name); __entry->job_count = spsc_queue_count(&entity->job_queue); __entry->hw_job_count = atomic_read( &sched_job->sched->credit_count); __assign_str(dev); + __entry->fence_context = sched_job->s_fence->finished.context; + __entry->fence_seqno = sched_job->s_fence->finished.seqno; + ), - TP_printk("dev=%s, entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d", - __get_str(dev), __entry->entity, __entry->id, - __entry->fence, __get_str(name), + TP_printk("dev=%s, id=%llu, fence=(context:%llu, seqno:%lld), ring=%s, job count:%u, hw job count:%d", + __get_str(dev), __entry->id, + __entry->fence_context, __entry->fence_seqno, __get_str(name), __entry->job_count, __entry->hw_job_count) ); @@ -75,37 +76,41 @@ TRACE_EVENT(drm_sched_process_job, TP_PROTO(struct drm_sched_fence *fence), TP_ARGS(fence), TP_STRUCT__entry( - __field(struct dma_fence *, fence) + __field(uint64_t, fence_context) + __field(uint64_t, fence_seqno) ), TP_fast_assign( - __entry->fence = &fence->finished; + __entry->fence_context = fence->finished.context; + __entry->fence_seqno = fence->finished.seqno; ), - TP_printk("fence=%p signaled", __entry->fence) + TP_printk("fence=(context:%llu, seqno:%lld) signaled", + __entry->fence_context, __entry->fence_seqno) ); TRACE_EVENT(drm_sched_job_wait_dep, TP_PROTO(struct drm_sched_job *sched_job, struct dma_fence *fence), TP_ARGS(sched_job, fence), TP_STRUCT__entry( - __string(name, sched_job->sched->name) + __field(uint64_t, fence_context) + __field(uint64_t, fence_seqno) __field(uint64_t, id) __field(struct dma_fence *, fence) __field(uint64_t, ctx) - __field(unsigned, seqno) + __field(uint64_t, seqno) ), TP_fast_assign( - __assign_str(name); + __entry->fence_context = sched_job->s_fence->finished.context; + __entry->fence_seqno = sched_job->s_fence->finished.seqno; __entry->id = sched_job->id; __entry->fence = fence; __entry->ctx = fence->context; __entry->seqno = fence->seqno; ), - TP_printk("job ring=%s, id=%llu, depends fence=%p, context=%llu, seq=%u", - __get_str(name), __entry->id, - __entry->fence, __entry->ctx, - __entry->seqno) + TP_printk("fence=(context:%llu, seqno:%lld), id=%llu, dependencies:{(context:%llu, seqno:%lld)}", + __entry->fence_context, __entry->fence_seqno, __entry->id, + __entry->ctx, __entry->seqno) ); #endif From patchwork Thu Nov 14 10:01:08 2024 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: 13874814 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 B81D4D65C69 for ; Thu, 14 Nov 2024 10:02:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3AE0C10E7D2; Thu, 14 Nov 2024 10:02:12 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="U0UnRNlq"; dkim-atps=neutral Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2072.outbound.protection.outlook.com [40.107.95.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id D729410E7D2 for ; Thu, 14 Nov 2024 10:02:11 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SVStTZ53nVeetGIkNyFKF25rGs35GPRchmz+Mwk28VHR3xzVeyiSJIP2xhblfHevkPaB2BZFfpFka5+9nDlPoeHIEzrnpY+sumUkoRh1t1aEe/v76DtR6kR7j1cCphQmihfSYKEctG2WrJPekOinxlJ/Po/YEQ5RwdINxP7AXQFlXMWbCS3wwrKhQuXeUF0Ip5ifPIBoc8tdJYE7kvP8blIEIg5G105DBgyQ8uNazNnTSGHqxvQyOazjXBBcwXI93IgKOSkO52XtgrrywpzVKpiSmZuwCsU/IEVWD8KdEN90BlTwFqLJCjKX5AqxSI1kZyVCvGP1N4eQEsyFNQtrag== 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=S4pwm5+dqhTv59KRJipnrsHZ5l+CFQaRPZcomd9/XNA=; b=YSaUteKvSKEOx0Jr5nv7a5Yr+HCZIIaS2fMkPkxVtanZhm0LyriKamzcVM53Jjk/MPfakvGj2DxuYlkiV0m0ALsF+e5GM47aqoIKxGYfTsec2s0OfAxfnvyWgf1hhFbfBOYRwr+WO3DA4VwkdQujXKBuZMf+SxuOpSDqdDxpnIiiReoy7yduLTS+9594bkiG/hiiL3K8SNX8nfiNHvbc+JTh9HG8F1K+eWTQ3QIxHAWSwllSBjlXEJ42KWyUB7ftJ9hMm6tbNCgE6Z6iiyZXVDSXSeAZcSfY7c77U9qMWdkuTE1VDt3CppghXR0DfJRbnE+drz6L7SZEZdxFvrdIPQ== 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=S4pwm5+dqhTv59KRJipnrsHZ5l+CFQaRPZcomd9/XNA=; b=U0UnRNlq6jEX4hp/0jtljz+1tisYL1ggymMYRYLO31p704fJ5xwXZ9cVdQAiM6SRmcNCRNqTxGRvVMrqEWM+jQxDaKhQfTgdn/gYuciaFF3p0CI2HlqKa2Th1qukCls/l+CUpPoaQkRlGvo0BCV8RPRvWSHLTkyEiwtO53j+Eic= Received: from SN6PR05CA0013.namprd05.prod.outlook.com (2603:10b6:805:de::26) by PH7PR12MB9202.namprd12.prod.outlook.com (2603:10b6:510:2ef::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.31; Thu, 14 Nov 2024 10:02:09 +0000 Received: from SA2PEPF000015C6.namprd03.prod.outlook.com (2603:10b6:805:de:cafe::69) by SN6PR05CA0013.outlook.office365.com (2603:10b6:805:de::26) 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:02:09 +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 SA2PEPF000015C6.mail.protection.outlook.com (10.167.241.196) 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:02:09 +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:02:01 -0600 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , , , , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v6 5/7] drm/sched: trace dependencies for gpu jobs Date: Thu, 14 Nov 2024 11:01:08 +0100 Message-ID: <20241114100113.150647-6-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> References: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> 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: SA2PEPF000015C6:EE_|PH7PR12MB9202:EE_ X-MS-Office365-Filtering-Correlation-Id: 88b9ed5c-bd01-46ab-87be-08dd0493671c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|7416014|36860700013|82310400026|921020; X-Microsoft-Antispam-Message-Info: 2jxZDRlqGdGJ8TxMrlLNOFeMF3n4RfPAGCd1cnbEE4mPM/vkRxCMF/riI8Zn2d1YGMegiHFJQn4tLzKbr30fzIJeD1nGf3AGkCBXmytttJvXhusJgVkvRzmUBEGrQ20bDy4tLdlnfe+MWPEQAnoUAznsyuh/rh2/zJUzZm+ygeS4Y+lfACTd0ctkBGm4aPWe9FE5yR6NWSNa/nDvw6GAbj22naax3hk7Ajwx9d4HUtXWUEnVwFKh0HQoHezy6xU0ZZblEcUShJCOn287+pq0nMLMO7ET5ahMsjIF+4Vtt37KhBuWv6178N4RAKe8CvGkA7s0skVTI7ru042q5eH3DTfGNo99cpEZDGsIwfGytFOAeqGBSrT9uIj3E7g5lj7S7cScotf2PnkzJom8kliVenyUFIamaMjc8mnheMXCH8zkblQaJoIFqE0PC2FYN/GJAwJ90GUXeAG5a/6R7hcbhV0f93f1DsO/LlF7IYr8qewIpl+0luMaAoSlbp6EYFi02h66mImYve1Uh6RqkM0AOI1hbsFr0t333916NS1fE+tUPINmgrqKK6d7OJNq4jGlPtKLu5jb2wucMOg2f8AISX0/XgNVrtzCSb/ROhv6wxucdKarjzIcQOAj7J1OlJFEVR5a6XCDbovlydyj5OFa3N5Bv4FIJGqhAem95iz83wVUodqnVx6eMwTS/BPRz89k+lclM+7iVh7Usxr2xTtCYjpkfpBpqCU80PyoK9Xw5EC0QPhLnCMLbcJkrRsOj9+iDSIxcU3u9RBfxT1FRNnpxQ+zxwRwojRhoXXOnNis5Dr/J9shqRljOddzcGJ8o1yGPGlorV8X3yMiz8ZDP0upykzfFYbTloEr4lViD/wYIQYN/MjRoYEd7X7vS8IQHuNzM8SnAXziiZy3VRLrMJJJSMZ/f62Wy4Jhv7iLTtnp12qECCGsxbwHktHXBQPMPZqGq00ooo3NwUPUncB+3mI/riEfYv3+CqyVFnuPVCm6pmLHWkQNTz6blawqGWusMe0u5atJ9ILB6HKP4ogTWxJOQFqdHPrBeQhWvoYQRoJQB00HaHXBXsuUKmYEBIEMgBJ/EyeNq8V4UFV59SGL3yp+tUa75KBg0JuTKxSo63peWUofdn/g632IHaF7cbSUB0ywIF+C7ti9l+cZpThpXzqHeRcZlm7tpLwwEAUyN0VmVfwBEywaaWNyXoey7H4gRjI6uWfrqXF9WfUsa6vub1/g+K3Mm7RxVsxFXFbA+Zszyv20/ErePL+wcHVBKjDar7RlJPwIGQ1UhPqr7Yta7g0SD4HMq7+1c+YFpls/himVkxoefGgRLmbIBSr9GNEmvP0guHQHYwsKxT400GiaZC03NYLr822UdCG+vl1dbYaxhEqijJqv6bbTcxK0H+hZkA5io+9t9WQl+WX1gEJHWSkOIWW+5rKfNHv5rGFgU59aWLM= 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)(376014)(7416014)(36860700013)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 10:02:09.2323 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88b9ed5c-bd01-46ab-87be-08dd0493671c 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: SA2PEPF000015C6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9202 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" Trace the fence dependencies similarly to how we print fences: ... , dependencies:{(context:606, seqno:38006)} This allows tools to analyze the dependencies between the jobs (previously it was only possible for fences traced by drm_sched_job_wait_dep). Since drm_sched_job and drm_run_job use the same base event class, the caller of trace_drm_run_job have to pass a dep_count of 0 (which is ignored because dependencies are only considered at submit time). Signed-off-by: Pierre-Eric Pelloux-Prayer --- .../gpu/drm/scheduler/gpu_scheduler_trace.h | 59 ++++++++++++++++--- drivers/gpu/drm/scheduler/sched_entity.c | 8 ++- drivers/gpu/drm/scheduler/sched_main.c | 2 +- 3 files changed, 58 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h index 24358c4d5bbe..67696f5e1331 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h +++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h @@ -26,15 +26,41 @@ #include #include +#include #include #undef TRACE_SYSTEM #define TRACE_SYSTEM gpu_scheduler #define TRACE_INCLUDE_FILE gpu_scheduler_trace +#ifndef __TRACE_EVENT_GPU_SCHEDULER_PRINT_FN +#define __TRACE_EVENT_GPU_SCHEDULER_PRINT_FN +/* Similar to trace_print_array_seq but for fences. */ +static inline const char *__print_dma_fence_array(struct trace_seq *p, const void *buf, int count) +{ + const char *ret = trace_seq_buffer_ptr(p); + u64 *fences = (u64 *) buf; + const char *prefix = ""; + + trace_seq_putc(p, '{'); + for (int i = 0; i < count; i++) { + u64 context = fences[2 * i], seqno = fences[2 * i + 1]; + + trace_seq_printf(p, "%s(context:%llu, seqno:%lld)", + prefix, context, seqno); + prefix = ","; + } + trace_seq_putc(p, '}'); + trace_seq_putc(p, 0); + + return ret; +} +#endif + DECLARE_EVENT_CLASS(drm_sched_job, - TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity), - TP_ARGS(sched_job, entity), + TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity, + unsigned int dep_count), + TP_ARGS(sched_job, entity, dep_count), TP_STRUCT__entry( __string(name, sched_job->sched->name) __field(uint64_t, id) @@ -43,9 +69,14 @@ DECLARE_EVENT_CLASS(drm_sched_job, __string(dev, dev_name(sched_job->sched->dev)) __field(uint64_t, fence_context) __field(uint64_t, fence_seqno) + __field(int, n_deps) + __dynamic_array(u64, deps, dep_count * 2) ), TP_fast_assign( + unsigned long idx; + struct dma_fence *fence; + u64 *dyn_arr; __entry->id = sched_job->id; __assign_str(name); __entry->job_count = spsc_queue_count(&entity->job_queue); @@ -54,22 +85,32 @@ DECLARE_EVENT_CLASS(drm_sched_job, __assign_str(dev); __entry->fence_context = sched_job->s_fence->finished.context; __entry->fence_seqno = sched_job->s_fence->finished.seqno; - + __entry->n_deps = dep_count; + if (dep_count) { + dyn_arr = __get_dynamic_array(deps); + xa_for_each(&sched_job->dependencies, idx, fence) { + dyn_arr[2 * idx] = fence->context; + dyn_arr[2 * idx + 1] = fence->seqno; + } + } ), - TP_printk("dev=%s, id=%llu, fence=(context:%llu, seqno:%lld), ring=%s, job count:%u, hw job count:%d", + TP_printk("dev=%s, id=%llu, fence=(context:%llu, seqno:%lld), ring=%s, job count:%u, hw job count:%d, dependencies:%s", __get_str(dev), __entry->id, __entry->fence_context, __entry->fence_seqno, __get_str(name), - __entry->job_count, __entry->hw_job_count) + __entry->job_count, __entry->hw_job_count, + __print_dma_fence_array(p, __get_dynamic_array(deps), __entry->n_deps)) ); DEFINE_EVENT(drm_sched_job, drm_sched_job, - TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity), - TP_ARGS(sched_job, entity) + TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity, + unsigned int dep_count), + TP_ARGS(sched_job, entity, dep_count) ); DEFINE_EVENT(drm_sched_job, drm_run_job, - TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity), - TP_ARGS(sched_job, entity) + TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity, + unsigned int dep_count), + TP_ARGS(sched_job, entity, 0) ); TRACE_EVENT(drm_sched_process_job, diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c index 69bcf0e99d57..0ce3a82fe6fd 100644 --- a/drivers/gpu/drm/scheduler/sched_entity.c +++ b/drivers/gpu/drm/scheduler/sched_entity.c @@ -592,7 +592,13 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job) bool first; ktime_t submit_ts; - trace_drm_sched_job(sched_job, entity); + if (trace_drm_sched_job_enabled()) { + unsigned long index, n = 0; + void *f; + + xa_for_each(&sched_job->dependencies, index, f) { n++; } + trace_drm_sched_job(sched_job, entity, n); + } atomic_inc(entity->rq->sched->score); WRITE_ONCE(entity->last_user, current->group_leader); diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 28ac709750e9..56fdf6879506 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -1214,7 +1214,7 @@ static void drm_sched_run_job_work(struct work_struct *w) atomic_add(sched_job->credits, &sched->credit_count); drm_sched_job_begin(sched_job); - trace_drm_run_job(sched_job, entity); + trace_drm_run_job(sched_job, entity, 0); fence = sched->ops->run_job(sched_job); complete_all(&entity->entity_idle); drm_sched_fence_scheduled(s_fence, fence); From patchwork Thu Nov 14 10:01:09 2024 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: 13874815 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 9E98FD65C68 for ; Thu, 14 Nov 2024 10:02:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 251F210E7D4; Thu, 14 Nov 2024 10:02:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="tEdVRIr4"; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2077.outbound.protection.outlook.com [40.107.244.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id D51F610E7E3 for ; Thu, 14 Nov 2024 10:02:18 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Npb4Vqp4lDeGa3DanBJPHeaWx8zSryvA179Ggz1IXOaIWMDSE4uncahB2WJyX8GHqu46mMv6dSxIdeMbCLVTG5/NbtskBhCPSO7PcfLIjx+QgFU1Xbdm9VW7cb20TY40sEawXM+3qaVDTbPg2uS2bJnqBVVnfqLJXHFqzzbU0PatNZk2HRrdKGJUK8BxfZzbF6Wp6nT/kM5eaafq/jfNbYTSTZj4Usu0ooYVoUWHcz51krER6BTnI/q0vxD7j6EP60W7OHff9L+LkSj5bJEKePgnYaLqmN6WRowivnkCjn/Zw+fQHVsrFMnHyB9gTmoX/E8KkN6VFztfgH+X8CkQzQ== 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=Qt5i3oj8stGipp7Pv2R5c4lpJd0jiua3CfasWK0oG4g=; b=dlHDgPORJwMU2/TdUE73vSmLPGjMRo0WUGfWqgIy2V0fIsu57zpmyeOPzGU+dfhMj4TMzkS4EYrvBuoh4OPAk/0P447iDbiZmrrDcQpH98tpiDtbV/WoIj9ws2PhH7Q9aOYhDzR3fP+yn5aM2+MNSkd0JV1RBjyt98tCC4Q4Wk64mA5c5YyoRWYIjJBbUFEsIPZ8cySuivCQSg+n0Yy6Kn8svkZlIF/RPjgWAfLkLYLAPqIjJe/aMJeMi9+8tCWR8YC10g+CShDvI6Nm49iFLIA3MJqzqo0BhdZYu73z8IeuqlyfsOatYDihV8B3SCvYysvgVZVVqhl70VDew0sVKg== 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=Qt5i3oj8stGipp7Pv2R5c4lpJd0jiua3CfasWK0oG4g=; b=tEdVRIr4t4UB6gj8GxgwEhqrTqbWwce2KOXl3yAh0p7M9Xvyvf/3qY5UWANTXi38B0xGmsHXM+fOHrZ9Scv4a1rX5aa12f8mrPxLfIJuPLMrHTRHVvFxObbkraNVLkuzYjmhdLSkjnRNq9H+urgDHfpjzfp+Vz86RO0NGvoUCb8= Received: from SN6PR05CA0020.namprd05.prod.outlook.com (2603:10b6:805:de::33) by SN7PR12MB6960.namprd12.prod.outlook.com (2603:10b6:806:260::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.18; Thu, 14 Nov 2024 10:02:13 +0000 Received: from SA2PEPF000015C6.namprd03.prod.outlook.com (2603:10b6:805:de:cafe::1a) by SN6PR05CA0020.outlook.office365.com (2603:10b6:805:de::33) 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:02:13 +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 SA2PEPF000015C6.mail.protection.outlook.com (10.167.241.196) 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:02:13 +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:02:07 -0600 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , , , , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v6 6/7] drm/sched: add the drm_client_id to the drm_sched_run/exec_job events Date: Thu, 14 Nov 2024 11:01:09 +0100 Message-ID: <20241114100113.150647-7-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> References: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> 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: SA2PEPF000015C6:EE_|SN7PR12MB6960:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d15d28d-53bf-48d3-30f6-08dd0493698d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|82310400026|36860700013|1800799024|921020; X-Microsoft-Antispam-Message-Info: jzzdZ2/KbrgeIT0DowW2bNgMmGKnrZ7VnuoUPKmK3/6+/D3p1xImEdavvvV0ckNEAulurXElO65rP96MZKpx9b45B2RzvFnOkPhvHXhTo1RZoeq3TbyS8zf1JKnCcEwyYMiO7QqF628HrtyLy/lKDxxLECDMOLBYawbm0C/pW1PKY1YKVS5SQGlZ2pC9LOlc2C0GwLCHTQ4mvtqb5nQ+RBnubpINyBopVkCMJ1ftl5Xr6YUkQVSHD4yQGQM2nqY8isKy9ngjl+ibsKZZAMOrLyd5wv81LjB/PcwNeh64VQP4f26Gry/rgB81RXYy9yTSPvohO3eyWCZGsNDDY4bCF69xcDkCJC4ZnCom5VfYEUJwpa1PVshfOncByxUVrmd2iwa4Yfy50S8pHDCUwK4Q1F6XXZfEQ1h62/qrl8T7w1dNbBGjcgN6P4kerZSt+t0I1/7e0FdRgzu9jjFaia4cRyUP3vTR4LKwJrfRT8qDhtNkF1XAeTBbzJ4+7RRW1Ebw/7PF8Ln8OcHcwtedXPnqeAbcyrB3a/us0ssaQRn6RqqDrOvLbX683Al1iQ7IHhLhBTG56k1PXFmkwOat0HNrxcFI06sw+Jyu1xmz2ChDRPlEoNs+4aAYErH8EPwGAZHc71eGxJ7gfyllAuGPmfERR9ySy8bBTRSDORNtmEZ7Ig9srZw5vUCO6xXsDbMhptXHHqHce2gfpxIdy9dmWvMGmvleqKIRYBoy3ZDIfmbYs9aD9ojcSSkP+YPhWEDK7NhskstANWxkybR32BT6UAxA96otknwRgB8h7CdNfLuTvSMRD4bCnhNBvpoMNdTp6STbpZSac1lfXAidG5uJ2QkNugC6ZJSKX1jeXncQQHLUioJizKherWVAQjqNJwm6DsYi8bRTyqOum+i3K36Ywk/I0AQyHPBeKQXKSNjbK1sDTUE1AK6nevA0YkjfpEUpRn5KhAZYsICExuYCpgXmSX8nsH/omh0SIWqeoShM8dYOTgzPlnmfESdYTczwnyx2r42/wNFOkghL7m8VZdhgYbSQPPsApCP5FP4NFZXxzp3gFJLS9LHtvl4DPJm1iR+RBddD+zaVSTGHKe8coaEydr41BhPZ86ibxeCsORFHzfRWz7QGKGnq6jHruY9kqw6i/FRTzore7LP9jgrwzkJA9aRaAJPUTQzmnYAsMnc/2DxvpEy5AvHixcdgevHqzxw9GmmUqlVaN2yT4N6rmFzl+ZWGhItBAz1metb4D3ZxZMNqZBi3Hynk5g+CeXFKno7OBc9NsX7EJ7uMahJ1Yx5juQO1j5e8iThLQXMT2TjxkPC+ndhBga8+I4lEq2jetzqpjF4EC8YegdCWyTX0feADIc5GD96j3Nbw2a6NHe6Gtg/xj4pyOWb6NRKtmLF3N73W9LEVuqrElptphshm7ZFb7XtCSqxbvvwQyd+3eR82rWwWxmE= 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)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 10:02:13.3261 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d15d28d-53bf-48d3-30f6-08dd0493698d 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: SA2PEPF000015C6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6960 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" For processes with multiple drm_file instances, the drm_client_id is the only way to map jobs back to their unique owner. It's even more useful if drm client_name is set, because now a tool can map jobs to the client name instead of only having access to the process name. Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/scheduler/gpu_scheduler_trace.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h index 67696f5e1331..8340c7c0c6b6 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h +++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h @@ -71,6 +71,7 @@ DECLARE_EVENT_CLASS(drm_sched_job, __field(uint64_t, fence_seqno) __field(int, n_deps) __dynamic_array(u64, deps, dep_count * 2) + __field(u64, client_id) ), TP_fast_assign( @@ -93,12 +94,14 @@ DECLARE_EVENT_CLASS(drm_sched_job, dyn_arr[2 * idx + 1] = fence->seqno; } } + __entry->client_id = sched_job->s_fence->drm_client_id; ), - TP_printk("dev=%s, id=%llu, fence=(context:%llu, seqno:%lld), ring=%s, job count:%u, hw job count:%d, dependencies:%s", + TP_printk("dev=%s, id=%llu, fence=(context:%llu, seqno:%lld), ring=%s, job count:%u, hw job count:%d, dependencies:%s, client_id:%lld", __get_str(dev), __entry->id, __entry->fence_context, __entry->fence_seqno, __get_str(name), __entry->job_count, __entry->hw_job_count, - __print_dma_fence_array(p, __get_dynamic_array(deps), __entry->n_deps)) + __print_dma_fence_array(p, __get_dynamic_array(deps), __entry->n_deps), + __entry->client_id) ); DEFINE_EVENT(drm_sched_job, drm_sched_job, From patchwork Thu Nov 14 10:01:10 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: 13874816 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 708ADD65C69 for ; Thu, 14 Nov 2024 10:02:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EB6BB10E7D5; Thu, 14 Nov 2024 10:02:27 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="XS/wBEr+"; dkim-atps=neutral Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6918910E7D5 for ; Thu, 14 Nov 2024 10:02:26 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RwfsT1vzRIVJetujCmcP7Jk1aLzbY8hdRjRoMEO8RCDRkVpe2OPA4Puq5CaDcne41+SvDLXoEW6ryhmaj4UWpo4PS238Lm9Tpl+agM+1dAMuZ2tGQYkVZWCaKq86bMuauAWPGEgYCq6UKnkD3t7PMtEhIza05KQ6RQI1UVLVHLzSktdhPRxMj/IAq5xkfq7mPMA5IEeS3ifqoVpp4RTVgWzuIpKQiW34gwsJDxM05F6ILU79maLZw0kxO+151WhLR9wyevkUBNYKYiB1derxVGlBsQtDrhuMxNUGoT0NO8Ncl27y4QGXVoO0fwcHMOKd/TnvvA2NRChFBHOLm0aziA== 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=OHqlky2jJQBywqgURDkMuYDgeTAwtLcJqs5bODDYwhg=; b=fnoBsz2WEZVzuTXUcSY36u1zpnvw0ew69IZUC5NtPYgkwHiv5mNk+rr7A/ruBSL+i7lV3zrTzME65SewnFBFvDjbIoeyYcz4tUWveqnwZQuXeZ/DR3Ak9r5nyMFPfC9jtt1cY50npIW+SPbmd/FgAS4tSzYewpAVJmwSxQPpMDTLEYNBhS9tKUI/vV+DCrpPbkuLxhUj9VE8rmTSRYE1v7QA7MM0Z4LpFD8dDheEEa2LqWIpWrn4k9ovxBU3qPnpsWn4Q40snXwYRAfNCLpb7sLPUw5oVoK54RIK4Erk2m9OJs/GO1XHAyJLL4D/Zktay9ofHdEO6ZDhsjFkQk1uwA== 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=OHqlky2jJQBywqgURDkMuYDgeTAwtLcJqs5bODDYwhg=; b=XS/wBEr+m5TCAIOJmM61ov/EOqwkRD1NzfdWScIBzhJnwbpwvbxgCo6xsd8Oik9D7rse3fs+nRBzk8jciycOCOw8j/vgmKFXWzMfpIuCzaZ00ZbIxs4b9jmye9R8SgSmYXcWa/ut4vhMXSokJY22qi1/EMbFr4ex9LHPTqPT/Ig= Received: from SN7PR04CA0063.namprd04.prod.outlook.com (2603:10b6:806:121::8) by DM4PR12MB6280.namprd12.prod.outlook.com (2603:10b6:8:a2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.18; Thu, 14 Nov 2024 10:02:19 +0000 Received: from SA2PEPF000015C8.namprd03.prod.outlook.com (2603:10b6:806:121:cafe::f2) by SN7PR04CA0063.outlook.office365.com (2603:10b6:806:121::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17 via Frontend Transport; Thu, 14 Nov 2024 10:02:18 +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 SA2PEPF000015C8.mail.protection.outlook.com (10.167.241.198) 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:02:18 +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:02:13 -0600 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , , , , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v6 7/7] drm/doc: document some tracepoints as uAPI Date: Thu, 14 Nov 2024 11:01:10 +0100 Message-ID: <20241114100113.150647-8-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> References: <20241114100113.150647-1-pierre-eric.pelloux-prayer@amd.com> 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: SA2PEPF000015C8:EE_|DM4PR12MB6280:EE_ X-MS-Office365-Filtering-Correlation-Id: 08fdad9f-cf7b-4f9d-cc8d-08dd04936cc9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|7416014|376014|82310400026|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?leFfY1rVvllU6zKM2ljm2Aw3YOUgbHx?= =?utf-8?q?Hbx38LlXWs7A01rQRUMWsBl4pqvdCucwYBC15B66bVaXinl08xLcVN7xaaYj56Ghq?= =?utf-8?q?N9hkDSR7G8tcuNg+lk7sW7c7WIdsy7UZxsidJu7bfeBhlBXIg/VdUAGM4sYNBFjBE?= =?utf-8?q?zxdo2t/hWlHZfQnfMY+qsRWqajHCyw7tpxl36e253TRSJKZGklOV3S3kD2eqUYd2h?= =?utf-8?q?9PvGI+nhy4RnaTb9pZtGofT9DEhfb13BimnCwGn7Co4Qu0sP1v7GCHILSv6t19USv?= =?utf-8?q?V1UVLEGigCKqZhZggjML0PSIb+kEaN4C8u8MvSUD2eUwB6ZoZNyXgdG0WCTtytRAs?= =?utf-8?q?nAUY308lq/TMb22AvDgzOQ7YFHm8OnmbcaLxXgvQphDvFRL3IsInk4o8+MmTdfOOY?= =?utf-8?q?cGxo6QsVbc3dIBuLQXJCulqTsSgKWpk83/HIb6ulLkJ5jZWXP5O6nib/ia0YRY0PD?= =?utf-8?q?3uWMY/ILNHPzswznfNSJ/zWETX0xTVssEQ8/qCgGlpWGLsogvEYsDYNkTLnAINkNF?= =?utf-8?q?sb0cmK1v10pLFm14hL+n7lRxlBy9GfqC3584A5lB5H77iS3XieQpUcHkXKnnLinz0?= =?utf-8?q?ncnHn2oO0VTlWgrkp+GNUd3zbqjr/JFIsgW8iMQzaBXvghMkbDMUl9KwYFHZ5E2vg?= =?utf-8?q?v/Qxyd4dMDp2kS1ybKTH4upugL3jkYfQRuxlSjJwgKsa9gc8+HRmZCOV3ZQI0JQNj?= =?utf-8?q?yZ7UhRjKGvhzu2VIwIg5FvmAukKEnhkB6WPJmNwvlU1FD9n1tCXCkTC54a3ZY2VpU?= =?utf-8?q?qM674qq8h94LRRT/X7OMg6hbGDe8qvQdcMxvIXPVlSr4rk9uC45AeH70icJEDzoak?= =?utf-8?q?OjXiwkeyIL+smICZHxJ2fL1fBXBTB6uSSBMaNtC7xkKS9YfWOn1VhgmhsrsSe4Bbn?= =?utf-8?q?9NYzs+z0ykBJoU4lOBVq+2MqRQ6HePxj4B6EwbqvIUVrjASUoYwBPsjKJQUdKwdEX?= =?utf-8?q?hbzaooqE4TlZmZ/mBt/p0AL7xxqaZRrmEN/tj+655fhEsUn6/k7GFPHXioOZEdDd+?= =?utf-8?q?eL/croyHO35+tflM8npa8ioeokrSy0ePJ/FKR9mbtJUm//iZgt9CNEbB/5rX57CLy?= =?utf-8?q?NKc/l5XMpBg4JyZqQgA9R83ZRFORo9rfRtjihxwZEUqlSN9K2Da5U/r9jK1nwA8ZI?= =?utf-8?q?EqhYU2uiYSTOVdTIObC1NxBwqtnHl1X0OA2fKXdeurtoc/Z+kAKgCzk+P8zjjhdFZ?= =?utf-8?q?gHp+U2PW9kvowVD4ajytGfE6lEBrvp9tAJoqeL2uTn8JEhCMnySsIFuQm17Wrj4l+?= =?utf-8?q?3MdkiJ9nqd2Gj5RprxllGBA+lzqlf2C1L4fV5ctVfsPUYJqaras9ZUqc2BD4vQHr5?= =?utf-8?q?HwSFNTZkntO+X2tK+e6SkK+6YII8FslCb6Y63/0DGu65lLDIvjiqvtU=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)(7416014)(376014)(82310400026)(36860700013)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 10:02:18.7565 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08fdad9f-cf7b-4f9d-cc8d-08dd04936cc9 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: SA2PEPF000015C8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6280 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" This commit adds a document section in drm-uapi.rst about tracepoints, and mark the events gpu_scheduler_trace.h as stable uAPI. The goal is to explicitly state that tools can rely on the fields, formats and semantics of these events. Acked-by: Lucas Stach Acked-by: MaĆ­ra Canal Signed-off-by: Pierre-Eric Pelloux-Prayer --- Documentation/gpu/drm-uapi.rst | 19 ++++++++++++++++ .../gpu/drm/scheduler/gpu_scheduler_trace.h | 22 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst index b75cc9a70d1f..9603ac0f4c09 100644 --- a/Documentation/gpu/drm-uapi.rst +++ b/Documentation/gpu/drm-uapi.rst @@ -583,3 +583,22 @@ dma-buf interoperability Please see Documentation/userspace-api/dma-buf-alloc-exchange.rst for information on how dma-buf is integrated and exposed within DRM. + + +Trace events +============ + +See Documentation/trace/tracepoints.rst for information about using +Linux Kernel Tracepoints. +In the DRM subsystem, some events are considered stable uAPI to avoid +breaking tools (e.g.: GPUVis, umr) relying on them. Stable means that fields +cannot be removed, nor their formatting updated. Adding new fields is +possible, under the normal uAPI requirements. + +Stable uAPI events +------------------ + +From ``drivers/gpu/drm/scheduler/gpu_scheduler_trace.h`` + +.. kernel-doc:: drivers/gpu/drm/scheduler/gpu_scheduler_trace.h + :doc: uAPI trace events \ No newline at end of file diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h index 8340c7c0c6b6..ec230e558961 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h +++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h @@ -33,6 +33,28 @@ #define TRACE_SYSTEM gpu_scheduler #define TRACE_INCLUDE_FILE gpu_scheduler_trace + +/** + * DOC: uAPI trace events + * + * ``drm_sched_job``, ``drm_run_job``, ``drm_sched_process_job``, + * and ``drm_sched_job_wait_dep`` are considered stable uAPI. + * + * Common trace events attributes: + * + * * ``id`` - this is &drm_sched_job->id. It uniquely idenfies a job + * inside a &struct drm_gpu_scheduler. + * + * * ``dev`` - the dev_name() of the device running the job. + * + * * ``ring`` - the hardware ring running the job. Together with ``dev`` it + * uniquely identifies where the job is going to be executed. + * + * * ``fence`` - the &dma_fence.context and the &dma_fence.seqno of + * &drm_sched_fence.finished + * + */ + #ifndef __TRACE_EVENT_GPU_SCHEDULER_PRINT_FN #define __TRACE_EVENT_GPU_SCHEDULER_PRINT_FN /* Similar to trace_print_array_seq but for fences. */