Skip to content

Commit

Permalink
open_coredump: Add --scylla-build-id CLI option
Browse files Browse the repository at this point in the history
The script gets the build id on its own but eu-unstrip-ing the core file
and searching for the necessary value in the output. This can be
somewhat lenghthy operation especially on huge core files. Sometimes
(e.g. in tests) the build id is known and can be just provided as an
argument.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>

Closes #14574
  • Loading branch information
xemul authored and denesb committed Jul 10, 2023
1 parent 65a5942 commit ec29272
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/open-coredump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ done
VERBOSE_LEVEL=1
SCYLLA_S3_RELOC_SERVER_URL="${SCYLLA_S3_RELOC_SERVER_URL:-$SCYLLA_S3_RELOC_SERVER_DEFAULT_URL}"
SCYLLA_REPO_PATH="${SCYLLA_REPO_PATH}"
SCYLLA_BUILD_ID="${SCYLLA_BUILD_ID}"
SCYLLA_GDB_PY_SOURCE="${SCYLLA_GDB_PY_SOURCE:-repo}"
ARTIFACT_DIR=${ARTIFACT_DIR:-${SCRIPT_NAME}.dir}

Expand Down Expand Up @@ -163,6 +164,10 @@ do
SCYLLA_GDB_PY_SOURCE=$2
shift 2
;;
"--scylla-build-id"|"-b")
SCYLLA_BUILD_ID=$2
shift 2
;;
*)
echo "error: unrecognized option: $1, see $0 -h for usage" >&2
exit 1
Expand Down Expand Up @@ -207,7 +212,10 @@ case "${SCYLLA_GDB_PY_SOURCE}" in
;;
esac

BUILD_ID=$(eu-unstrip -n --core ${COREFILE} | grep 'scylla$' | cut -f2 -d' ' | cut -f1 -d@)
BUILD_ID="${SCYLLA_BUILD_ID}"
if [[ -z "${BUILD_ID}" ]]; then
BUILD_ID=$(eu-unstrip -n --core ${COREFILE} | grep 'scylla$' | cut -f2 -d' ' | cut -f1 -d@)
fi

log "Build id: ${BUILD_ID}"

Expand Down

0 comments on commit ec29272

Please sign in to comment.