tracing: kdb: Allow ftdump to skip all but the last few entries
authorDouglas Anderson <dianders@chromium.org>
Tue, 19 Mar 2019 17:12:06 +0000 (10:12 -0700)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 3 May 2019 01:32:55 +0000 (21:32 -0400)
commit03197fc02b356606355d7ede343b18e3e3737771
tree5641f5a8bc09f64d7c3c39d0d74e76a55a176107
parentecffc8a8c7301f6f3c731ba23e38cd049a046416
tracing: kdb: Allow ftdump to skip all but the last few entries

The 'ftdump' command in kdb is currently a bit of a last resort, at
least if you have lots of traces turned on.  It's going to print a
whole boatload of data out your serial port which is probably running
at 115200.  This could easily take many, many minutes.

Usually you're most interested in what's at the _end_ of the ftrace
buffer, AKA what happened most recently.  That means you've got to
wait the full time for the dump.  The 'ftdump' command does attempt to
help you a little bit by allowing you to skip a fixed number of
entries.  Unfortunately it provides no way for you to know how many
entries you should skip.

Let's do similar to python and allow you to use a negative number to
indicate that you want to skip all entries except the last few.  This
allows you to quickly see what you want.

Note that we also change the printout in ftdump to print the
(positive) number of entries actually skipped since that could be
helpful to know when you've specified a negative skip count.

Link: http://lkml.kernel.org/r/20190319171206.97107-3-dianders@chromium.org
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_kdb.c