On 12/7/21 15:34, Eelco Chaudron wrote: > > > On 7 Dec 2021, at 15:17, Mike Pattrick wrote: > >> On Tue, Dec 7, 2021 at 8:54 AM Ilya Maximets <[email protected]> wrote: >>> >>> On 11/19/21 15:35, Mike Pattrick wrote: >>>> This commit adds a basic packet metadata macro to the already existing >>>> macros in ovs_gdb.py, ovs_dump_packets will print out information about >>>> one or more packets. It feeds packets into tcpdump, and the user can >>>> pass in tcpdump options to modify how packets are parsed or even write >>>> out packets to a pcap file. >>>> >>>> Example usage: >>>> (gdb) break fast_path_processing >>>> (gdb) commands >>>> ovs_dump_packets packets_ >>>> continue >>>> end >>>> (gdb) continue >>>> >>>> Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ... >>>> 12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has >>>> 10.1.1.1 tell 10.1.1.2, length 28 >>>> Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ... >>>> 12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1 is-at >>>> a6:0f:c3:f0:5f:bd (oui Unknown), length 28 >>> >>> Hey, Mike. Thanks for working on this! >>> >>> Could you, please, wrap some lines here in the commit message and >>> in the code? >>> >>> I mean, I think, that ideally we need to do this: >>> >>> diff --git a/utilities/automake.mk b/utilities/automake.mk >>> index e2e22c39a..7808c0ead 100644 >>> --- a/utilities/automake.mk >>> +++ b/utilities/automake.mk >>> @@ -126,6 +126,7 @@ endif >>> >>> FLAKE8_PYFILES += utilities/ovs-pcap.in \ >>> utilities/checkpatch.py utilities/ovs-dev.py \ >>> + utilities/gdb/ovs_gdb.py \ >>> utilities/ovs-check-dead-ifs.in \ >>> utilities/ovs-tcpdump.in \ >>> utilities/ovs-pipegen.py >>> --- >>> >>> But the file currently has some pep8 issues, so we can't. >>> At least, we can try to not add more warnings in a new code. >>> >>> What do you think? >> >> The change to make it fully PEP8 would be pretty small, I think only >> long lines remain. I'll resubmit with that taken care of. > > I think the long lines in the python script should remain as those are > console outputs which are displayed as part of the GDB help, and wrapping > them does not make it look good inside GDB.
There should be a way to wrap most of them without harming the looks. I mean, in some examples where lots of addresses is printed, it's enough to shorten these addresses to meet the line length limit. E.g. by keeping only 4 hex digits and, probably, changing them to something like 0xaaaa, 0xbbbb. Usage examples could probably be moved to the next line from the 'Usage:' line and maybe split by the arguments to several lines. > > This was one of my previous comments on an earlier patchset. > > //Eelco > > _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
