[ovs-dev] [PATCH 3/4] ovs-bugtool: Enhancement of bugtool plugins.

Dávid Patrik Pintér david.patrik.pinter at ericsson.com
Thu Jan 4 14:05:11 UTC 2018


Bugtool extended with NUMA related, QoS related and RHEL specific
information.

---
 utilities/bugtool/automake.mk                      |  6 +++-
 utilities/bugtool/ovs-bugtool-get-dpdk-nic-numa    | 25 ++++++++++++++
 .../bugtool/ovs-bugtool-ovs-bridge-datapath-type   | 22 +++++++++++++
 .../ovs-bugtool-ovs-vswitchd-threads-affinity      | 25 ++++++++++++++
 utilities/bugtool/ovs-bugtool-qos-configs          | 29 +++++++++++++++++
 .../bugtool/plugins/kernel-info/openvswitch.xml    |  6 ++--
 .../bugtool/plugins/network-status/openvswitch.xml | 38 +++++++++++++---------
 .../plugins/system-configuration/openvswitch.xml   | 25 ++++++++++++++
 .../bugtool/plugins/system-logs/openvswitch.xml    | 21 ++++++++++--
 9 files changed, 176 insertions(+), 21 deletions(-)
 create mode 100755 utilities/bugtool/ovs-bugtool-get-dpdk-nic-numa
 create mode 100755 utilities/bugtool/ovs-bugtool-ovs-bridge-datapath-type
 create mode 100755 utilities/bugtool/ovs-bugtool-ovs-vswitchd-threads-affinity
 create mode 100755 utilities/bugtool/ovs-bugtool-qos-configs

diff --git a/utilities/bugtool/automake.mk b/utilities/bugtool/automake.mk
index f9776a0..0c93c0c 100644
--- a/utilities/bugtool/automake.mk
+++ b/utilities/bugtool/automake.mk
@@ -18,7 +18,11 @@ bugtool_scripts = \
        utilities/bugtool/ovs-bugtool-tc-class-show \
        utilities/bugtool/ovs-bugtool-daemons-ver \
        utilities/bugtool/ovs-bugtool-ovs-ofctl-loop-over-bridges \
-       utilities/bugtool/ovs-bugtool-ovs-appctl-dpif
+       utilities/bugtool/ovs-bugtool-ovs-appctl-dpif \
+       utilities/bugtool/ovs-bugtool-ovs-bridge-datapath-type \
+       utilities/bugtool/ovs-bugtool-ovs-vswitchd-threads-affinity \
+       utilities/bugtool/ovs-bugtool-qos-configs \
+       utilities/bugtool/ovs-bugtool-get-dpdk-nic-numa
 
 scripts_SCRIPTS += $(bugtool_scripts)
 
diff --git a/utilities/bugtool/ovs-bugtool-get-dpdk-nic-numa b/utilities/bugtool/ovs-bugtool-get-dpdk-nic-numa
new file mode 100755
index 0000000..8ac6bd9
--- /dev/null
+++ b/utilities/bugtool/ovs-bugtool-get-dpdk-nic-numa
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of version 2.1 of the GNU Lesser General
+# Public License as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+#
+# Copyright (C) 2017 Ericsson AB
+
+for PCI_ADDRESS in $(lspci -D | cut -d' ' -f1)
+do
+    if [ -n "$(find /sys/bus/pci/drivers | grep drivers.*$PCI_ADDRESS | grep -e uio_pci_generic -e igb_uio -e vfio-pci)" ]
+    then
+        grep -H "" $(find /sys/devices/ -path "*$PCI_ADDRESS*numa_node")
+    fi
+done
diff --git a/utilities/bugtool/ovs-bugtool-ovs-bridge-datapath-type b/utilities/bugtool/ovs-bugtool-ovs-bridge-datapath-type
new file mode 100755
index 0000000..dfdcab0
--- /dev/null
+++ b/utilities/bugtool/ovs-bugtool-ovs-bridge-datapath-type
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of version 2.1 of the GNU Lesser General
+# Public License as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+#
+# Copyright (C) 2017 Ericsson AB
+
+for br in `ovs-vsctl -- --real list-br`
+do
+    echo bridge $br datapath_type=$(ovs-vsctl get bridge $br datapath_type)
+done
diff --git a/utilities/bugtool/ovs-bugtool-ovs-vswitchd-threads-affinity b/utilities/bugtool/ovs-bugtool-ovs-vswitchd-threads-affinity
new file mode 100755
index 0000000..2c8a57d
--- /dev/null
+++ b/utilities/bugtool/ovs-bugtool-ovs-vswitchd-threads-affinity
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of version 2.1 of the GNU Lesser General
+# Public License as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+#
+# Copyright (C) 2017 Ericsson AB
+
+for pid in $(pgrep ovs-vswitchd)
+do
+    for i in $(ls /proc/$pid/task)
+    do
+        taskset -pc $i
+    done
+done
diff --git a/utilities/bugtool/ovs-bugtool-qos-configs b/utilities/bugtool/ovs-bugtool-qos-configs
new file mode 100755
index 0000000..a4a52fb
--- /dev/null
+++ b/utilities/bugtool/ovs-bugtool-qos-configs
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of version 2.1 of the GNU Lesser General
+# Public License as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+#
+# Copyright (C) 2017 Ericsson AB
+
+for br in `ovs-vsctl -- --real list-br`
+do
+    for iface in $(ovs-vsctl list-ifaces ${br})
+    do
+        echo "Rate limiting configuration for ${iface} (of ${br}):"
+        ovs-vsctl list interface ${iface} | grep ingress
+        echo "Interface options:"
+        ovs-vsctl get Interface ${iface} options
+        echo ""
+    done
+done
diff --git a/utilities/bugtool/plugins/kernel-info/openvswitch.xml b/utilities/bugtool/plugins/kernel-info/openvswitch.xml
index c571640..34110c4 100644
--- a/utilities/bugtool/plugins/kernel-info/openvswitch.xml
+++ b/utilities/bugtool/plugins/kernel-info/openvswitch.xml
@@ -17,7 +17,7 @@
 -->
 
 <collect>
-  <files>
-    /proc/slabinfo
-  </files>
+    <files>
+        /proc/slabinfo
+    </files>
 </collect>
diff --git a/utilities/bugtool/plugins/network-status/openvswitch.xml b/utilities/bugtool/plugins/network-status/openvswitch.xml
index e5ee2a8..d8f218a 100644
--- a/utilities/bugtool/plugins/network-status/openvswitch.xml
+++ b/utilities/bugtool/plugins/network-status/openvswitch.xml
@@ -17,19 +17,27 @@
 -->
 
 <collect>
