Commit dbfe6733 authored by Douglas Anderson's avatar Douglas Anderson Committed by Steven Rostedt (VMware)

tracing: kdb: The skip_lines parameter should have been skip_entries

The things skipped by kdb's "ftdump" command when you pass it a
parameter has always been entries, not lines.  The difference usually
doesn't matter but when the trace buffer has multi-line entries (like
a stack dump) it can matter.

Let's fix this both in the help text for ftdump and also in the local
variable names.

Link: http://lkml.kernel.org/r/20190319171206.97107-1-dianders@chromium.orgAcked-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent e8025bab
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "trace.h" #include "trace.h"
#include "trace_output.h" #include "trace_output.h"
static void ftrace_dump_buf(int skip_lines, long cpu_file) static void ftrace_dump_buf(int skip_entries, long cpu_file)
{ {
/* use static because iter can be a bit big for the stack */ /* use static because iter can be a bit big for the stack */
static struct trace_iterator iter; static struct trace_iterator iter;
...@@ -70,11 +70,11 @@ static void ftrace_dump_buf(int skip_lines, long cpu_file) ...@@ -70,11 +70,11 @@ static void ftrace_dump_buf(int skip_lines, long cpu_file)
kdb_printf("---------------------------------\n"); kdb_printf("---------------------------------\n");
cnt++; cnt++;
if (!skip_lines) { if (!skip_entries) {
print_trace_line(&iter); print_trace_line(&iter);
trace_printk_seq(&iter.seq); trace_printk_seq(&iter.seq);
} else { } else {
skip_lines--; skip_entries--;
} }
if (KDB_FLAG(CMD_INTERRUPT)) if (KDB_FLAG(CMD_INTERRUPT))
...@@ -106,7 +106,7 @@ static void ftrace_dump_buf(int skip_lines, long cpu_file) ...@@ -106,7 +106,7 @@ static void ftrace_dump_buf(int skip_lines, long cpu_file)
*/ */
static int kdb_ftdump(int argc, const char **argv) static int kdb_ftdump(int argc, const char **argv)
{ {
int skip_lines = 0; int skip_entries = 0;
long cpu_file; long cpu_file;
char *cp; char *cp;
...@@ -114,9 +114,9 @@ static int kdb_ftdump(int argc, const char **argv) ...@@ -114,9 +114,9 @@ static int kdb_ftdump(int argc, const char **argv)
return KDB_ARGCOUNT; return KDB_ARGCOUNT;
if (argc) { if (argc) {
skip_lines = simple_strtol(argv[1], &cp, 0); skip_entries = simple_strtol(argv[1], &cp, 0);
if (*cp) if (*cp)
skip_lines = 0; skip_entries = 0;
} }
if (argc == 2) { if (argc == 2) {
...@@ -129,7 +129,7 @@ static int kdb_ftdump(int argc, const char **argv) ...@@ -129,7 +129,7 @@ static int kdb_ftdump(int argc, const char **argv)
} }
kdb_trap_printk++; kdb_trap_printk++;
ftrace_dump_buf(skip_lines, cpu_file); ftrace_dump_buf(skip_entries, cpu_file);
kdb_trap_printk--; kdb_trap_printk--;
return 0; return 0;
...@@ -137,7 +137,7 @@ static int kdb_ftdump(int argc, const char **argv) ...@@ -137,7 +137,7 @@ static int kdb_ftdump(int argc, const char **argv)
static __init int kdb_ftrace_register(void) static __init int kdb_ftrace_register(void)
{ {
kdb_register_flags("ftdump", kdb_ftdump, "[skip_#lines] [cpu]", kdb_register_flags("ftdump", kdb_ftdump, "[skip_#entries] [cpu]",
"Dump ftrace log", 0, KDB_ENABLE_ALWAYS_SAFE); "Dump ftrace log", 0, KDB_ENABLE_ALWAYS_SAFE);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment