Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get-up-state.sh needs more columns #1586

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/dtrace/get-up-state.d
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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,
/*
Expand Down
5 changes: 5 additions & 0 deletions tools/dtrace/get-up-state.sh
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Loading