-  <command label="tc-class-show" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-tc-class-show</command>
-  <command label="ovs-vsctl-show" filters="ovs">ovs-vsctl show</command>
-  <command label="dump-ovsdb" filters="ovs">ovsdb-client -f csv dump unix:/var/run/openvswitch/db.sock Open_vSwitch</command>
-  <command label="ovs-appctl-fdb-show" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-fdb-show</command>
-  <command label="ovs-appctl-lacp-show" filters="ovs">ovs-appctl lacp/show</command>
-  <command label="ovs-appctl-cfm-show" filters="ovs">ovs-appctl cfm/show</command>
-  <command label="ovs-appctl-bfd-show" filters="ovs">ovs-appctl bfd/show</command>
-  <command label="ovs-appctl-conntrack-dump" filters="ovs">ovs-appctl dpctl/dump-conntrack</command>
-  <command label="ovs-appctl-coverage-show" filters="ovs">ovs-appctl coverage/show</command>
-  <command label="ovs-appctl-bond-show" filters="ovs">ovs-appctl bond/show</command>
-  <command label="ovs-appctl-memory-show" filters="ovs">ovs-appctl memory/show</command>
-  <command label="ovs-ofctl-show" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-ofctl-loop-over-bridges "show"</command>
-  <command label="ovs-ofctl-dump-flows" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-ofctl-loop-over-bridges "dump-flows"</command>
-  <command label="ovs-appctl-dpif" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-appctl-dpif</command>
-  <command label="ovs-appctl-list-dbs" filters="ovs">ovs-appctl -t ovsdb-server ovsdb-server/list-dbs</command>
+    <command label="tc-class-show" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-tc-class-show</command>
+    <command label="ovs-vsctl-show" filters="ovs">ovs-vsctl show</command>
+    <command label="get_other_config" filters="ovs">ovs-vsctl --no-wait get Open_vSwitch . other_config</command>
+    <command label="dump-ovsdb" filters="ovs">ovsdb-client -f csv dump unix:/var/run/openvswitch/db.sock Open_vSwitch</command>
+    <command label="ovs-appctl-fdb-show" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-fdb-show</command>
+    <command label="ovs-appctl-lacp-show" filters="ovs">ovs-appctl lacp/show</command>
+    <command label="ovs-appctl-cfm-show" filters="ovs">ovs-appctl cfm/show</command>
+    <command label="ovs-appctl-bfd-show" filters="ovs">ovs-appctl bfd/show</command>
+    <command label="ovs-appctl-conntrack-dump" filters="ovs">ovs-appctl dpctl/dump-conntrack</command>
+    <command label="ovs-appctl-coverage-show" filters="ovs">ovs-appctl coverage/show</command>
+    <command label="ovs-appctl-bond-show" filters="ovs">ovs-appctl bond/show</command>
+    <command label="ovs-appctl-memory-show" filters="ovs">ovs-appctl memory/show</command>
+    <command label="ovs-appctl-dpif" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-appctl-dpif</command>
+    <command label="ovs-appctl-list-dbs" filters="ovs">ovs-appctl -t ovsdb-server ovsdb-server/list-dbs</command>
+    <command label="ovs-appctl-dpctl-dump-flows-netdev" filters="ovs">ovs-appctl dpctl/dump-flows netdev at ovs-netdev</command>
+    <command label="ovs-appctl-dpctl-dump-flows-system" filters="ovs">ovs-appctl dpctl/dump-flows system at ovs-system</command>
+    <command label="ovs-appctl-dpctl-show-s" filters="ovs">ovs-appctl dpctl/show -s</command>
+    <command label="ovs-ofctl-show" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-ofctl-loop-over-bridges "show"</command>
+    <command label="ovs-ofctl-dump-flows" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-ofctl-loop-over-bridges "dump-flows"</command>
+    <command label="ovs-ofctl-dump-ports" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-ofctl-loop-over-bridges "dump-ports"</command>
+    <command label="ovs-ofctl-dump-groups" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-ofctl-loop-over-bridges "dump-groups"</command>
+    <command label="ovs-ofctl-dump-group-stats" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-ofctl-loop-over-bridges "dump-group-stats"</command>
+    <command label="get_dpdk_nic_numa" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-get-dpdk-nic-numa</command>
 </collect>
diff --git a/utilities/bugtool/plugins/system-configuration/openvswitch.xml b/utilities/bugtool/plugins/system-configuration/openvswitch.xml
index d1d5a1a..2791111 100644
--- a/utilities/bugtool/plugins/system-configuration/openvswitch.xml
+++ b/utilities/bugtool/plugins/system-configuration/openvswitch.xml
@@ -19,4 +19,29 @@
 <collect>
     <command label="timezone">date --rfc-3339=seconds</command>
     <command label="ovs-daemons-ver" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-daemons-ver</command>
