Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/lima: save process info for debug usage

When task fail, we can find its process with this information.

Tested-by: Andreas Baierl <ichgeh@imkreisrum.de>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200222024210.18697-2-yuq825@gmail.com

Qiang Yu 6ebd24b6 f019190b

+8
+3
drivers/gpu/drm/lima/lima_ctx.c
··· 27 27 if (err < 0) 28 28 goto err_out0; 29 29 30 + ctx->pid = task_pid_nr(current); 31 + get_task_comm(ctx->pname, current); 32 + 30 33 return 0; 31 34 32 35 err_out0:
+5
drivers/gpu/drm/lima/lima_ctx.h
··· 5 5 #define __LIMA_CTX_H__ 6 6 7 7 #include <linux/xarray.h> 8 + #include <linux/sched.h> 8 9 9 10 #include "lima_device.h" 10 11 ··· 14 13 struct lima_device *dev; 15 14 struct lima_sched_context context[lima_pipe_num]; 16 15 atomic_t guilty; 16 + 17 + /* debug info */ 18 + char pname[TASK_COMM_LEN]; 19 + pid_t pid; 17 20 }; 18 21 19 22 struct lima_ctx_mgr {