Currently, ovs_dump_packets will break the formatting of the GDB
terminal UI, resulting in artifacts displayed on the screen that
may make packets difficult to read. This patch suppresses stderr
output from tcpdump and feeds tcpdumps stdout into the paginated
output stream.

Signed-off-by: Mike Pattrick <[email protected]>
---
 utilities/gdb/ovs_gdb.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utilities/gdb/ovs_gdb.py b/utilities/gdb/ovs_gdb.py
index 62928d50f..763ece2a7 100644
--- a/utilities/gdb/ovs_gdb.py
+++ b/utilities/gdb/ovs_gdb.py
@@ -1391,7 +1391,8 @@ class CmdDumpPackets(gdb.Command):
             print("Error, unsupported argument type: {}".format(str(val.type)))
             return
 
-        tcpdump(pkt_list, args=tcpdump_args)
+        stdout = tcpdump(pkt_list, args=tcpdump_args, getfd=True, quiet=True)
+        gdb.write(stdout.read().decode("utf8", "replace"))
 
     def extract_pkt(self, pkt):
         pkt_fields = pkt.type.keys()
-- 
2.27.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to