From patchwork Mon Jun 10 13:26:54 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: 13691997 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 7CCBFC27C55 for ; Mon, 10 Jun 2024 13:28:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BEE3610E26D; Mon, 10 Jun 2024 13:28:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="dGFbeu1O"; dkim-atps=neutral Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2075.outbound.protection.outlook.com [40.107.94.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9DD3410E26D for ; Mon, 10 Jun 2024 13:27:56 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aPThnPHXiyD4rQTP9LXCdNmFP4CcoEdY4bqrJLR3R9Ep1D/UAm/tqyejITEaVsMSGo3w9mvpMqrW+wlLErSQb676kVwwKg4HkUh5WMbRlgh7jH8jtO12VaV1OkTmEPp/En6h1XbaK0zhzm3slkOLEomroMyyFTNeSEQoHsYXUwKUJubbE+8iGtDw0SPaGnPrdfaQFjsVf+/jUx/JDfaeRufqugLJE59yXOBSkHLqsznbWVAT18/I0cE3T2B0wmSTqt3rNc+2dTdiS7csQx/PuWMUnZmW3SP3lH6xyjbMuZiF8aGn+DXLXKr1q1N4iQmyeYYaS8UttD9TadCsfO+cwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=R5jjL2nkC/J+3hwvcjLHk4K7DLKJJXc/Lfbemc4YRqc=; b=Ky2z1ljqnrYB6YExhtD6DHkhAhKCHwDmPUpBzKe68RU0Tsz71BkHMfO93GN3xwyvSEreNHL4/eEYgYmkdKbXEUZDd2M7wjquyF2ZAj943Uop1K+xdNPNeT/q++c7Y7nKtioTyJOj9uKtUyk2ouKMfaaLxyJ4WZ/9ogCkAViZwS0ibvQRvP9t9u2rcBd9OTTRY/b17soZDAv1CuAXZo73fcvllGNu7/XlqYJGNBFIiOYaVtWwF2YyYbskjo6fJXTJ/+XL1alhYKoWaYPERm113sxvph7qyTYrCKAhCDakMqpW+LoTELo1yeHnQCcmPhqk4RAQsLhgREcPkjFbiW8hFQ== 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=R5jjL2nkC/J+3hwvcjLHk4K7DLKJJXc/Lfbemc4YRqc=; b=dGFbeu1O7veCtAs+VlUwQt1Mt3htYCRAlDaheN0fMpgCtxvTLmh3jtmB3X2UvPdbx8BJvqTFfA8kZq9OVI382kK6WMCqOJSwytHPo8V+rnNvp7IsSF39UZEg/cDBuP3BOxcd9JbadcUp/qQ+oasQ2Vl69FsxMy5n+56cpx8tVBo= Received: from BN7PR02CA0033.namprd02.prod.outlook.com (2603:10b6:408:20::46) by PH7PR12MB7938.namprd12.prod.outlook.com (2603:10b6:510:276::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Mon, 10 Jun 2024 13:27:54 +0000 Received: from BN1PEPF00004688.namprd05.prod.outlook.com (2603:10b6:408:20:cafe::7f) by BN7PR02CA0033.outlook.office365.com (2603:10b6:408:20::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.25 via Frontend Transport; Mon, 10 Jun 2024 13:27:54 +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 BN1PEPF00004688.mail.protection.outlook.com (10.167.243.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Mon, 10 Jun 2024 13:27:53 +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; Mon, 10 Jun 2024 08:27:50 -0500 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v4 1/3] drm/sched: add device name to the drm_sched_process_job event Date: Mon, 10 Jun 2024 15:26:54 +0200 Message-ID: <20240610132707.61404-2-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240610132707.61404-1-pierre-eric.pelloux-prayer@amd.com> References: <20240610132707.61404-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: BN1PEPF00004688:EE_|PH7PR12MB7938:EE_ X-MS-Office365-Filtering-Correlation-Id: 03c1bda4-a7d8-47d8-58e8-08dc89512240 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|376005|82310400017|7416005|1800799015|921011; X-Microsoft-Antispam-Message-Info: gl0TerqKJw0oKYLFDMNaEI+8/oRCcrYZuu5Hlw5eMcEf8SUZ6k6xUq5uV6wubuN+AnbGOtmnjYNcGVH8eNZerNxRQYL6+TqXLB1foW0yuCcmRxJmqM0LIIqrtnP+2TYghia6aAxKLGbgir6wb4eLvyQWQgHDBvrNWbm6m5KL9Wgpc72qHIaYM9FQa9kfD98Igbz0qvV8fDJJj1EKsHVvCqGOnm0uPsyeyV5NaqfFWs0dhgejc2pazWPdsZ46hqMNVZY0ON2d9sVZDRzZ5pgx/3RABKV3qvGOtKHHZo774uOEyuTa7PFkoYvxgD0qA1T3dMSvOeay5qIC1ugodOBrSyVyXGHwH9Rj0a6wlVwP/x4LKW40+wYyWnNkXJ9KPQcGvtZh44iVTsVrTNYM4D8I7nJXYfRsBY3jyEMN03ViwzHVgCpFGQ6O/Ar6j4FZW7crbu7iVH2ECWFT2nFe2TbxQw+DKEr5LCcbnu13ru2HdOIJvUnoo4GZFy3vGZljyTH7iwasMs9IvK4ozGoRYtZz4m5/QIHW3N+nrmP22jZ2upmcXwD+LXGCWAUK2ZaWE1oo6p4eG8NksJXdpPMzQYsBnYIi9SXAOX714oOv5cfY/9KNW2TZ3zV23s9FHseoOnd5a9WsW8VaNo1lZQ0VbKHCw5navt+Gl6Gn3tf63ozMXqU/nryLu/9dVivZfk8rpLW4jJNhqrp1BYrxvsf9a7nP0oZPvG4BxyeJJp/f51S7E25uYfHHErU6UKQoUGuxO/t1xVYl7eI0x+tvgjKfT0Ipc7Zda4nEu/YZPoxibtWlyplkSXej52bjrF316zbMYzPD9PurD5jtEW/2TT9X9VS6S3+7LPrEChohnN6LI2rh4H2EJadgpOtWsw4sc0Ncc7HhhFVhInRhukDCKq9jL4QVqrCFDoS2xJUKltUOFR+gkoLjzLp2+3qHS+uXguqvxjfAdDn7Xi/xMYEGuWdDxrfURaKp1DUtx4O3WHgCKaCfnqiliLBtPV+cL48r4FUYq4pVaOeTrHjtTPhlkOKxnLidSHSZeggvUNc8hOq4z2k4+wIBjriu7pTbksuFQ4YujR/5cNxZna5wEcq4dPddHLRP3Cub/B25gWgv8akiSHOT/3thuX+oUl9ZuQOl2wtDXJV9gZf0G+x+soQ+pn+907ViBYdQeh3V0wamcpa/Soy6n4L/E24+UnbYux56jQK72VNhJjJVCNWWqOC/NK+/T8eu1nMazqdUHKvyDZ4ZBV4+C2p7+Ml4d0Y3CelmWTovWlGx+QZOxU1k2oKBHRck590UHHcOejrT/Lrd1QJwgLiQS+zrYIVnrh7GTs0mir3oGUJQGjPxei7TxaFLAWyngw2qRcxkSpKEjP/sMAd/dhLC5EMe/hajaG7gq7FiEUKm0O4d1U7nkKm8ScmN3q034rRiX2FYaB8F5PFw2HQJm8eZzpo= 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:(13230031)(36860700004)(376005)(82310400017)(7416005)(1800799015)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2024 13:27:53.9141 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03c1bda4-a7d8-47d8-58e8-08dc89512240 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: BN1PEPF00004688.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7938 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 | 10 ++++++++-- 1 file changed, 8 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..1f9c5a884487 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,6 +53,7 @@ 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, @@ -64,9 +66,13 @@ DEFINE_EVENT(drm_sched_job, drm_sched_job, TP_ARGS(sched_job, entity) ); -DEFINE_EVENT(drm_sched_job, drm_run_job, +DEFINE_EVENT_PRINT(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_ARGS(sched_job, entity), + 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) ); TRACE_EVENT(drm_sched_process_job, From patchwork Mon Jun 10 13:26:55 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: 13691998 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 6C0DFC27C5E for ; Mon, 10 Jun 2024 13:28:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 77C2210E2B5; Mon, 10 Jun 2024 13:28:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="fov2Fcbf"; dkim-atps=neutral Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2067.outbound.protection.outlook.com [40.107.236.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1073810E2B5 for ; Mon, 10 Jun 2024 13:28:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LAXR7updeyWAfIKnRMnouJFUMrfR3BEe5ca7171fz0Lpise1wmkGJy14sZCvPcGHpJSCkc2XzjW5POj31WXVlOWu8H3ypgt/9FxTloInzzEfmwWY2aS0NFOzR2kHKWAqtKzZ7hmr1d7VkerMcVVXnzQBKEBdHJZDpG7Ztrm92FhnRj81QOOgNXfjOdPxvBGjsbUn3/9tjfrlvZgKniSg8RGVf8NnH4rg5ARAPmhK55ttCBrg3+aKEfH6xhS8BaXANky1/8LVBerVsJMd9bL5mCI8uc1olHJI9Ep7HWF87kFfXc6mqQjguiUOYvaZenKq1sgBQ24RGR166pA+NXqnSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=lIwalo9eHUX21/6M52L7YW+QWkI0fdnlmmp23GLIafY=; b=VsJ1ZONOtS6U8IgyaQwJhQarmQuVhjydlKWkhG3oDmjlgw7aUSXHG8PkQuvE174DY6ErQqpbN9B2Iq/tcakbjzWSABQqDvcQG6OgS67N2lM6zletbTF/b3UwMpvbayfaly3fqvznMuf3W6ySJZL6+TSijsvG6iOJb8ZLoqqITfmvRUm6JK2Jso/RnTPohWU9oclZcI1S94uDrdlWCrD3fstCscSREgy5hWuxHLiQPIRnhBUw4AIbSmK9AXe0IXhObpLovLJq7uyB+ijm7nJCClyt+Rsm8paZkubU5xPK7TcdhVXC8wAq0geozUXSMhzuJuxCv13MwrotHTclxHHmzA== 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=lIwalo9eHUX21/6M52L7YW+QWkI0fdnlmmp23GLIafY=; b=fov2Fcbffb4lyJTWphJr2biNAe33fzS00YUo4u42uABgeDvF+YFYtCea6baqzCas0qre7B9KC1XXIevdOA8mcD4sSC4QPmo/Syjv6OuFrZFby/tXZbBbfiKYfWyPXtOm5xvf/DIfqeDo9EVA0HhbamTyuUg8lVOxuA3T4Jx4fS8= Received: from BN7PR02CA0035.namprd02.prod.outlook.com (2603:10b6:408:20::48) by IA1PR12MB7760.namprd12.prod.outlook.com (2603:10b6:208:418::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Mon, 10 Jun 2024 13:28:05 +0000 Received: from BN1PEPF00004688.namprd05.prod.outlook.com (2603:10b6:408:20:cafe::a2) by BN7PR02CA0035.outlook.office365.com (2603:10b6:408:20::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.25 via Frontend Transport; Mon, 10 Jun 2024 13:28:05 +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 BN1PEPF00004688.mail.protection.outlook.com (10.167.243.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Mon, 10 Jun 2024 13:28:05 +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; Mon, 10 Jun 2024 08:27:58 -0500 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v4 2/3] drm/sched: cleanup gpu_scheduler trace events Date: Mon, 10 Jun 2024 15:26:55 +0200 Message-ID: <20240610132707.61404-3-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240610132707.61404-1-pierre-eric.pelloux-prayer@amd.com> References: <20240610132707.61404-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: BN1PEPF00004688:EE_|IA1PR12MB7760:EE_ X-MS-Office365-Filtering-Correlation-Id: d59f3a30-5897-4abd-802b-08dc895128fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|1800799015|82310400017|7416005|376005|921011; X-Microsoft-Antispam-Message-Info: rmInUDaI0Chk6lDhk31XbLGmXMDso4GmCJ4hzbry419CnRyjhzC1K0sQp1mEIsqT7Tw1Hw7bM78VAjoy80TU89VicgWolKtw+CvEqzsbPb2Yt4B2waFm6QdAc65HzPsDc3U2ZY8uVE89Ss+u1eMndGybUJC3LZgVkd0yG3xxFHEUmHIAj+2scPBwJ/Uq6ba7IDcj1FuyqXH3SmlU66oUGDVFNO1pS3KGhi12Kms0Nad9iPUC42R0lGuA2JLS/mQ0oVconzGOyJwkpySuyPrqAntOHz70vx/v7R4hDVk8x/mIDnP53Onw8F5038t+gX3DBj8rsZ0Wiz03SjiOzHXvn+/gk5JzUyLNYjBiUDkMrRpLfxKaYUQi+xJrizIDjrSxZs/1w25Cwd3JtOPhFF769WzFhbGxWSLFn2Hod9E1Nc8QeBhFPCjM+gXR96hrUHTLoCpdA3nf9XYoS/2sBAv6aEsl3+f9/82du4anDjzcWHpULgsgzKWTT8REJmFHSPZOs7S6K8g6/CK5HvkkxSV6mvPc1NP8eRV/c9teh1d5+c1XK2K0cOEoLU+sENThgEk6U73vLjubzo4YdcCF7HmM/PGJxADdIieOyVW0goEloz8VPrTLlzKkEYJbT/IB30fQsswWkuMS0aoVReUDrYmYsHVxGh8nSrdHdIgHGu4AAagvSI/P47SKLwMzOzuo3woSxAOQer4qQB/aUM2Bsn3uHP2wuefAuqm+vi4GoIMrfkNMdMO0XezSGOuvhQh9s1+JXflZUqeGcMCDjBmHLTEnMjR6Z3l9VCQjYaI0wGi74epU1TfJI7p3hMSLMVWNYEL1Wo8f27HgNpdO2bExt/mJO0armTVDFJkKP67mpYGglrH/77XoDKjPD9N1+2jUwKF2Wc6MN+29+yT8fzTdpRzTsIAHob6ett0KD45c3EoNiri6YmnH7iY58+U5w7NQqkPtkZo+pp2PrPmBBwmvg3tzjT/vLs4PMylM3QmXnumYSc+x8q/EmccTqEBAFMEmss12zCoqY8LhPTsAMBYwa0N5+1naf+VsOuSazJMTSL882LdHgBVK7UByxrppMxZEdou3S3jWUydNvCC6TNrnON+aPPr8rg71cu1m14/I+o6fISClrAbYbwyFgt+gq68Vo11HnAnmoJyAmjy65kflXgYwBznGkM7qedkLfANIVPzFl91PPfvEQIFTJJA6TkZXSRMRkqXdY3QhbYdonzat3q0VeTqjO89jtoivZ99hqjlsLV9hWXziHsMiX9iaDQBdI/KyRKdyDXpWrx1oVECvH0K5RqZG4dtBayxFW0fEffZmBK5H12xIQovgM24P8kijje5WM9+/jwjCVne9JD3SSZBFCCcUjg1ZaEm6J5VpTYlE/kyLP0yAD0UOljxrSFJJdFvuzUVeWCqm9jCjrAjI49M7zo0/SShQ7oREbWbO8DLBztE= 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:(13230031)(36860700004)(1800799015)(82310400017)(7416005)(376005)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2024 13:28:05.2110 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d59f3a30-5897-4abd-802b-08dc895128fe 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: BN1PEPF00004688.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7760 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" Print identifiers instead of pointers: * "fence=%p" is replaced by "fence=(context:%llu, seqno:%lld)" to have a coherent way to print the fence. A possible follow up change would be to use the same format in traces/../dma-fence.h. * "entity=%p" is removed because the fence's context is already an identifier of the job owner. For drm_sched_job_wait_dep, we also print the hardware exec context of the fence that's initiating the wait (the scheduled fence ctx is not relevant here, since it's not traced in other events). Signed-off-by: Pierre-Eric Pelloux-Prayer --- .../gpu/drm/scheduler/gpu_scheduler_trace.h | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h index 1f9c5a884487..6541e161962f 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h +++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h @@ -37,27 +37,30 @@ DECLARE_EVENT_CLASS(drm_sched_job, 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("entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d", - __entry->entity, __entry->id, - __entry->fence, __get_str(name), + TP_printk("id=%llu, fence=(context:%llu, seqno:%lld), ring=%s, job count:%u, hw job count:%d", + __entry->id, + __entry->fence_context, __entry->fence_seqno, __get_str(name), __entry->job_count, __entry->hw_job_count) ); @@ -69,9 +72,9 @@ DEFINE_EVENT(drm_sched_job, drm_sched_job, DEFINE_EVENT_PRINT(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_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) ); @@ -79,13 +82,16 @@ 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, @@ -93,23 +99,25 @@ TRACE_EVENT(drm_sched_job_wait_dep, TP_ARGS(sched_job, fence), TP_STRUCT__entry( __string(name, sched_job->sched->name) + __field(uint64_t, fence_context) __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); + /* Store the hw exec fence context. */ + __entry->fence_context = sched_job->entity->fence_context + 1; __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("job ring=%s, fence_context=%llu, id=%llu, depends fence=(context:%llu, seqno:%lld)", + __get_str(name), __entry->fence_context, __entry->id, + __entry->ctx, __entry->seqno) ); #endif From patchwork Mon Jun 10 13:26:56 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: 13691999 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 BE870C27C5E for ; Mon, 10 Jun 2024 13:28:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20C8710E332; Mon, 10 Jun 2024 13:28:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="UESAx6Rx"; dkim-atps=neutral Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2049.outbound.protection.outlook.com [40.107.92.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7002410E45C for ; Mon, 10 Jun 2024 13:28:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QjA/HZ5rHGubXyFut1TnBbAOph3Q93xSV9ZV+bZfqE8OZS40vHp9t4zaM6HHwGNi1DXUVDPQDYwQULyevOex/Um4+Hecqu7D7voWcm4pW2c9h6i1gRWTw0f5OqxMaWFzQL4UyqjJhiJqqA1Ceo7LcNrh11Zl0xjjrXhicdXhvcoIpolY/itAKoM/xPrreHZK0HQGFfVl11fH2gM2Jse+Jrg0g7iMQlKBbigJao86hPMGJHoQjFHpH8nGsJ3MjU4jgo55dBx/L5qHRJuTREkRRqAReN0/PCoibxLdF3wHeqTY7nZM/i+o3YLPnT7zwnVhr/u9umpmxGqiS69u44fZAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=PvTSu8RJBhs6pCAo6yTFfWZ13k133C0bbgH5VQkANek=; b=Q/WwBf77ggQ6Yr6nNfPNUbhWEqb9net4kNWNWhxP38mys79jfv7JC58rbwfmvF/ikgWrFaur2bcAHNBoDOnD8B3/etqIXzXeMdrDO9In7VNgYVykomOsYUYMgE3teKa4x79nH+UrWKHtYpS6s+qSFW/YxLWm7p9kiIDY02Ys5hIaoE9DFU7zFCkQYdfp8XZwcykdIvEmY4l38YMl0UWqr9NiR3GzP2fSXnpbVFAE4V9Brpl7gXxb6ep/N6pOTD6wLp2MVUedzZqSZ+iSFQFS223yk22byNqfoEGRH4poKwd2JRWPPBrNpXigRKuVMz+s7BTk/IG/KDnGHuGgFWMDzw== 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=PvTSu8RJBhs6pCAo6yTFfWZ13k133C0bbgH5VQkANek=; b=UESAx6RxtCiltb7TY+iAVZ2OlWq0momGYXUx4tT9D5mmhQOWvGo5CPmb5JEJIQprfqyqEIJ5UBI9SCosx85Z4Z32VLAr5HISYcgsIIUs7vzrGqSYeFc91hgTRfuFxvIufWehc0IAtBoiCCozYOQFM675C68Ah1tOkQx8UhzcWz8= Received: from BN9PR03CA0148.namprd03.prod.outlook.com (2603:10b6:408:fe::33) by MN0PR12MB6272.namprd12.prod.outlook.com (2603:10b6:208:3c0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Mon, 10 Jun 2024 13:28:13 +0000 Received: from BN1PEPF0000468B.namprd05.prod.outlook.com (2603:10b6:408:fe:cafe::55) by BN9PR03CA0148.outlook.office365.com (2603:10b6:408:fe::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.24 via Frontend Transport; Mon, 10 Jun 2024 13:28: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 BN1PEPF0000468B.mail.protection.outlook.com (10.167.243.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Mon, 10 Jun 2024 13:28: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; Mon, 10 Jun 2024 08:28:09 -0500 From: Pierre-Eric Pelloux-Prayer To: , , , , , , , , , , , CC: Pierre-Eric Pelloux-Prayer Subject: [PATCH v4 3/3] drm/sched: trace dependencies for gpu jobs Date: Mon, 10 Jun 2024 15:26:56 +0200 Message-ID: <20240610132707.61404-4-pierre-eric.pelloux-prayer@amd.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240610132707.61404-1-pierre-eric.pelloux-prayer@amd.com> References: <20240610132707.61404-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: BN1PEPF0000468B:EE_|MN0PR12MB6272:EE_ X-MS-Office365-Filtering-Correlation-Id: c07c61db-cdfe-4445-4b45-08dc89512dbf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|376005|36860700004|1800799015|82310400017|921011; X-Microsoft-Antispam-Message-Info: tPo2uSphyJoQqiLhx/j+Opx52MVLXeHi/nRQsZf+8zgBuYj5z3OvFyK5UBwiWkVd5oiPGfpJpTT2N313wLvx7a42dYggmk8LsF2CYmKKC38+uUhvhLgfjdPTmhUS4Gne36DtMwJvl6QvUF68v2GNPHFbPfkyCJXQ6/dVsWYj29NPKWxSN4AI4maOYGTJFvuxy9SO2qKUep3iInqIabpktP88JZyctgcpAhQcoX7rT28o79NkoiWO1vMBmFW8vKRJgqdGWni0wgAZRnXQUmKwZhrDwP35ETHdHQO1TgiE8nv2sZTilYBia1dbjHfPbZPwZiGLey6NiUdVNUuUkh9oGbkLTvcD12uLF9ZLkPrOFnVcCTVNDWWd/wJrsp5EdkE7ufqRNcnGlHFiuEWHfc6/qgZZwOosaWF15FIAbLRKhcxOj7AhilrlMyaxRFFmstJIRyZOGAwhO8do72+xfh/tzxblzxZAQcP82SkuyY5ATrtK060xeHkevL1C+KcpFdtyXhE3aM7VDphvERbOmdXEvvce8DAKIlRQeb8LHw5OkpXOsBGQjjdwsJfHCz2kcD4g08qsilLKPD/3Zi9FEb+1eBFGYVY8yFhFypXAHaAuTryZugw0W+0cIjLaCbvzYxDsYXMa3IzNFF3T51csVVBBDzXwa0NPe9IJ601GroUhhgkdFWI1MgyiG1If4AT1Z8p8xDSwxr+2aeJn3Hpg4MkLX/vCjZ9c0m7fZMXnoJLoRD7ZGFdMb8jzK6mADidA5blRZXd9ek1WYBjdlvR+i1TL3XYvWe6pfrzUlKI7cBNS9oRP/6HmreR+5s5QR4f/yBm9KpWiKRAPsElncGzLSwLH8SNsaiV3MGxETAAZKr951nBpVuxA2GYnkcL0KPR6J4cB3Kc+y3hOVmm0Z3yRitqQ/nNZ3RJowtuUSTPkFo73foPgkvZk+CNrPDDlOdJfK8nVrdHDDcrPtChC3LQiQGQu3ApA0UvZ12I46F14BDjGQ082xc2F9dOnegTauafOpvPNPUwB90JmVJteAw8M54FKnl9tN5V7eHSeZyuD6SMKxq+83/4cpJ7SLoajm4Woi93RTT8yh9uX+DgtXgpyMXs0472hwnMsFbxaQkT9Ti2WzbhE6hAtgXrjl9xwVYf3eCKT+LeU009vyltxfFs3uKc9CvrherFewN8FyPWA4QVu83I22M0vVAUr0C+F1oCKns8pyJ/d7PrCD78nAfH8e6ShYMKqkTSOQr3bMSO8XObvA1fGKtn97ALrmrJbIHd8cjIi2O3Y50hEE32l/kEhNkB5gKm6P0c/SpGCg+7GVx7MvLUNWc9t+f64Ad302PHDPragALiKHZzHL/KWFxrp2br8dg7Kw/DcAiCaKSdIxDGRkMk+AG/Zo4H2EgeOJWp/P2B+hEX8h+theU9fZ+ALvAFX+J36ZhB0kczWE6ZVd6LlOOQ= 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:(13230031)(7416005)(376005)(36860700004)(1800799015)(82310400017)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2024 13:28:13.2010 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c07c61db-cdfe-4445-4b45-08dc89512dbf 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: BN1PEPF0000468B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6272 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 6541e161962f..702d1f709bcf 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( __field(struct drm_sched_entity *, entity) __string(name, sched_job->sched->name) @@ -44,9 +70,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->entity = entity; __entry->id = sched_job->id; __assign_str(name); @@ -56,22 +87,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("id=%llu, fence=(context:%llu, seqno:%lld), ring=%s, job count:%u, hw job count:%d", + TP_printk("id=%llu, fence=(context:%llu, seqno:%lld), ring=%s, job count:%u, hw job count:%d, dependencies:%s", __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_PRINT(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), 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), diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c index 58c8161289fe..aa33a9d29b14 100644 --- a/drivers/gpu/drm/scheduler/sched_entity.c +++ b/drivers/gpu/drm/scheduler/sched_entity.c @@ -583,7 +583,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; + void *f; + + xa_for_each(&sched_job->dependencies, index, f) { } + trace_drm_sched_job(sched_job, entity, index); + } 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 7e90c9f95611..0bc9b7b24b34 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -1201,7 +1201,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);