From patchwork Fri Dec 18 22:11:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 7888821 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F34BF9F1C2 for ; Fri, 18 Dec 2015 22:12:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E72E20524 for ; Fri, 18 Dec 2015 22:12:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 17BFE204E4 for ; Fri, 18 Dec 2015 22:12:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AF806E2CC; Fri, 18 Dec 2015 14:12:16 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0093.outbound.protection.outlook.com [207.46.100.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4ADE96E2CC for ; Fri, 18 Dec 2015 14:12:13 -0800 (PST) Received: from CY1PR1201CA0020.namprd12.prod.outlook.com (10.169.17.158) by BN4PR12MB0852.namprd12.prod.outlook.com (10.164.59.14) with Microsoft SMTP Server (TLS) id 15.1.361.13; Fri, 18 Dec 2015 22:12:11 +0000 Received: from BY2NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::206) by CY1PR1201CA0020.outlook.office365.com (2a01:111:e400:5b9a::30) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Fri, 18 Dec 2015 22:12:11 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from atltwp02.amd.com (165.204.84.222) by BY2NAM03FT027.mail.protection.outlook.com (10.152.84.237) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Fri, 18 Dec 2015 22:12:10 +0000 X-WSS-ID: 0NZKR05-08-VX2-02 X-M-MSG: Received: from satlvexedge02.amd.com (satlvexedge02.amd.com [10.177.96.29]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 28873D2275D for ; Fri, 18 Dec 2015 17:12:04 -0500 (EST) Received: from SATLEXDAG02.amd.com (10.181.40.5) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 18 Dec 2015 16:12:37 -0600 Received: from STOREXDAG02.amd.com (10.1.13.11) by SATLEXDAG02.amd.com (10.181.40.5) with Microsoft SMTP Server (TLS) id 14.3.266.1; Fri, 18 Dec 2015 17:12:08 -0500 Received: from cnhwentlanub.amd.com (172.29.225.36) by storexdag02.amd.com (10.1.13.11) with Microsoft SMTP Server id 14.3.266.1; Fri, 18 Dec 2015 17:12:06 -0500 From: Harry Wentland To: Subject: [PATCH] drm: Print pid in drm log Date: Fri, 18 Dec 2015 17:11:45 -0500 Message-ID: <1450476705-1487-1-git-send-email-harry.wentland@amd.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(199003)(189002)(5008740100001)(77096005)(86362001)(48376002)(19580395003)(33646002)(105586002)(450100001)(53416004)(50466002)(229853001)(106466001)(19580405001)(101416001)(575784001)(2351001)(1220700001)(5003600100002)(87936001)(110136002)(5003940100001)(50226001)(50986999)(586003)(47776003)(189998001)(92566002)(97736004)(11100500001)(1096002)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0852; H:atltwp02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0852; 2:sx8HGzVjaOziBis/Rth4H76nEsZdW/YD7JQ+M80c8ucmUT9IbzBoDqEYrGakmTVdMHiLeCRKrb0L83ynOr03GmfPzWRjvbaD7NzCJY4qvygEvJCFd9wVwXLccEaQoiWi/POvl7BoIl8gQr8wgVmxKA==; 3:TikRWu2vhvjkfOFAEUD4RvBHzVkMhVQ7Iak3ZAxhLTQ6GSLUZhkGccqdmW39KnuoOGNe5CkpBqlzV+TbuRrWnlwAr9neodjNPJaKaRymOLP3YwvZUL+mS4u2AqMEJdKvooAwTQkACqWHGyRrQl1CmANG2m/T29HM7hcyDeKyOE1q8AONnaNhrr4DYLy4aIM28onvPXcvao3k4Ah+gpJzUBV0PUae+6sTSw7xPF5WRds=; 25:EOvjVnNwIh5tbZ60x//z8M/ASs6XSiWfqS32lJMoZtZq136Je57X1h9mfVUEkleiCXXUmajbYiIwR64yhDYr7mO+wMT5bCe8j+C0qrceIxPxAGJ9NStbpUgB2V4WBBgforvWvfThURVgWzbNr6SR5zphGxPuFodU4n8XuDT/4Y1ND0n14fvI9miGBX0BODmKFEeN8i/V0Kz7Ih4s04O30YmQxlZT8R2Wfa5nb/bOZNUOhetATcIhKF0LP0ljgeQkGTgMHjIJFNuOjRyvJY7aOQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN4PR12MB0852; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0852; 20:rvbvobE2k12EssE8nX+8pTypLEqQLOYZwnHxsTM2HTYXFNGRRe7p55VBmiw8/XHUegCe59AFNYanRoPUgy7CB/cfc97wC4rlvlKLB3HOfjVeoKNjdP5Nul1CshR9AIvN2U661GERV+FEBbTfKeuHI1y3xfJU+X4p/Xb0/NSaK6pKlJgdUBafSvyw+w0ndMEs5Fc/WZx4QwvbKqNd19vflRnjIOTnRHw4M5M8BrWq8ivQByCQwWy7gFthDZHBJd98eJJWdVQ1z9RcKrjMck6qLkfd+oqbPq8r9f7tXkoS52iZA1HEAJ/3GK77thqKL6XqtYqKZtAIq3gtrtLXlwLmW7whsOlByXS24qPR1MlTeXR8lr98AZSEhXsHOM2i2sf3ecPHwMo3aQpMgkX1Xo1XWpFpTAwt+duDFCTBHNz7+NNToYIAzrM0PsLdLC0t2XkCunFFsTBg7AJefz2qm6gPgE8U2AOrMnqcluOVWw81lh9ReV9iS8nvxZOovNWcjdSX; 4:2DPCNULRGQ5r/Ew9ugP17v1VWqGyAmfVvXaD4V5nwNHNRc8arCKw36741o3XcK32g3YZkFyo5mbiQuhhyj70OrCurKcTakisLJwx4YXizuG6a1YGO75hm8VntGsyZR/0v1vaXireA5/wxRUI6hgLTQ4/FfPmFfV9D6JSfVcY+tC1q7rpCZvCV8YCGIs3bIFei5jGY+a+qcITiyEC/i1kHG4JRGhsmqLJyuPelKkul1yNjL4mghgT0yM0+4teAtc0OV0swfTUMhpbLwGovtfjQ+ZDl7h4DJEDF97lBBBKnxQhWCz5DOj6CyTpZ7A1jSqxTudLawC9Q29oWk4BpbdoJRfe+HR+Wc8V3Fq3wFu+Oozcqrm6NcKlpy4jrBm2zzUU9Yc98XfPje2txjk9VvZSuPqDrB/6KLQx3mjlmVh4RLQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:BN4PR12MB0852; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0852; X-Forefront-PRVS: 07943272E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;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wwRxpv0KCn?= =?us-ascii?Q?EzCL86APcfd6Wv/+oZaFbTfLLWzqDbaBKUNKuNKpg4iwywOjjoP2AUvcR1t+?= =?us-ascii?Q?vB0TH4sZ68GiKVVFg7iXpWGsFVDiOC+owqkaMrfew=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0852; 5:aSbQwo4SYTDBiLvjZJgvjBuXuTVBsrcKI8uj9DAquYlB0aFPotguOeGrgl6ht6aGm7ExnTl42Dh/IW+Luhob3DyDFTA10P6xodRQFYRrmW/g7i2tJag8XZqaTtfajufX1ImFOR6O1aDRjxPtkbidWg==; 24:GC9KjNy/kv+57f64XkDlUIq9d+4ZWfxm2iCS9fVSVitBWdihy1VEH4nBUesP/DBsqY+nLDayC40xA1svptWYDWKPNIbF0Lf3IMfnrdAXp2Q=; 20:ndCiPLYpaKeFYyo6jwJLvsmKwLUtwyn5qo8M/jF0I3wa6epFQjhDBZsdVTaYkjpWvnjC7DrEK1TRgJ4wTQQlH6mZiYmOw605k3nQmHVLUI6zTAg9l3vg38KJDI+IN42gEHLOHmH+c0SrhaRZ5QU1HoIQbmykh4cBc8jbo65qOnlgSvAhniHRuCNPVbI1Gxu2dOIKGNmC+PmltiM6KWe3tlJyVIpxXbwydz/qz6F3hze1wBt9UOioAbpHLUZuttVC SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2015 22:12:10.5942 (UTC) 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.222]; Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR12MB0852 Cc: Andrey Grodzovsky X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andrey Grodzovsky Add task ids to all DRM prints so it is easier to resolve concurency issues and understand the logic. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/drm_drv.c | 16 +++++++++++++--- include/drm/drmP.h | 6 ++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 7dd6728dd092..7b17a9ae0b07 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -55,6 +55,16 @@ static struct idr drm_minors_idr; static struct dentry *drm_debugfs_root; +pid_t get_my_pid(void) { + + if (!in_interrupt()) + return current->pid; + + return 0; +} + +EXPORT_SYMBOL(get_my_pid); + void drm_err(const char *format, ...) { struct va_format vaf; @@ -65,8 +75,8 @@ void drm_err(const char *format, ...) vaf.fmt = format; vaf.va = &args; - printk(KERN_ERR "[" DRM_NAME ":%ps] *ERROR* %pV", - __builtin_return_address(0), &vaf); + printk(KERN_ERR "[%u][" DRM_NAME ":%ps] *ERROR* %pV", + get_my_pid(),__builtin_return_address(0), &vaf); va_end(args); } @@ -81,7 +91,7 @@ void drm_ut_debug_printk(const char *function_name, const char *format, ...) vaf.fmt = format; vaf.va = &args; - printk(KERN_DEBUG "[" DRM_NAME ":%s] %pV", function_name, &vaf); + printk(KERN_DEBUG "[%u][" DRM_NAME ":%s] %pV",get_my_pid(), function_name, &vaf); va_end(args); } diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 5531d7bbe851..4b17f890ca14 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -183,11 +183,13 @@ void drm_err(const char *format, ...); drm_err(fmt, ##__VA_ARGS__); \ }) +pid_t get_my_pid(void); + #define DRM_INFO(fmt, ...) \ - printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) + printk(KERN_INFO "[%u][" DRM_NAME "] " fmt,get_my_pid(), ##__VA_ARGS__) #define DRM_INFO_ONCE(fmt, ...) \ - printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) + printk_once(KERN_INFO "[%u][" DRM_NAME "] " fmt,get_my_pid(), ##__VA_ARGS__) /** * Debug output.