From 7f8317a5986b1cb427f45e86f50c2b8c8e673f66 Mon Sep 17 00:00:00 2001 From: Alan Hanson Date: Fri, 6 Dec 2024 15:11:55 -0800 Subject: [PATCH 1/2] Make DELTA column 6 wide --- tools/dtrace/get-up-state.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/dtrace/get-up-state.d b/tools/dtrace/get-up-state.d index f86009e8b..3fbd12f1d 100755 --- a/tools/dtrace/get-up-state.d +++ b/tools/dtrace/get-up-state.d @@ -16,7 +16,7 @@ dtrace:::BEGIN last_id["string"] = (int64_t)1; printf("%5s %8s ", "PID", "SESSION"); printf("%3s %3s %3s", "DS0", "DS1", "DS2"); - printf(" %10s %5s %4s", "NEXT_JOB", "DELTA", "CONN"); + printf(" %10s %6s %4s", "NEXT_JOB", "DELTA", "CONN"); printf(" %5s %5s", "ELR", "ELC"); printf(" %5s %5s", "ERR", "ERN"); printf("\n"); @@ -118,7 +118,7 @@ crucible_upstairs*:::up-status strtoll(json(copyinstr(arg1), "ok.ds_connected[1]")) + strtoll(json(copyinstr(arg1), "ok.ds_connected[2]")); - printf("%5d %8s %3s %3s %3s %10s %5d %4d %5d %5d %5s %5s\n", + printf("%5d %8s %3s %3s %3s %10s %6d %4d %5d %5d %5s %5s\n", pid, this->session_id, /* From 7b75bd681854db6479a66d58bd50b4dd4e386cca Mon Sep 17 00:00:00 2001 From: Alan Hanson Date: Mon, 9 Dec 2024 20:30:31 +0000 Subject: [PATCH 2/2] Handle errors better in get-up-state.sh script --- tools/dtrace/get-up-state.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/dtrace/get-up-state.sh b/tools/dtrace/get-up-state.sh index 2f1efaf27..d1d819df1 100755 --- a/tools/dtrace/get-up-state.sh +++ b/tools/dtrace/get-up-state.sh @@ -1,11 +1,16 @@ #!/bin/bash +set -o pipefail + filename='/tmp/get-up-state.out' final='/tmp/get-up-state.final' rm -f $final # Gather our output first. dtrace -s /opt/oxide/crucible_dtrace/get-up-state.d | awk 'NF' > "$filename" +if [[ $? -ne 0 ]]; then + exit 1 +fi # For each session we find, get the latest line and store that in # the result file.