Commit 5a2ba992 authored by Emil Velikov's avatar Emil Velikov Committed by Emil Velikov

drm: print the current->comm alongside the pid

The question of "what process is this pid" keeps on popping up, so lets
print the process name alongside the pid.

Cc: Mauro Rossi <issor.oruam@gmail.com>
Cc: Bob Beckett <bob.beckett@collabora.com>
Cc: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: default avatarEmil Velikov <emil.velikov@collabora.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200518083315.129948-1-emil.l.velikov@gmail.com
parent ab15d56e
...@@ -253,8 +253,8 @@ void drm_file_free(struct drm_file *file) ...@@ -253,8 +253,8 @@ void drm_file_free(struct drm_file *file)
dev = file->minor->dev; dev = file->minor->dev;
DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n", DRM_DEBUG("comm=\"%s\", pid=%d, dev=0x%lx, open_count=%d\n",
task_pid_nr(current), current->comm, task_pid_nr(current),
(long)old_encode_dev(file->minor->kdev->devt), (long)old_encode_dev(file->minor->kdev->devt),
atomic_read(&dev->open_count)); atomic_read(&dev->open_count));
...@@ -345,7 +345,8 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor) ...@@ -345,7 +345,8 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
if (dev->switch_power_state != DRM_SWITCH_POWER_ON && dev->switch_power_state != DRM_SWITCH_POWER_DYNAMIC_OFF) if (dev->switch_power_state != DRM_SWITCH_POWER_ON && dev->switch_power_state != DRM_SWITCH_POWER_DYNAMIC_OFF)
return -EINVAL; return -EINVAL;
DRM_DEBUG("pid = %d, minor = %d\n", task_pid_nr(current), minor->index); DRM_DEBUG("comm=\"%s\", pid=%d, minor=%d\n", current->comm,
task_pid_nr(current), minor->index);
priv = drm_file_alloc(minor); priv = drm_file_alloc(minor);
if (IS_ERR(priv)) if (IS_ERR(priv))
......
...@@ -985,8 +985,8 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -985,8 +985,8 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (!fn) if (!fn)
return drm_ioctl(filp, cmd, arg); return drm_ioctl(filp, cmd, arg);
DRM_DEBUG("pid=%d, dev=0x%lx, auth=%d, %s\n", DRM_DEBUG("comm=\"%s\", pid=%d, dev=0x%lx, auth=%d, %s\n",
task_pid_nr(current), current->comm, task_pid_nr(current),
(long)old_encode_dev(file_priv->minor->kdev->devt), (long)old_encode_dev(file_priv->minor->kdev->devt),
file_priv->authenticated, file_priv->authenticated,
drm_compat_ioctls[nr].name); drm_compat_ioctls[nr].name);
......
...@@ -852,8 +852,8 @@ long drm_ioctl(struct file *filp, ...@@ -852,8 +852,8 @@ long drm_ioctl(struct file *filp,
out_size = 0; out_size = 0;
ksize = max(max(in_size, out_size), drv_size); ksize = max(max(in_size, out_size), drv_size);
DRM_DEBUG("pid=%d, dev=0x%lx, auth=%d, %s\n", DRM_DEBUG("comm=\"%s\" pid=%d, dev=0x%lx, auth=%d, %s\n",
task_pid_nr(current), current->comm, task_pid_nr(current),
(long)old_encode_dev(file_priv->minor->kdev->devt), (long)old_encode_dev(file_priv->minor->kdev->devt),
file_priv->authenticated, ioctl->name); file_priv->authenticated, ioctl->name);
...@@ -890,15 +890,16 @@ long drm_ioctl(struct file *filp, ...@@ -890,15 +890,16 @@ long drm_ioctl(struct file *filp,
err_i1: err_i1:
if (!ioctl) if (!ioctl)
DRM_DEBUG("invalid ioctl: pid=%d, dev=0x%lx, auth=%d, cmd=0x%02x, nr=0x%02x\n", DRM_DEBUG("invalid ioctl: comm=\"%s\", pid=%d, dev=0x%lx, auth=%d, cmd=0x%02x, nr=0x%02x\n",
task_pid_nr(current), current->comm, task_pid_nr(current),
(long)old_encode_dev(file_priv->minor->kdev->devt), (long)old_encode_dev(file_priv->minor->kdev->devt),
file_priv->authenticated, cmd, nr); file_priv->authenticated, cmd, nr);
if (kdata != stack_kdata) if (kdata != stack_kdata)
kfree(kdata); kfree(kdata);
if (retcode) if (retcode)
DRM_DEBUG("pid=%d, ret = %d\n", task_pid_nr(current), retcode); DRM_DEBUG("comm=\"%s\", pid=%d, ret=%d\n", current->comm,
task_pid_nr(current), retcode);
return retcode; return retcode;
} }
EXPORT_SYMBOL(drm_ioctl); EXPORT_SYMBOL(drm_ioctl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment