From 4826bddfc40506b72378b6eed6ca5b86fbdf1a7f Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 13 Mar 2018 13:29:46 +0200 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1674250 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/log.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'drivers/gpu/nvgpu/common') 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 @@ /* - * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * 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) #ifdef CONFIG_GK20A_TRACE_PRINTK static void __nvgpu_trace_printk_log(u32 trace, const char *gpu_name, const char *func_name, int line, - enum nvgpu_log_type type, const char *log) + const char *log_type, const char *log) { - const char *log_type = log_types[type]; - trace_printk(LOG_FMT, gpu_name, func_name, line, log_type, log); } #endif @@ -73,14 +71,13 @@ static void __nvgpu_really_print_log(u32 trace, const char *gpu_name, enum nvgpu_log_type type, const char *log) { const char *name = gpu_name ? gpu_name : ""; + const char *log_type = log_types[type]; #ifdef CONFIG_GK20A_TRACE_PRINTK if (trace) return __nvgpu_trace_printk_log(trace, name, func_name, - line, type, log); -#else - const char *log_type = log_types[type]; - + line, log_type, log); +#endif switch (type) { case NVGPU_DEBUG: /* @@ -100,7 +97,6 @@ static void __nvgpu_really_print_log(u32 trace, const char *gpu_name, pr_err(LOG_FMT, name, func_name, line, log_type, log); break; } -#endif } __attribute__((format (printf, 5, 6))) -- cgit v1.2.2