diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2018-03-13 07:29:46 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-03-13 12:55:10 -0400 |
commit | 4826bddfc40506b72378b6eed6ca5b86fbdf1a7f (patch) | |
tree | 051086b6372e66c6cc5fc443491043d6b5c876a0 /drivers/gpu/nvgpu/common/linux | |
parent | 07a9ceef77dd6f05ef704686deea69a8b4a9e724 (diff) |
gpu: nvgpu: use also normal logging with TRACE_PRINTK
When CONFIG_GK20A_TRACE_PRINTK is set to support printing to ftrace log
instead of the normal kernel log, but log_trace from debugfs is not set,
fall back to normal kernel logging instead of not logging anything.
Change-Id: I553baed20a52108229dbcc5c63e8af4e1bcd1b30
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1674250
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/log.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/log.c b/drivers/gpu/nvgpu/common/linux/log.c index e120a3de..01d3add1 100644 --- a/drivers/gpu/nvgpu/common/linux/log.c +++ b/drivers/gpu/nvgpu/common/linux/log.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -60,10 +60,8 @@ static inline const char *nvgpu_log_name(struct gk20a *g) | |||
60 | #ifdef CONFIG_GK20A_TRACE_PRINTK | 60 | #ifdef CONFIG_GK20A_TRACE_PRINTK |
61 | static void __nvgpu_trace_printk_log(u32 trace, const char *gpu_name, | 61 | static void __nvgpu_trace_printk_log(u32 trace, const char *gpu_name, |
62 | const char *func_name, int line, | 62 | const char *func_name, int line, |
63 | enum nvgpu_log_type type, const char *log) | 63 | const char *log_type, const char *log) |
64 | { | 64 | { |
65 | const char *log_type = log_types[type]; | ||
66 | |||
67 | trace_printk(LOG_FMT, gpu_name, func_name, line, log_type, log); | 65 | trace_printk(LOG_FMT, gpu_name, func_name, line, log_type, log); |
68 | } | 66 | } |
69 | #endif | 67 | #endif |
@@ -73,14 +71,13 @@ static void __nvgpu_really_print_log(u32 trace, const char *gpu_name, | |||
73 | enum nvgpu_log_type type, const char *log) | 71 | enum nvgpu_log_type type, const char *log) |
74 | { | 72 | { |
75 | const char *name = gpu_name ? gpu_name : ""; | 73 | const char *name = gpu_name ? gpu_name : ""; |
74 | const char *log_type = log_types[type]; | ||
76 | 75 | ||
77 | #ifdef CONFIG_GK20A_TRACE_PRINTK | 76 | #ifdef CONFIG_GK20A_TRACE_PRINTK |
78 | if (trace) | 77 | if (trace) |
79 | return __nvgpu_trace_printk_log(trace, name, func_name, | 78 | return __nvgpu_trace_printk_log(trace, name, func_name, |
80 | line, type, log); | 79 | line, log_type, log); |
81 | #else | 80 | #endif |
82 | const char *log_type = log_types[type]; | ||
83 | |||
84 | switch (type) { | 81 | switch (type) { |
85 | case NVGPU_DEBUG: | 82 | case NVGPU_DEBUG: |
86 | /* | 83 | /* |
@@ -100,7 +97,6 @@ static void __nvgpu_really_print_log(u32 trace, const char *gpu_name, | |||
100 | pr_err(LOG_FMT, name, func_name, line, log_type, log); | 97 | pr_err(LOG_FMT, name, func_name, line, log_type, log); |
101 | break; | 98 | break; |
102 | } | 99 | } |
103 | #endif | ||
104 | } | 100 | } |
105 | 101 | ||
106 | __attribute__((format (printf, 5, 6))) | 102 | __attribute__((format (printf, 5, 6))) |