2018-01-31 01:01:42

by Eric Anholt

[permalink] [raw]
Subject: [PATCH] drm: Print the pid when debug logging an ioctl error.

When we debug print what ioctl we're calling into, we include the pid.
If you have multiple processes rendering simulataneously, the error
return also needs the pid so you can see which of the ioctl calls was
the one to fail.

Signed-off-by: Eric Anholt <[email protected]>
---
drivers/gpu/drm/drm_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index a9ae6dd2d593..38c302607738 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -842,7 +842,7 @@ long drm_ioctl(struct file *filp,
if (kdata != stack_kdata)
kfree(kdata);
if (retcode)
- DRM_DEBUG("ret = %d\n", retcode);
+ DRM_DEBUG("pid=%d, ret = %d\n", task_pid_nr(current), retcode);
return retcode;
}
EXPORT_SYMBOL(drm_ioctl);
--
2.15.0



2018-01-31 08:41:51

by Daniel Vetter

[permalink] [raw]
Subject: Re: [PATCH] drm: Print the pid when debug logging an ioctl error.

On Tue, Jan 30, 2018 at 01:56:43PM -0800, Eric Anholt wrote:
> When we debug print what ioctl we're calling into, we include the pid.
> If you have multiple processes rendering simulataneously, the error
> return also needs the pid so you can see which of the ioctl calls was
> the one to fail.
>
> Signed-off-by: Eric Anholt <[email protected]>

Reviewed-by: Daniel Vetter <[email protected]>

> ---
> drivers/gpu/drm/drm_ioctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index a9ae6dd2d593..38c302607738 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -842,7 +842,7 @@ long drm_ioctl(struct file *filp,
> if (kdata != stack_kdata)
> kfree(kdata);
> if (retcode)
> - DRM_DEBUG("ret = %d\n", retcode);
> + DRM_DEBUG("pid=%d, ret = %d\n", task_pid_nr(current), retcode);
> return retcode;
> }
> EXPORT_SYMBOL(drm_ioctl);
> --
> 2.15.0
>
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

2018-02-11 10:10:24

by Eric Anholt

[permalink] [raw]
Subject: Re: [PATCH] drm: Print the pid when debug logging an ioctl error.

Daniel Vetter <[email protected]> writes:

> On Tue, Jan 30, 2018 at 01:56:43PM -0800, Eric Anholt wrote:
>> When we debug print what ioctl we're calling into, we include the pid.
>> If you have multiple processes rendering simulataneously, the error
>> return also needs the pid so you can see which of the ioctl calls was
>> the one to fail.
>>
>> Signed-off-by: Eric Anholt <[email protected]>
>
> Reviewed-by: Daniel Vetter <[email protected]>

Pushed. Thanks!


Attachments:
signature.asc (847.00 B)