diff options
author | Mike Pattrick <mkp@redhat.com> | 2022-04-29 16:03:02 -0400 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-05-04 21:44:59 +0200 |
commit | b3bbfc17294ee55bb48ef4693dca8afbe3e1e077 (patch) | |
tree | bfea0704aeb2d06313390dab3273785aea61c72b /utilities/gdb/ovs_gdb.py | |
parent | dd4d8e34ba5d246112a267e913339d28fb984223 (diff) | |
download | openvswitch-b3bbfc17294ee55bb48ef4693dca8afbe3e1e077.tar.gz |
utilities: Handle dumping packets in GDB TUI.
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 <mkp@redhat.com>
Acked-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'utilities/gdb/ovs_gdb.py')
-rw-r--r-- | utilities/gdb/ovs_gdb.py | 3 |
1 files changed, 2 insertions, 1 deletions
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() |