From ba1238e599af418874fb001d5c5d1f3a0a52a2f9 Mon Sep 17 00:00:00 2001 From: Noa Or Date: Thu, 14 Jul 2022 11:58:31 +0000 Subject: [PATCH] [202012] [generate_dump] allow to extend dump with plugin scripts --- scripts/generate_dump | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/generate_dump b/scripts/generate_dump index b8acd3e566..00232e4147 100755 --- a/scripts/generate_dump +++ b/scripts/generate_dump @@ -32,6 +32,7 @@ DUMPDIR=/var/dump TARDIR=$DUMPDIR/$BASE TARFILE=$DUMPDIR/$BASE.tar LOGDIR=$DUMPDIR/$BASE/dump +PLUGINS_DIR=/usr/local/bin/debug-dump NUM_ASICS=1 HOME=${HOME:-/root} USER=${USER:-root} @@ -1216,6 +1217,14 @@ main() { save_cmd "docker ps -a" "docker.ps" save_cmd "docker top pmon" "docker.pmon" + if [[ -d ${PLUGINS_DIR} ]]; then + local -r dump_plugins="$(find ${PLUGINS_DIR} -type f -executable)" + for plugin in $dump_plugins; do + # save stdout output of plugin and gzip it + save_cmd "$plugin" "$(basename $plugin)" true + done + fi + save_saidump if [[ "$asic" = "mellanox" ]]; then