From patchwork Tue Jul 31 14:56:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10550881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E363C13B8 for ; Tue, 31 Jul 2018 14:57:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA32C2AF9F for ; Tue, 31 Jul 2018 14:57:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE03F2AFAA; Tue, 31 Jul 2018 14:57:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 846622AF9F for ; Tue, 31 Jul 2018 14:57:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C5E976E1CA; Tue, 31 Jul 2018 14:57:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0087.outbound.protection.outlook.com [104.47.37.87]) by gabe.freedesktop.org (Postfix) with ESMTPS id CD16B6E1CA; Tue, 31 Jul 2018 14:57:13 +0000 (UTC) Received: from DM3PR12CA0104.namprd12.prod.outlook.com (2603:10b6:0:55::24) by MWHPR1201MB0240.namprd12.prod.outlook.com (2603:10b6:301:57::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Tue, 31 Jul 2018 14:57:11 +0000 Received: from CO1NAM03FT051.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::200) by DM3PR12CA0104.outlook.office365.com (2603:10b6:0:55::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Tue, 31 Jul 2018 14:57:11 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT051.mail.protection.outlook.com (10.152.80.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1038.3 via Frontend Transport; Tue, 31 Jul 2018 14:57:09 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Tue, 31 Jul 2018 09:57:08 -0500 From: Andrey Grodzovsky To: , Subject: [PATCH 1/2] drm/scheduler: Add job dependency trace. Date: Tue, 31 Jul 2018 10:56:53 -0400 Message-ID: <1533049014-6934-1-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(2980300002)(428003)(189003)(199004)(53936002)(16586007)(316002)(47776003)(54906003)(8676002)(110136005)(72206003)(106466001)(50466002)(48376002)(68736007)(105586002)(53416004)(50226002)(2906002)(305945005)(478600001)(356003)(186003)(26005)(77096007)(97736004)(6666003)(8936002)(7696005)(5660300001)(36756003)(336012)(104016004)(486006)(476003)(2616005)(126002)(51416003)(44832011)(81156014)(450100002)(4326008)(81166006)(86362001)(426003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB0240; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT051; 1:FvZNl3EWbyDAOUZIfy1/qxx2KGwkmEUE68gAZ+e8VewRl+MoaUmVq8qqYmc48Ql3WXjd7SqxyLDQaNMdIG9csjYSnodFSsjLlAVdoptqjjs33kzalh7bsN+7BxyJHYy+ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc4d7826-1bcf-497f-b4ba-08d5f6f5e491 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060); SRVR:MWHPR1201MB0240; X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0240; 3:I+BmwXkJpBDvKKzLnktXyG5Begr61/IuYBaUyQWe09z3NGDePzEgXWciopTsR7o1qLUDfMzJu7F3pokEDBzVT5gQKKSvD08OgRu6ylvE1gxvPD73j740uoZ4/beXD44KpBiAZS36ZmsomPLVJvtsCpPMaTL+AY+ojYMR7RnJZenQ/MwIyAIMCT/IRSsyQMSC+VYHk0y0N82wNM/PZgjh2raD/l2MFvtcd+o92h2wg5e84L5mGOmx7HQNxl3Wmd0Emf73MmWBRGFcNdh05qNJz5pcDz4oy/2oAZZAyWewIElZAEthsjYALEm2gWVddsGUo5qjMYzN+1uXavTjjVlJmwc/Qaz2IkFgHJk8wrGL88M=; 25:b3MYFW/BKDWJeOc70l+KCuh7tN/C5YX+7A7kfjkCZpuot/cgZhIlgdd0BMzQv+35M0Ys79q9LaAmmiSNo5Mwe7kzoh4zgqda2F0HdCXY8In01bLCvZYnKXtaK65cKMlL7I/SzZFycEAhDHaOrJ4xQIoa5AaiYrw+h7Ol6QawJujLGIRShgMeyBgB9jhm6DS4lBY83I+wgLKQycMNGVpzcmxEad+uIcJ0g2wHvlKUbIk/Lre1pato2jXQf6k+U80ahQlhFwIQ7JStKKLkpxx+C/8OricllT3a6wpVu6GGiVmHsWh0cGuKRx2PCThrPs2qVOat88Y+YRcATRXj6S5uZQ== X-MS-TrafficTypeDiagnostic: MWHPR1201MB0240: X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0240; 31:T/1upBKrViWevgMhHAucijS+hJZEIZKETBUmlseOwgDIC3Y6Du2CLW03+91BYMPCFznDrQDsluH/EykDQaXxZ4S6QfHQtQh1pPKEmWOguNYeEI+OSeOKKhikJfS8PfhtsSkOcGUQT6Txela1zmQb3oTSnOOxxF/vT//TU7QXnZsleF+su425782n8kyWRbw9KNiEXBvCawpbKj0rWn3UE6kofMGrAdaHK73qOxZGvhM=; 20:pahY0pR9lquGK9FV2u7EtE35m7OVVv1BwZ6l427pEEzJmM1Ubx/l2pf/mzGJijhs5wg+RI2SD4gRQg6n/tk7TICp9wjIbigqQ6rOqdqX6my+rzRWzIDoeUuKucZERcnEoQsSJ8RXYVtqAegr6poCuzsUlX70HwJAtdCu52u8w6/yPwdGLyJyX5weV7QzIdxs2gbPsdrRMxA6p20B6i9DTSu7AunAHBGgvogwu5f7Mbf3EKsvanavwt//vgfArQro/nnE1S+gFQ8+/GTPlWpjqIz6YIf5RF5BDJop3DgeNuZHO5nmBZtq9W782Hco1mTbpe5dXmGkjDZFx1vaR5z9MbyQd9FHK1IYd+Mh2SEUVjSqyCqk1xS/YJz8c993NMNbn5z644OEli1ez4l1+LsMn+lw8D9Thzi3bX1pA7X5uQ5IP+gAYsb6V1QKTRqtQItWZ6HmZgEMKWBTP+Ejyb0P3ReOP9ygQ0SFJ89i+GZxZaZLJEskxEpF3A3pWZQ77Slp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93003095)(3002001)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:MWHPR1201MB0240; BCL:0; PCL:0; RULEID:; SRVR:MWHPR1201MB0240; X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0240; 4:OCJ9QfWxYPaxlU3NKJhoFPN//5iWIyH4qMIuEyfx1pPu+wCh0uhV4yoFlcvIqTj43KmFE8UAnShE33VctbdZhu+wRwvXnBgbOH2jKqSCqeov3FE3l2ZsZXJzSNBnJKzVvdO2YGuYWIwt8vr7n9cKyhfwClrjb6Q3ohciN0ZIVhiggbDL8gBX3UMwpeVL0aNVlB70xUa1tLNvB4n3VMcPmlyKfhnNKESB1oCWhJgYh4f9qn6P04RicnBOef4qROZfpjDTS0V9QMaHON8H3gQu2C2R8P8jlgk1iofddxCBEMxqeWqQxaikJigG75VybVek X-Forefront-PRVS: 0750463DC9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR1201MB0240; 23:DiyK1GqMZjhNxv5FumJ64lW8vgf98o2z0lB9JHX?= p3P2UK2yejp9vVwac1K9Pt7BfPCohNicLeq477t7IPux0O8wCSvdntyDik8LgKWHEsLqHaJp711Q4xstvl4FsLOXjyHIipwMK5YZSsk/Z33LqiJykn1a4jWuz1U+q2rG19D6RzGK80iP5/f7zgTYeZn6aSiBXKWxMXknIzzx7WKY4AGKVasw53ke8q7GFK8cDznSg/jPV+06W+3//O7um7Cefgw4IAwRIh6RH9S8advrnVz/zB/kD1xpM65auWKo+99O6WXpZmE7Bn0JpYrI0kHbb20/57xbVqwoG0x0hs7iHaYiJeyj7kMH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-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0240; 20:ATyzvIVKd2B0JfCFPunc3Ix2sehWtwd4aTCFcB3m5Ot4XJWbV/h8KB4p2SYDD8VlDaC45zkx9PsCIj5ls5bNsbIQs5XC6+Eq+viRxDPj5BetCFk+JR1UbayAFM2t7UyGbYaG8G+Y8sIL3aEYazrgoCHTZvK071WHmaUHPnDuIBGFZqij6EdO4rvjx2d7zZkHwIfhOb/gHgnjCH1Mjp5Wi9ICZfV2fH1dVOEQjJ6vwGeDOtYu06PlA6HuqQoiEm0+ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2018 14:57:09.6998 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc4d7826-1bcf-497f-b4ba-08d5f6f5e491 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0240 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: christian.koenig@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP During debug sessions I encountered a need to trace back a job dependecy a few steps back to the first failing job. This trace helpped me a lot. Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König for the series. --- drivers/gpu/drm/scheduler/gpu_scheduler.c | 8 ++++++-- drivers/gpu/drm/scheduler/gpu_scheduler_trace.h | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c index 3f2fc5e..45703b9 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c @@ -506,9 +506,13 @@ drm_sched_entity_pop_job(struct drm_sched_entity *entity) if (!sched_job) return NULL; - while ((entity->dependency = sched->ops->dependency(sched_job, entity))) - if (drm_sched_entity_add_dependency_cb(entity)) + while ((entity->dependency = sched->ops->dependency(sched_job, entity))) { + if (drm_sched_entity_add_dependency_cb(entity)) { + + trace_drm_sched_job_wait_dep(sched_job, entity->dependency); return NULL; + } + } /* skip jobs from entity that marked guilty */ if (entity->guilty && atomic_read(entity->guilty)) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h index 4998ad9..1626f39 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h +++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h @@ -74,6 +74,30 @@ TRACE_EVENT(drm_sched_process_job, TP_printk("fence=%p signaled", __entry->fence) ); +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( + __field(const char *,name) + __field(uint64_t, id) + __field(struct dma_fence *, fence) + __field(uint64_t, ctx) + __field(unsigned, seqno) + ), + + TP_fast_assign( + __entry->name = sched_job->sched->name; + __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", + __entry->name, __entry->id, + __entry->fence, __entry->ctx, + __entry->seqno) +); + #endif /* This part must be outside protection */