diff options
author | Peter Mikus <pmikus@cisco.com> | 2019-10-15 09:43:19 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2019-10-16 16:28:16 +0000 |
commit | bf0ea7aee82f32752c4b1a3abc1f60294fbc1f40 (patch) | |
tree | f71c07e2358f7172f3eca1b968bd7a655719d7d2 /resources/libraries | |
parent | 61ba4ad06d2bf0ea579e69d20221949bde58674b (diff) |
Core-keeper: Process files instead transfer
+ 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
Diffstat (limited to 'resources/libraries')
-rw-r--r-- | resources/libraries/python/CoreDumpUtil.py | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/resources/libraries/python/CoreDumpUtil.py b/resources/libraries/python/CoreDumpUtil.py index 9fd8b24822..63c6d92a4c 100644 --- a/resources/libraries/python/CoreDumpUtil.py +++ b/resources/libraries/python/CoreDumpUtil.py @@ -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 |