Core-keeper: Process files instead transfer 31/22731/4
authorPeter Mikus <pmikus@cisco.com>
Tue, 15 Oct 2019 09:43:19 +0000 (09:43 +0000)
committerPeter Mikus <pmikus@cisco.com>
Wed, 16 Oct 2019 16:28:16 +0000 (16:28 +0000)
+ Instead of transferring large files, post-process directly
  via CSIT. Extract backtrace as a start point.

Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I79ad760d310c95d807242ad1997dd657d5142459

resources/libraries/python/CoreDumpUtil.py

index 9fd8b24..63c6d92 100644 (file)
@@ -119,8 +119,8 @@ class CoreDumpUtil(object):
                 self.enable_coredump_limit(node, vpp_pid)
 
     def get_core_files_on_all_nodes(self, nodes, disable_on_success=True):
-        """Compress all core files into single file and remove the original
-        core files on all nodes.
+        """Process all core files and remove the original core files on al
+        nodes.
 
         :param nodes: Nodes in the topology.
         :param disable_on_success: If True, disable setting of core limit by
@@ -129,16 +129,13 @@ class CoreDumpUtil(object):
         :type disable_on_success: bool
         """
         for node in nodes.values():
-            uuid = str(time()).replace('.', '')
-            name = '{uuid}.tar.lzo.lrz.xz'.format(uuid=uuid)
-
-            command = ('[ -e {dir}/*.core ] && cd {dir} && '
-                       'sudo tar c *.core | '
-                       'lzop -1 | '
-                       'lrzip -n -T -p 1 -w 5 | '
-                       'xz -9e > {name} && '
-                       'sudo rm -f *.core'
-                       .format(dir=Constants.CORE_DUMP_DIR, name=name))
+            command = ('for f in {dir}/*.core; do '
+                       'sudo gdb /usr/bin/vpp ${{f}} '
+                       '--eval-command="set pagination off" '
+                       '--eval-command="thread apply all bt" '
+                       '--eval-command="quit"; '
+                       'sudo rm -f ${{f}}; done'
+                       .format(dir=Constants.CORE_DUMP_DIR))
             try:
                 exec_cmd_no_error(node, command, timeout=3600)
                 if disable_on_success:
@@ -147,14 +144,3 @@ class CoreDumpUtil(object):
                 # If compress was not sucessfull ignore error and skip further
                 # processing.
                 continue
-
-            local_path = 'archive/{name}'.format(name=name)
-            remote_path = '{dir}/{name}'.format(dir=Constants.CORE_DUMP_DIR,
-                                                name=name)
-            try:
-                scp_node(node, local_path, remote_path, get=True, timeout=3600)
-                command = 'rm -f {dir}/{name}'\
-                           .format(dir=Constants.CORE_DUMP_DIR, name=name)
-                exec_cmd_no_error(node, command, sudo=True)
-            except RuntimeError:
-                pass