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>
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
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This adds the ovs_dump_ifpacts command:
(gdb) help ovs_dump_ofpacts
Dump all actions in an ofpacts set
Usage: ovs_dump_ofpacts <struct ofpact *> <ofpacts_len>
<struct ofpact *> : Pointer to set of ofpact structures.
<ofpacts_len> : Total length of the set.
Example dumping all actions when in the clone_xlate_actions() function:
(gdb) ovs_dump_ofpacts actions actions_len
(struct ofpact *) 0x561c7be487c8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487e0: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487f8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48810: {type = OFPACT_SET_FIELD, raw = 255 '', len = 32}
(struct ofpact *) 0x561c7be48830: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48848: {type = OFPACT_RESUBMIT, raw = 38 '&', len = 16}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: William Tu <u9012063@gmail.com>
Since Python 2 support was removed in 1ca0323e7c29 ("Require Python 3 and
remove support for Python 2."), python3-six is not needed anymore.
Moreover python3-six is not available on RHEL/CentOS7 without using EPEL
and so this patch is needed in order to release OVS 2.13 on RHEL7.
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Fix minor typos in ovs_gdb debug script.
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Andreas Karis <akaris@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Newer versions of Python require a different iterator function. This
change will make the iterator classes work with all Python versions.
Adds a fix for python3 as it does not support the long() type.
The fix guaranties the script still works on Python 2.7.
The uKey walker is rather slow on python3, so added a spinner to
indicate we are still busy processing entries.
Fix functions using the iterkeys() function on dictionaries.
Tested-by: solomon <liwei.solomon@gmail.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This patch updates the GDB script "ovs_show_fdb" command to include
the new per mac_learning instance counters.
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This change adds the ovs_dump_dp_provider command, which allows
dumping of all the registered registered_dpif_class structures.
In addition it has some small internal cleanups.
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Adds back-end support for walking ovs cmaps, and the following
commands to the gdb script:
- Dump all poll_thread info added to a specific struct dp_netdev*.
Usage: ovs_dump_dp_netdev_poll_threads <struct dp_netdev *>
- Dump all nodes of an ovs_list:
Usage: ovs_dump_ovs_list <struct ovs_list *> {[<structure>] [<member>] {dump}]}
For example dump all the none quiescent OvS RCU threads:
(gdb) ovs_dump_ovs_list &ovsrcu_threads
(struct ovs_list *) 0x7f2a14000900
(struct ovs_list *) 0x7f2acc000900
(struct ovs_list *) 0x7f2a680668d0
This is not very useful, so please use this with the container_of mode:
(gdb) ovs_dump_ovs_list &ovsrcu_threads 'struct ovsrcu_perthread' list_node
(struct ovsrcu_perthread *) 0x7f2a14000900
(struct ovsrcu_perthread *) 0x7f2acc000900
(struct ovsrcu_perthread *) 0x7f2a680668d0
Now you can manually use the print command to show the content, or use the
dump option to dump the structure for all nodes:
(gdb) ovs_dump_ovs_list &ovsrcu_threads 'struct ovsrcu_perthread' list_node dump
(struct ovsrcu_perthread *) 0x7f2a14000900 =
{list_node = {prev = 0xf48e80 <ovsrcu_threads>, next = 0x7f2acc000900}, mutex...
(struct ovsrcu_perthread *) 0x7f2acc000900 =
{list_node = {prev = 0x7f2a14000900, next = 0x7f2a680668d0}, mutex ...
(struct ovsrcu_perthread *) 0x7f2a680668d0 =
{list_node = {prev = 0x7f2acc000900, next = 0xf48e80 <ovsrcu_threads>}, ...
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>