From e22d61fdef9cbac42cd9e8f23fcb56fc45ec0bf8 Mon Sep 17 00:00:00 2001 From: Romain Vaillant Date: Tue, 14 Feb 2023 14:48:28 +0100 Subject: [PATCH] review-update: Update usage and naming. --- archive-cores/archive-cores.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/archive-cores/archive-cores.sh b/archive-cores/archive-cores.sh index b11ed9f..7bf027d 100755 --- a/archive-cores/archive-cores.sh +++ b/archive-cores/archive-cores.sh @@ -2,20 +2,24 @@ set -euo pipefail # Archive all cores corresponding to a given set of core_patterns to -# $artifacts_output_directory/cores. +# $dest_directory/cores. +# # When possible, the binary that generated the core is also archived, and # backtraces are generated and archived. # +# Ignore filters are applied against each found backtrace to determine if the +# core should be archived or not. +# # Example: -# ./archive_cores.sh $ARTIFACT_DIR ./core.* /tmp/core.* +# ./archive_cores.sh $ARTIFACT_DIR "daemontest" ./core.* /tmp/core.* if [ "$#" -lt 2 ]; then - echo "usage: $0 " + echo "usage: $0 " exit 1 fi DEST="$1" -EXPECTED_CRASHES="$2" +IGNORE_FILTERS="$2" shift shift CORE_PATTERNS="$@" @@ -31,7 +35,7 @@ is_expected_crash() local bt_full="$1" local bin="$2" - for match in $EXPECTED_CRASHES; do + for match in $FILTER_PATTERNS; do if grep -q "$match" "$bt_full"; then echo "Known and expected crash of $bin: $match, skipping" return 0