Skip to content

Commit

Permalink
utilities: Add some GDB macros for ovs-vswitchd
Browse files Browse the repository at this point in the history
This commit adds basic GDB macro's for ovs-vswitchd:
  - ovs_dump_bridge [ports|wanted]
  - ovs_dump_bridge_ports <struct bridge *>
  - ovs_dump_dp_netdev [ports]
  - ovs_dump_dp_netdev_ports <struct dp_netdev *>
  - ovs_dump_netdev

These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:

(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev     , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0    , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0          , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0         , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0          , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3            , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0         , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>

(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
  reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}

Signed-off-by: Eelco Chaudron <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
chaudron authored and blp committed May 9, 2018
1 parent 2c00b26 commit 0a3348d
Show file tree
Hide file tree
Showing 3 changed files with 410 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Documentation/tutorials/ovs-advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ can be passed via the ``SANDBOXFLAGS`` environment variable. ``make sandbox
SANDBOXFLAGS=-g`` will start the sandbox with ovs-vswitchd running under GDB in
its own xterm if X is available.

In addition, a set of GDB macros are available in ``utilities/gdb/ovs_gdb.py``.
Which are able to dump various internal data structures. See the header of the
file itself for some more details and an example.

Motivation
----------

Expand Down
1 change: 1 addition & 0 deletions utilities/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ noinst_SCRIPTS += utilities/ovs-sim
utilities/ovs-lib: $(top_builddir)/config.status

EXTRA_DIST += \
utilities/gdb/ovs_gdb.py \
utilities/ovs-appctl-bashcomp.bash \
utilities/ovs-check-dead-ifs.in \
utilities/ovs-ctl.in \
Expand Down
Loading

0 comments on commit 0a3348d

Please sign in to comment.