[ovs-dev] [PATCH 01/13] bfd: Remove leading tabs from output.

Ben Pfaff blp at ovn.org
Mon Jun 4 21:27:38 UTC 2018


OVS uses spaces for indentation in source code and it makes sense for it to
also use spaces for indentation in output.  Spaces also consume less
horizontal space in output, which often makes it easier to read.  This
commit transitions one part of output from tabs to spaces and updates
appropriate parts of the tests to match.

Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 lib/bfd.c             | 54 +++++++++++++++++++++++++--------------------------
 tests/bfd.at          | 32 +++++++++++++++---------------
 tests/ofproto-dpif.at | 16 +++++++--------
 3 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/lib/bfd.c b/lib/bfd.c
index 55b7453d15e8..530826240c71 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -1085,13 +1085,13 @@ log_msg(enum vlog_level level, const struct msg *p, const char *message,
 
     ds_put_format(&ds,
                   "%s: %s."
-                  "\n\tvers:%d diag:\"%s\" state:%s mult:%"PRIu8
+                  "\n  vers:%d diag:\"%s\" state:%s mult:%"PRIu8
                   " length:%"PRIu8
-                  "\n\tflags: %s"
-                  "\n\tmy_disc:0x%"PRIx32" your_disc:0x%"PRIx32
-                  "\n\tmin_tx:%"PRIu32"us (%"PRIu32"ms)"
-                  "\n\tmin_rx:%"PRIu32"us (%"PRIu32"ms)"
-                  "\n\tmin_rx_echo:%"PRIu32"us (%"PRIu32"ms)",
+                  "\n  flags: %s"
+                  "\n  my_disc:0x%"PRIx32" your_disc:0x%"PRIx32
+                  "\n  min_tx:%"PRIu32"us (%"PRIu32"ms)"
+                  "\n  min_rx:%"PRIu32"us (%"PRIu32"ms)"
+                  "\n  min_rx_echo:%"PRIu32"us (%"PRIu32"ms)",
                   bfd->name, message, p->vers_diag >> VERS_SHIFT,
                   bfd_diag_str(p->vers_diag & DIAG_MASK),
                   bfd_state_str(p->flags & STATE_MASK),
@@ -1254,45 +1254,45 @@ bfd_find_by_name(const char *name) OVS_REQUIRES(mutex)
 static void
 bfd_put_details(struct ds *ds, const struct bfd *bfd) OVS_REQUIRES(mutex)
 {
-    ds_put_format(ds, "\tForwarding: %s\n",
+    ds_put_format(ds, "  Forwarding: %s\n",
                   bfd_forwarding__(CONST_CAST(struct bfd *, bfd))
                   ? "true" : "false");
-    ds_put_format(ds, "\tDetect Multiplier: %d\n", bfd->mult);
-    ds_put_format(ds, "\tConcatenated Path Down: %s\n",
+    ds_put_format(ds, "  Detect Multiplier: %d\n", bfd->mult);
+    ds_put_format(ds, "  Concatenated Path Down: %s\n",
                   bfd->cpath_down ? "true" : "false");
-    ds_put_format(ds, "\tTX Interval: Approx %lldms\n", bfd_tx_interval(bfd));
-    ds_put_format(ds, "\tRX Interval: Approx %lldms\n", bfd_rx_interval(bfd));
-    ds_put_format(ds, "\tDetect Time: now %+lldms\n",
+    ds_put_format(ds, "  TX Interval: Approx %lldms\n", bfd_tx_interval(bfd));
+    ds_put_format(ds, "  RX Interval: Approx %lldms\n", bfd_rx_interval(bfd));
+    ds_put_format(ds, "  Detect Time: now %+lldms\n",
                   bfd->detect_time - time_msec());
-    ds_put_format(ds, "\tNext TX Time: now %+lldms\n",
+    ds_put_format(ds, "  Next TX Time: now %+lldms\n",
                   bfd->next_tx -time_msec());
-    ds_put_format(ds, "\tLast TX Time: now %+lldms\n",
+    ds_put_format(ds, "  Last TX Time: now %+lldms\n",
                   bfd->last_tx - time_msec());
 
     ds_put_cstr(ds, "\n");
 
-    ds_put_format(ds, "\tLocal Flags: %s\n", bfd_flag_str(bfd->flags));
-    ds_put_format(ds, "\tLocal Session State: %s\n",
+    ds_put_format(ds, "  Local Flags: %s\n", bfd_flag_str(bfd->flags));
+    ds_put_format(ds, "  Local Session State: %s\n",
                   bfd_state_str(bfd->state));
-    ds_put_format(ds, "\tLocal Diagnostic: %s\n", bfd_diag_str(bfd->diag));
-    ds_put_format(ds, "\tLocal Discriminator: 0x%"PRIx32"\n", bfd->disc);
-    ds_put_format(ds, "\tLocal Minimum TX Interval: %lldms\n",
+    ds_put_format(ds, "  Local Diagnostic: %s\n", bfd_diag_str(bfd->diag));
+    ds_put_format(ds, "  Local Discriminator: 0x%"PRIx32"\n", bfd->disc);
+    ds_put_format(ds, "  Local Minimum TX Interval: %lldms\n",
                   bfd_min_tx(bfd));
-    ds_put_format(ds, "\tLocal Minimum RX Interval: %lldms\n", bfd->min_rx);
+    ds_put_format(ds, "  Local Minimum RX Interval: %lldms\n", bfd->min_rx);
 
     ds_put_cstr(ds, "\n");
 
-    ds_put_format(ds, "\tRemote Flags: %s\n", bfd_flag_str(bfd->rmt_flags));
-    ds_put_format(ds, "\tRemote Session State: %s\n",
+    ds_put_format(ds, "  Remote Flags: %s\n", bfd_flag_str(bfd->rmt_flags));
+    ds_put_format(ds, "  Remote Session State: %s\n",
                   bfd_state_str(bfd->rmt_state));
-    ds_put_format(ds, "\tRemote Diagnostic: %s\n",
+    ds_put_format(ds, "  Remote Diagnostic: %s\n",
                   bfd_diag_str(bfd->rmt_diag));
-    ds_put_format(ds, "\tRemote Discriminator: 0x%"PRIx32"\n", bfd->rmt_disc);
-    ds_put_format(ds, "\tRemote Minimum TX Interval: %lldms\n",
+    ds_put_format(ds, "  Remote Discriminator: 0x%"PRIx32"\n", bfd->rmt_disc);
+    ds_put_format(ds, "  Remote Minimum TX Interval: %lldms\n",
                   bfd->rmt_min_tx);
-    ds_put_format(ds, "\tRemote Minimum RX Interval: %lldms\n",
+    ds_put_format(ds, "  Remote Minimum RX Interval: %lldms\n",
                   bfd->rmt_min_rx);
-    ds_put_format(ds, "\tRemote Detect Multiplier: %d\n", bfd->rmt_mult);
+    ds_put_format(ds, "  Remote Detect Multiplier: %d\n", bfd->rmt_mult);
 }
 
 static void
diff --git a/tests/bfd.at b/tests/bfd.at
index ba912b5683b8..b0b7a2f9fe27 100644
--- a/tests/bfd.at
+++ b/tests/bfd.at
@@ -3,34 +3,34 @@ AT_BANNER([bfd])
 m4_define([BFD_CHECK], [
 AT_CHECK([ovs-appctl bfd/show $1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'| sed -e '/Multiplier/d'],[0],
 [dnl
-	Forwarding: $2
-	Concatenated Path Down: $3
+  Forwarding: $2
+  Concatenated Path Down: $3
 
-	Local Flags: $4
-	Local Session State: $5
-	Local Diagnostic: $6
+  Local Flags: $4
+  Local Session State: $5
+  Local Diagnostic: $6
 
-	Remote Flags: $7
-	Remote Session State: $8
-	Remote Diagnostic: $9
+  Remote Flags: $7
+  Remote Session State: $8
+  Remote Diagnostic: $9
 ])
 ])
 
 m4_define([BFD_CHECK_TX], [
 AT_CHECK([ovs-appctl bfd/show $1 | sed -n '/TX Interval/p'],[0],
 [dnl
-	TX Interval: Approx $2
-	Local Minimum TX Interval: $3
-	Remote Minimum TX Interval: $4
+  TX Interval: Approx $2
+  Local Minimum TX Interval: $3
+  Remote Minimum TX Interval: $4
 ])
 ])
 
 m4_define([BFD_CHECK_RX], [
 AT_CHECK([ovs-appctl bfd/show $1 | sed -n '/RX Interval/p'],[0],
 [dnl
-	RX Interval: Approx $2
-	Local Minimum RX Interval: $3
-	Remote Minimum RX Interval: $4
+  RX Interval: Approx $2
+  Local Minimum RX Interval: $3
+  Remote Minimum RX Interval: $4
 ])
 ])
 
@@ -44,8 +44,8 @@ $3
 m4_define([BFD_CHECK_MULT], [
 AT_CHECK([ovs-appctl bfd/show $1 | sed -n '/Detect Multiplier/p'],[0],
 [dnl
-	Detect Multiplier: $2
-	Remote Detect Multiplier: $3
+  Detect Multiplier: $2
+  Remote Detect Multiplier: $3
 ])
 ])
 
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 00ab97bf63ac..656cdd8446ab 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -8594,10 +8594,10 @@ AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
 ])
 # bfd/show should show 'up'.
 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
-	Local Session State: up
-	Remote Session State: up
-	Local Session State: up
-	Remote Session State: up
+  Local Session State: up
+  Remote Session State: up
+  Local Session State: up
+  Remote Session State: up
 ])
 # bond/show should show 'may-enable: true' for all slaves.
 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
@@ -8617,8 +8617,8 @@ AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
 ])
 # bfd/show should show 'down'.
 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
-	Local Session State: down
-	Remote Session State: down
+  Local Session State: down
+  Remote Session State: down
 ])
 # bond/show should show 'may-enable: false' for p0.
 AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
@@ -8637,8 +8637,8 @@ AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
 ])
 # bfd/show should show 'down'.
 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
-	Local Session State: down
-	Remote Session State: down
+  Local Session State: down
+  Remote Session State: down
 ])
 # bond/show should show 'may-enable: false' for p0 and p1.
 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
-- 
2.16.1



More information about the dev mailing list