The ovs-parse-backtrace script was supposed to be used for parsing the
output of 'ovs-appctl backtrace' command. But that command was
removed back in 2013 while making OVS thread-safe. The script itself
is also not even compatible with python3 (some decoding of byte objects
is missing).
We could've fixed it and adjusted to parse out backtraces from the
logs instead, but a simple grep with addr2line can do a very similar
job, e.g.:
grep -o '^0x[0-9a-f]*' ./ovs-vswitchd.log \
| xargs addr2line -a -f -s -p -e $(which ovs-vswitchd)
Also, GDB is generally more useful for this task, but that would be a
complete re-write of the script that no-one have used for 13 years.
We can just add a new one if we ever need it. For now, just remove
the broken script and clean up the mentions of it.
Fixes: 94f3e5269e93 ("timeval: Remove backtrace feature.")
Signed-off-by: Ilya Maximets <[email protected]>
---
Documentation/automake.mk | 1 -
Documentation/conf.py | 2 -
Documentation/ref/index.rst | 1 -
Documentation/ref/ovs-parse-backtrace.8.rst | 34 -------
debian/openvswitch-common.install | 2 -
rhel/openvswitch-fedora.spec.in | 3 -
rhel/openvswitch.spec.in | 2 -
utilities/.gitignore | 1 -
utilities/automake.mk | 3 -
utilities/ovs-parse-backtrace.in | 103 --------------------
10 files changed, 152 deletions(-)
delete mode 100644 Documentation/ref/ovs-parse-backtrace.8.rst
delete mode 100755 utilities/ovs-parse-backtrace.in
diff --git a/Documentation/automake.mk b/Documentation/automake.mk
index b18dbce5e..ea9459b55 100644
--- a/Documentation/automake.mk
+++ b/Documentation/automake.mk
@@ -164,7 +164,6 @@ RST_MANPAGES = \
ovs-ctl.8.rst \
ovs-flowviz.8.rst \
ovs-l3ping.8.rst \
- ovs-parse-backtrace.8.rst \
ovs-pki.8.rst \
ovs-tcpdump.8.rst \
ovs-tcpundump.1.rst \
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 303973fc9..276999b29 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -134,8 +134,6 @@ _man_pages = [
u'utility for visualizing OpenFlow and datapath flows'),
('ovs-l3ping.8',
u'check network deployment for L3 tunneling problems'),
- ('ovs-parse-backtrace.8',
- u'parses ovs-appctl backtrace output'),
('ovs-pki.8',
u'OpenFlow public key infrastructure management utility'),
('ovs-sim.1',
diff --git a/Documentation/ref/index.rst b/Documentation/ref/index.rst
index 7f2fe6177..fbf296647 100644
--- a/Documentation/ref/index.rst
+++ b/Documentation/ref/index.rst
@@ -46,7 +46,6 @@ time:
ovs-l3ping.8
ovs-pki.8
ovs-sim.1
- ovs-parse-backtrace.8
ovs-tcpdump.8
ovs-tcpundump.1
ovs-test.8
diff --git a/Documentation/ref/ovs-parse-backtrace.8.rst
b/Documentation/ref/ovs-parse-backtrace.8.rst
deleted file mode 100644
index 27270c612..000000000
--- a/Documentation/ref/ovs-parse-backtrace.8.rst
+++ /dev/null
@@ -1,34 +0,0 @@
-===================
-ovs-parse-backtrace
-===================
-
-Synopsis
-========
-
-``ovs-appctl backtrace | ovs-parse-backtrace [<binary>]``
-
-``ovs-parse-backtrace [<binary>] < <backtrace>``
-
-Description
-===========
-
-In some configurations, many Open vSwitch daemons can produce a series of
-backtraces using the ``ovs-appctl backtrace`` command. Users can analyze
-these backtraces to figure out what the given Open vSwitch daemon may be
-spending most of its time doing. ``ovs-parse-backtrace`` makes this output
-easier to interpret.
-
-The ``ovs-appctl backtrace`` output must be supplied on standard input. The
-binary that produced the output should be supplied as the sole non-option
-argument. For best results, the binary should have debug symbols.
-
-Options
-=======
-
-* ``--help``
-
- Prints a usage message and exits.
-
-* ``--version``
-
- Prints the version and exits.
diff --git a/debian/openvswitch-common.install
b/debian/openvswitch-common.install
index 5fef8de74..43563b07f 100644
--- a/debian/openvswitch-common.install
+++ b/debian/openvswitch-common.install
@@ -3,7 +3,6 @@ usr/bin/ovs-appctl
usr/bin/ovs-docker
usr/bin/ovs-flowviz
usr/bin/ovs-ofctl
-usr/bin/ovs-parse-backtrace
usr/bin/ovs-pki
usr/bin/ovsdb-client
usr/bin/ovsdb-tool
@@ -23,7 +22,6 @@ usr/share/man/man8/ovs-appctl.8
usr/share/man/man8/ovs-bugtool.8
usr/share/man/man8/ovs-flowviz.8
usr/share/man/man8/ovs-ofctl.8
-usr/share/man/man8/ovs-parse-backtrace.8
usr/share/man/man8/ovs-pki.8
usr/share/openvswitch/bugtool-plugins
usr/share/openvswitch/scripts/ovs-bugtool-*
diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 87e7025b3..320b1ad86 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -272,8 +272,6 @@ install -p -D -m 0755 \
rhel/usr_share_openvswitch_scripts_ovs-systemd-reload \
$RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/ovs-systemd-reload
-# remove unpackaged files
-rm -f $RPM_BUILD_ROOT%{_bindir}/ovs-parse-backtrace
# Remove .la files, if present (automatic with %__brp_remove_la_files on f36+).
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
@@ -519,7 +517,6 @@ fi
%{_mandir}/man8/ovs-pki.8*
%{_mandir}/man8/ovs-vsctl.8*
%{_mandir}/man8/ovs-vswitchd.8*
-%{_mandir}/man8/ovs-parse-backtrace.8*
%{_mandir}/man8/ovs-testcontroller.8*
%if %{with dpdk}
%{_prefix}/lib/udev/rules.d/91-vfio.rules
diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in
index 437e01ee1..6212729bc 100644
--- a/rhel/openvswitch.spec.in
+++ b/rhel/openvswitch.spec.in
@@ -190,7 +190,6 @@ exit 0
/usr/bin/ovs-dpctl-top
/usr/bin/ovs-docker
/usr/bin/ovs-ofctl
-/usr/bin/ovs-parse-backtrace
/usr/bin/ovs-pcap
/usr/bin/ovs-pki
/usr/bin/ovs-tcpdump
@@ -226,7 +225,6 @@ exit 0
/usr/share/man/man8/ovs-flowviz.8.gz
/usr/share/man/man8/ovs-kmod-ctl.8.gz
/usr/share/man/man8/ovs-ofctl.8.gz
-/usr/share/man/man8/ovs-parse-backtrace.8.gz
/usr/share/man/man8/ovs-pki.8.gz
/usr/share/man/man8/ovs-tcpdump.8.gz
/usr/share/man/man8/ovs-vlan-test.8.gz
diff --git a/utilities/.gitignore b/utilities/.gitignore
index 0a11356d4..035ff386d 100644
--- a/utilities/.gitignore
+++ b/utilities/.gitignore
@@ -19,7 +19,6 @@
/ovs-lib
/ovs-ofctl
/ovs-ofctl.8
-/ovs-parse-backtrace
/ovs-pcap
/ovs-pcap.1
/ovs-pki
diff --git a/utilities/automake.mk b/utilities/automake.mk
index a76e077e1..45fcdff2c 100644
--- a/utilities/automake.mk
+++ b/utilities/automake.mk
@@ -11,7 +11,6 @@ bin_SCRIPTS += utilities/ovs-docker \
utilities/ovs-tcpundump \
utilities/ovs-dpctl-top \
utilities/ovs-l3ping \
- utilities/ovs-parse-backtrace \
utilities/ovs-test \
utilities/ovs-vlan-test
scripts_SCRIPTS += \
@@ -55,7 +54,6 @@ EXTRA_DIST += \
utilities/ovs-kmod-ctl.in \
utilities/ovs-l3ping.in \
utilities/ovs-lib.in \
- utilities/ovs-parse-backtrace.in \
utilities/ovs-pcap.in \
utilities/ovs-pipegen.py \
utilities/ovs-pki.in \
@@ -102,7 +100,6 @@ CLEANFILES += \
utilities/ovs-l3ping \
utilities/ovs-lib \
utilities/ovs-ofctl.8 \
- utilities/ovs-parse-backtrace \
utilities/ovs-pcap \
utilities/ovs-pcap.1 \
utilities/ovs-pki \
diff --git a/utilities/ovs-parse-backtrace.in b/utilities/ovs-parse-backtrace.in
deleted file mode 100755
index 42f831eed..000000000
--- a/utilities/ovs-parse-backtrace.in
+++ /dev/null
@@ -1,103 +0,0 @@
-#! @PYTHON3@
-#
-# Copyright (c) 2012 Nicira, Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import optparse
-import os
-import re
-import subprocess
-import sys
-
-
-addr2line_cache = {} # None if addr2line is missing or broken.
-
-
-def addr2line(binary, addr):
- global addr2line_cache
-
- if addr2line_cache is None:
- return ""
-
- if addr in addr2line_cache:
- return addr2line_cache[addr]
-
- cmd = ["addr2line", "-f", "-s", "-e", binary, addr]
- try:
- proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- lines = proc.stdout.readlines()
- failed = proc.returncode
- except OSError:
- failed = True
-
- if failed:
- addr2line_cache = None
- return ""
-
- lines = [l.strip() for l in lines]
- return " ".join(lines)
-
-
-def main():
- parser = optparse.OptionParser(version='@VERSION@@VERSION_SUFFIX@',
- usage="usage: %prog [binary]",
- description="""\
-Parses the output of ovs-appctl backtrace producing a more human readable
-result. Expected usage is for ovs-appctl backtrace to be piped in.""")
- options, args = parser.parse_args()
-
- if len(args) > 1:
- parser.print_help()
- sys.exit(1)
-
- if len(args) == 1:
- binary = args[0]
- else:
- binary = "@sbindir@/ovs-vswitchd"
- debug = "/usr/lib/debug%s.debug" % binary
- if os.path.exists(debug):
- binary = debug
-
- print("Binary: %s\n" % binary)
-
- stdin = sys.stdin.read()
-
- traces = []
- for trace in stdin.strip().split("\n\n"):
- lines = trace.splitlines()
- match = re.search(r'Count (\d+)', lines[0])
- if match:
- count = int(match.group(1))
- else:
- count = 0
- traces.append((lines[1:], count))
- traces = sorted(traces, key=(lambda x: x[1]), reverse=True)
-
- for lines, count in traces:
- longest = max(len(l) for l in lines)
-
- print("Backtrace Count: %d" % count)
- for line in lines:
- match = re.search(r'\[(0x.*)]', line)
- if match:
- print("%s %s" % (line.ljust(longest),
- addr2line(binary, match.group(1))))
- else:
- print(line)
- print()
-
-
-if __name__ == "__main__":
- main()
--
2.52.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev