Skip to content
  • Ben Pfaff's avatar
    ofproto-dpif: Make ofproto/trace output easier to read. · 2d9b49dd
    Ben Pfaff authored
    
    
    "ovs-appctl ofproto/trace" is invaluable for debugging, but as the users of
    Open vSwitch have evolved it has failed to keep up with the times.  It's
    pretty easy to design OpenFlow tables and pipelines that resubmit dozens of
    times.  Each resubmit causes an additional tab of indentation, so the
    output wraps around, sometimes again and again, and makes the output close
    to unreadable.
    
    ovn-trace pioneered better formatting for tracing in OVN logical datapaths,
    mostly by not increasing indentation for tail recursion, which in practice
    gets rid of almost all indentation.
    
    This commit experiments with redoing ofproto/trace the same way.  Try
    looking at, for example, the testsuite output for test 2282 "ovn -- 3 HVs,
    3 LRs connected via LS, source IP based routes".  Without this commit, it
    indents 61 levels (488 spaces!).  With this commit, it indents 1 level
    (4 spaces) and it's possible to actually understand what's going on almost
    at a glance.
    
    To see this for yourself, try the following command either with or without
    this commit (but be sure to keep the change to ovn.at that adds an
    ofproto/trace to the test):
    make check TESTSUITEFLAGS='-d 2282' && less tests/testsuite.dir/2282/testsuite.log
    
    Signed-off-by: default avatarBen Pfaff <blp@ovn.org>
    Acked-by: default avatarLance Richardson <lrichard@redhat.com>
    Acked-by: default avatarJustin Pettit <jpettit@ovn.org>
    2d9b49dd