diff options
-rw-r--r-- | drivers/gpu/nvgpu/common/posix/nvgpu.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/os_sched.h | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/channel.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/os_sched.c | 6 |
4 files changed, 26 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/posix/nvgpu.c b/drivers/gpu/nvgpu/common/posix/nvgpu.c index 6f2a5fe9..a275f2de 100644 --- a/drivers/gpu/nvgpu/common/posix/nvgpu.c +++ b/drivers/gpu/nvgpu/common/posix/nvgpu.c | |||
@@ -67,6 +67,13 @@ int nvgpu_current_tid(struct gk20a *g) | |||
67 | return (int)pthread_self(); | 67 | return (int)pthread_self(); |
68 | } | 68 | } |
69 | 69 | ||
70 | void __nvgpu_print_current(struct gk20a *g, const char *func_name, int line, | ||
71 | void *ctx, enum nvgpu_log_type type) | ||
72 | { | ||
73 | __nvgpu_log_msg(g, func_name, line, type, | ||
74 | "Current process: (nvgpu userspace)"); | ||
75 | } | ||
76 | |||
70 | /* | 77 | /* |
71 | * Somewhat meaningless in userspace... | 78 | * Somewhat meaningless in userspace... |
72 | */ | 79 | */ |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/os_sched.h b/drivers/gpu/nvgpu/include/nvgpu/os_sched.h index 97dc9a57..d1e44b06 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/os_sched.h +++ b/drivers/gpu/nvgpu/include/nvgpu/os_sched.h | |||
@@ -23,6 +23,8 @@ | |||
23 | #ifndef __NVGPU_OS_SCHED_H__ | 23 | #ifndef __NVGPU_OS_SCHED_H__ |
24 | #define __NVGPU_OS_SCHED_H__ | 24 | #define __NVGPU_OS_SCHED_H__ |
25 | 25 | ||
26 | #include <nvgpu/log.h> | ||
27 | |||
26 | struct gk20a; | 28 | struct gk20a; |
27 | 29 | ||
28 | /** | 30 | /** |
@@ -37,4 +39,13 @@ int nvgpu_current_tid(struct gk20a *g); | |||
37 | */ | 39 | */ |
38 | int nvgpu_current_pid(struct gk20a *g); | 40 | int nvgpu_current_pid(struct gk20a *g); |
39 | 41 | ||
42 | void __nvgpu_print_current(struct gk20a *g, const char *func_name, int line, | ||
43 | void *ctx, enum nvgpu_log_type type); | ||
44 | /** | ||
45 | * nvgpu_print_current - print the name of current calling process | ||
46 | * | ||
47 | */ | ||
48 | #define nvgpu_print_current(g, ctx, type) \ | ||
49 | __nvgpu_print_current(g, __func__, __LINE__, ctx, type) | ||
50 | |||
40 | #endif /* __NVGPU_OS_SCHED_H__ */ | 51 | #endif /* __NVGPU_OS_SCHED_H__ */ |
diff --git a/drivers/gpu/nvgpu/os/linux/channel.c b/drivers/gpu/nvgpu/os/linux/channel.c index e09939e9..cc2d525d 100644 --- a/drivers/gpu/nvgpu/os/linux/channel.c +++ b/drivers/gpu/nvgpu/os/linux/channel.c | |||
@@ -890,8 +890,8 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
890 | err = gk20a_busy(g); | 890 | err = gk20a_busy(g); |
891 | if (err) { | 891 | if (err) { |
892 | nvgpu_err(g, | 892 | nvgpu_err(g, |
893 | "failed to host gk20a to submit gpfifo, process %s", | 893 | "failed to host gk20a to submit gpfifo"); |
894 | current->comm); | 894 | nvgpu_print_current(g, NULL, NVGPU_ERROR); |
895 | return err; | 895 | return err; |
896 | } | 896 | } |
897 | } | 897 | } |
diff --git a/drivers/gpu/nvgpu/os/linux/os_sched.c b/drivers/gpu/nvgpu/os/linux/os_sched.c index 586b35eb..9a25da18 100644 --- a/drivers/gpu/nvgpu/os/linux/os_sched.c +++ b/drivers/gpu/nvgpu/os/linux/os_sched.c | |||
@@ -24,3 +24,9 @@ int nvgpu_current_pid(struct gk20a *g) | |||
24 | { | 24 | { |
25 | return current->tgid; | 25 | return current->tgid; |
26 | } | 26 | } |
27 | |||
28 | void __nvgpu_print_current(struct gk20a *g, const char *func_name, int line, | ||
29 | void *ctx, enum nvgpu_log_type type) | ||
30 | { | ||
31 | __nvgpu_log_msg(g, func_name, line, type, current->comm); | ||
32 | } | ||