X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Flttng-tools%2Fhang_processes.sh;h=3e52a607a3ddb6a3396ff17d680abff3be9d8fba;hb=2bd4c4ca63118876e21337a6b3d550bf39535d5a;hp=f0d2ccf7cac09bd2c129bc5cf1ee5c39f54fa832;hpb=bc571dfb016351c94670a03904b96c03204ffffa;p=lttng-ci.git diff --git a/scripts/lttng-tools/hang_processes.sh b/scripts/lttng-tools/hang_processes.sh index f0d2ccf..3e52a60 100755 --- a/scripts/lttng-tools/hang_processes.sh +++ b/scripts/lttng-tools/hang_processes.sh @@ -1,4 +1,4 @@ -#!/bin/bash -exu +#!/bin/bash # # Copyright (C) 2018 - Jonathan Rajotte-Julien # @@ -15,6 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +set -exu + PGREP=pgrep pids="" file_list=$(mktemp) @@ -68,7 +70,7 @@ while read -r core_file; do collect_recursive "$str" done - rm -f "$core_file" + echo "$core_file" >> $file_list ret=1 done < <(find "/tmp" -maxdepth 1 -name "core\.[0-9]*" -type f 2>/dev/null) @@ -78,5 +80,10 @@ if [ -s "$file_list" ]; then tar cfzh "${WORKSPACE}/build/core.tar.gz" -T <(sort "$file_list" | uniq) fi +# Remove core file +while read -r core_file; do + rm -rf "$core_file" +done < <(find "/tmp" -maxdepth 1 -name "core\.[0-9]*" -type f 2>/dev/null) + rm -f "$file_list" exit $ret