• Douglas Anderson's avatar
    tracing: kdb: Allow ftdump to skip all but the last few entries · 03197fc0
    Douglas Anderson authored
    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.orgSigned-off-by: default avatarDouglas Anderson <dianders@chromium.org>
    Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    03197fc0
trace_kdb.c 3.6 KB