+    <command label="dpif-show" filters="ovs">ovs-appctl dpif/show</command>
+    <command label="installed_openvswitch_debs" filters="ovs">dpkg -l | grep openvswitch</command>
+    <command label="installed_dpdk_debs" filters="ovs">dpkg -l | grep dpdk</command>
+    <command label="hugepages" filters="ovs">grep -H "" /sys/kernel/mm/hugepages/hugepages*/*</command>
+    <command label="hugepages_numa" filters="ovs">grep -H "" /sys/devices/system/node/node*/hugepages/hugepages*/*</command>
+    <command label="ovs_vswitchd_cmdline" filters="ovs">ps -C ovs-vswitchd -f</command>
+    <command label="ovsdb_server_cmdline" filters="ovs">ps -C ovsdb-server -f</command>
+    <command label="ovs_vswitchd_threads" filters="ovs">ps H -C ovs-vswitchd -o 'pid tid cmd comm'</command>
+    <command label="ovs_rundir_ls-la" filters="ovs">ls -la /var/run/openvswitch/</command>
+    <command label="open_files_lsof-U" filters="ovs">lsof -U</command>
+    <command label="ovs_version" filters="ovs">ovs-vsctl --version</command>
+    <command label="virsh_list" filters="ovs">virsh list --all</command>
+    <command label="pmd-rxq-show" filters="ovs">ovs-appctl dpif-netdev/pmd-rxq-show</command>
+    <command label="lscpu" filters="ovs">lscpu</command>
+    <command label="ovs_vswitchd_threads_affinity" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-vswitchd-threads-affinity</command>
+    <command label="ovs_bridge_datapath_type" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-ovs-bridge-datapath-type</command>
+    <command label="qos_configs" filters="ovs">/usr/share/openvswitch/scripts/ovs-bugtool-qos-configs</command>
+    <files filters="ovs">
+        /etc/default/openvswitch-switch
+        /etc/default/qemu-kvm
+        /etc/init/openvswitch-switch.conf
+        /etc/init/ovs-delay.conf
+        /etc/init.d/openvswitch-switch
+        /usr/share/openvswitch/scripts/ovs-ctl
+    </files>
 </collect>
diff --git a/utilities/bugtool/plugins/system-logs/openvswitch.xml b/utilities/bugtool/plugins/system-logs/openvswitch.xml
index 354af34..46c7318 100644
--- a/utilities/bugtool/plugins/system-logs/openvswitch.xml
+++ b/utilities/bugtool/plugins/system-logs/openvswitch.xml
@@ -17,6 +17,23 @@
 -->
 
 <collect>
-  <directory label="ovsdb-backups" filters="ovs" pattern=".*/conf.db.backup[0-9][^/]*$">/etc/openvswitch</directory>
-  <directory label="ovsdb-backups2" filters="ovs" pattern=".*/conf.db.backup[0-9][^/]*$">/var/lib/openvswitch</directory>
+    <directory label="ovsdb-backups" filters="ovs" pattern=".*/conf.db.backup[0-9][^/]*$">/etc/openvswitch</directory>
+    <directory label="ovsdb-backups2" filters="ovs" pattern=".*/conf.db.backup[0-9][^/]*$">/var/lib/openvswitch</directory>
+    <command label="system_memory_status" filters="ovs">df -h</command>
+    <command label="check_number_of_pmds" filters="ovs">ovs-appctl dpif-netdev/pmd-stats-show | grep pmd</command>
+    <command label="ovs-appctl-vlog-list" filters="ovs">ovs-appctl vlog/list</command>
+    <command label="journalctl" filters="ovs">journalctl</command>
+    <command label="user_limits" filters="ovs">ulimit -a</command>
+    <files filters="ovs">
+        /var/log/syslog
+        /var/log/daemon.log
+        /var/log/upstart/libvirt-bin.log
+        /var/log/upstart/ndevalarm.log
+        /var/log/upstart/nova-compute.log
+        /var/log/upstart/neutron-plugin-openvswitch-agent.log
+        /var/log/upstart/openvswitch-switch.log
+        /var/log/messages*
+        /var/log/secure
+        /var/log/dmesg*
+    </files>
 </collect>
-- 
2.7.4


More information about the dev mailing list