gpu: nvgpu: Cleanup uart and debugfs debug prints

The gk20a_debug_dump() function implicitly adds a newline since it
uses nvgpu_err() under the hood (for uart destined prints). For the
seq_file destined writes it does not so there is an annoying inconsistency.

Remove the newline that many of the gk20a_debug_dump() calls add and add
the newline to the (now) seq_printf() call. This reduces the length of
debug dump logs and speeds them up - UART is _very_ slow after all.

Also cleanup some formatting issues in the various debug prints I
happened to notice.

JIRA NVGPU-5541

Change-Id: Iabf853d5c50214794fc4cbb602dfffabeb877132
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2347956
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Alex Waterman
2020-05-20 11:21:28 -05:00
parent f2d424d452
commit 5d06a59bc5
8 changed files with 236 additions and 240 deletions

View File

@@ -39,29 +39,26 @@
unsigned int gk20a_debug_trace_cmdbuf;
static inline void gk20a_debug_write_printk(void *ctx, const char *str,
size_t len)
static inline void gk20a_debug_write_printk(void *ctx, const char *str)
{
struct gk20a *g = ctx;
nvgpu_err(g, str);
}
static inline void gk20a_debug_write_to_seqfile(void *ctx, const char *str,
size_t len)
static inline void gk20a_debug_write_to_seqfile(void *ctx, const char *str)
{
seq_write((struct seq_file *)ctx, str, len);
seq_printf((struct seq_file *)ctx, "%s\n", str);
}
void gk20a_debug_output(struct nvgpu_debug_context *o, const char *fmt, ...)
{
va_list args;
int len;
va_start(args, fmt);
len = vsnprintf(o->buf, sizeof(o->buf), fmt, args);
vsnprintf(o->buf, sizeof(o->buf), fmt, args);
va_end(args);
o->fn(o->ctx, o->buf, len);
o->fn(o->ctx, o->buf);
}
void gk20a_debug_show_dump(struct gk20a *g, struct nvgpu_debug_context *o)