diff --git a/cmon/src/main.rs b/cmon/src/main.rs index 21627b2b5..b639ee366 100644 --- a/cmon/src/main.rs +++ b/cmon/src/main.rs @@ -92,12 +92,12 @@ fn short_state(dss: DsState) -> String { DsState::Connecting { state: NegotiationState::WaitActive, .. - } => "WAC".to_string(), + } => "WA".to_string(), DsState::Connecting { state: NegotiationState::WaitQuorum, .. - } => "WAQ".to_string(), + } => "WQ".to_string(), DsState::Connecting { state: NegotiationState::Reconcile, .. @@ -121,14 +121,14 @@ fn short_state(dss: DsState) -> String { DsState::Connecting { mode: ConnectionMode::Offline, .. - } => "OFF".to_string(), + } => "OFL".to_string(), DsState::Stopping(ClientStopReason::Deactivated) => "DAV".to_string(), DsState::Stopping(ClientStopReason::Disabled) => "DIS".to_string(), DsState::Stopping(ClientStopReason::Replacing) | DsState::Connecting { mode: ConnectionMode::Replaced, .. - } => "RPD".to_string(), + } => "RPL".to_string(), } } diff --git a/tools/dtrace/get-ds-state.d b/tools/dtrace/get-ds-state.d index 8adc7ee50..39738c60b 100644 --- a/tools/dtrace/get-ds-state.d +++ b/tools/dtrace/get-ds-state.d @@ -18,19 +18,21 @@ inline string short_state[string ss] = ss == "offline" ? "OFL" : ss == "reconcile" ? "REC" : ss == "wait_quorum" ? "WQ" : + ss == "wait_active" ? "WA" : + ss == "replaced" ? "RPL" : ss; crucible_upstairs*:::up-status { my_sesh = json(copyinstr(arg1), "ok.session_id"); - this->ds0state = json(copyinstr(arg1), "ok.ds_state[0]"); + this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type"); this->d0 = short_state[this->ds0state]; - this->ds1state = json(copyinstr(arg1), "ok.ds_state[1]"); + this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type"); this->d1 = short_state[this->ds1state]; - this->ds2state = json(copyinstr(arg1), "ok.ds_state[2]"); + this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type"); this->d2 = short_state[this->ds2state]; printf("%6d %8s %3s %3s %3s\n", diff --git a/tools/dtrace/get-up-state.d b/tools/dtrace/get-up-state.d index dbd5bcdd6..e80877006 100755 --- a/tools/dtrace/get-up-state.d +++ b/tools/dtrace/get-up-state.d @@ -43,6 +43,8 @@ inline string short_state[string ss] = ss == "offline" ? "OFL" : ss == "reconcile" ? "REC" : ss == "wait_quorum" ? "WQ" : + ss == "wait_active" ? "WA" : + ss == "replaced" ? "RPL" : ss; /* @@ -52,13 +54,13 @@ inline string short_state[string ss] = */ crucible_upstairs*:::up-status { - this->ds0state = json(copyinstr(arg1), "ok.ds_state[0]"); + this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type"); this->d0 = short_state[this->ds0state]; - this->ds1state = json(copyinstr(arg1), "ok.ds_state[1]"); + this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type"); this->d1 = short_state[this->ds1state]; - this->ds2state = json(copyinstr(arg1), "ok.ds_state[2]"); + this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type"); this->d2 = short_state[this->ds2state]; this->full_session_id = json(copyinstr(arg1), "ok.session_id"); diff --git a/tools/dtrace/simple.d b/tools/dtrace/simple.d index 3e19efd74..e95bcb80f 100755 --- a/tools/dtrace/simple.d +++ b/tools/dtrace/simple.d @@ -14,7 +14,7 @@ dtrace:::BEGIN /* * Print our header at some interval */ -tick-2s +dtrace:::BEGIN, tick-20s { printf("%5s %8s ", "PID", "SESSION"); printf("%3s %3s %3s", "DS0", "DS1", "DS2"); @@ -35,6 +35,9 @@ inline string short_state[string ss] = ss == "faulted" ? "FLT" : ss == "offline" ? "OFL" : ss == "reconcile" ? "REC" : + ss == "wait_quorum" ? "WQ" : + ss == "wait_active" ? "WA" : + ss == "replaced" ? "RPL" : ss; /* @@ -44,13 +47,13 @@ inline string short_state[string ss] = */ crucible_upstairs*:::up-status { - this->ds0state = json(copyinstr(arg1), "ok.ds_state[0]"); + this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type"); this->d0 = short_state[this->ds0state]; - this->ds1state = json(copyinstr(arg1), "ok.ds_state[1]"); + this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type"); this->d1 = short_state[this->ds1state]; - this->ds2state = json(copyinstr(arg1), "ok.ds_state[2]"); + this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type"); this->d2 = short_state[this->ds2state]; this->full_session_id = json(copyinstr(arg1), "ok.session_id"); diff --git a/tools/dtrace/single_up_info.d b/tools/dtrace/single_up_info.d index 4f6f1818b..3419dc525 100755 --- a/tools/dtrace/single_up_info.d +++ b/tools/dtrace/single_up_info.d @@ -20,12 +20,12 @@ dtrace:::BEGIN * Every second, check and see if we have printed enough that it is * time to print the header again */ -tick-1s +dtrace:::BEGIN, tick-1s /show > 20/ { printf("%8s ", "SESSION"); - printf("%17s %17s %17s", "DS STATE 0", "DS STATE 1", "DS STATE 2"); - printf(" %5s %5s %8s %5s", "UPW", "DSW", "NEXT_JOB", "DELTA"); + printf("%3s %3s %3s", "DS0", "DS1", "DS2"); + printf(" %5s %5s %10s %6s", "UPW", "DSW", "NEXT_JOB", "DELTA"); printf(" %10s", "WRITE_BO"); printf(" %5s %5s %5s", "IP0", "IP1", "IP2"); printf(" %5s %5s %5s", "D0", "D1", "D2"); @@ -36,6 +36,22 @@ tick-1s show = 0; } +/* + * Translate the longer state string into a shorter version + */ +inline string short_state[string ss] = + ss == "active" ? "ACT" : + ss == "new" ? "NEW" : + ss == "live_repair_ready" ? "LRR" : + ss == "live_repair" ? "LR" : + ss == "faulted" ? "FLT" : + ss == "offline" ? "OFL" : + ss == "reconcile" ? "REC" : + ss == "wait_quorum" ? "WQ" : + ss == "wait_active" ? "WA" : + ss == "replaced" ? "RPL" : + ss; + crucible_upstairs*:::up-status /pid==$1/ { @@ -44,6 +60,15 @@ crucible_upstairs*:::up-status * All these local variables require the "this->" so the probe firing * from different sessions don't collide with each other. */ + this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type"); + this->d0 = short_state[this->ds0state]; + + this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type"); + this->d1 = short_state[this->ds1state]; + + this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type"); + this->d2 = short_state[this->ds2state]; + this->full_session_id = json(copyinstr(arg1), "ok.session_id"); this->session_id = substr(this->full_session_id, 0, 8); @@ -58,15 +83,13 @@ crucible_upstairs*:::up-status * I'm not very happy about this, but if we don't print it all on one * line, then multiple sessions will clobber each others output. */ - printf("%8s %17s %17s %17s %5s %5s %8s %5d %10s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s\n", + printf("%8s %3s %3s %3s %5s %5s %10s %6d %10s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s\n", this->session_id, /* * State for the three downstairs */ - json(copyinstr(arg1), "ok.ds_state[0]"), - json(copyinstr(arg1), "ok.ds_state[1]"), - json(copyinstr(arg1), "ok.ds_state[2]"), + this->d0, this->d1, this->d2, /* * Work queue counts for Upstairs and Downstairs diff --git a/tools/dtrace/up-info.d b/tools/dtrace/up-info.d index b5050b6f1..0723ad0b6 100755 --- a/tools/dtrace/up-info.d +++ b/tools/dtrace/up-info.d @@ -48,6 +48,8 @@ inline string short_state[string ss] = ss == "offline" ? "OFL" : ss == "reconcile" ? "REC" : ss == "wait_quorum" ? "WQ" : + ss == "wait_active" ? "WA" : + ss == "replaced" ? "RPL" : ss; /* @@ -63,13 +65,13 @@ crucible_upstairs*:::up-status /$target == 0 | $target == pid/ { show = show + 1; - this->ds0state = json(copyinstr(arg1), "ok.ds_state[0]"); + this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type"); this->d0 = short_state[this->ds0state]; - this->ds1state = json(copyinstr(arg1), "ok.ds_state[1]"); + this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type"); this->d1 = short_state[this->ds1state]; - this->ds2state = json(copyinstr(arg1), "ok.ds_state[2]"); + this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type"); this->d2 = short_state[this->ds2state]; this->full_session_id = json(copyinstr(arg1), "ok.session_id"); diff --git a/tools/dtrace/upstairs_info.d b/tools/dtrace/upstairs_info.d index 73d6e96a6..5526c18ba 100755 --- a/tools/dtrace/upstairs_info.d +++ b/tools/dtrace/upstairs_info.d @@ -15,12 +15,12 @@ dtrace:::BEGIN * Every second, check and see if we have printed enough that it is * time to print the header again */ -tick-1s +dtrace:::BEGIN, tick-1s /show > 20/ { printf("%6s ", "PID"); - printf("%17s %17s %17s", "DS STATE 0", "DS STATE 1", "DS STATE 2"); - printf(" %5s %5s %9s", "UPW", "DSW", "JOBID"); + printf("%3s %3s %3s", "DS0", "DS1", "DS2"); + printf(" %5s %5s %10s", "UPW", "DSW", "JOBID"); printf(" %10s", "WRITE_BO"); printf(" %5s %5s %5s", "IP0", "IP1", "IP2"); printf(" %5s %5s %5s", "D0", "D1", "D2"); @@ -29,28 +29,52 @@ tick-1s show = 0; } +/* + * Translate the longer state string into a shorter version + */ +inline string short_state[string ss] = + ss == "active" ? "ACT" : + ss == "new" ? "NEW" : + ss == "live_repair_ready" ? "LRR" : + ss == "live_repair" ? "LR" : + ss == "faulted" ? "FLT" : + ss == "offline" ? "OFL" : + ss == "reconcile" ? "REC" : + ss == "wait_quorum" ? "WQ" : + ss == "wait_active" ? "WA" : + ss == "replaced" ? "RPL" : + ss; + crucible_upstairs*:::up-status { show = show + 1; - printf("%6d ", pid); + this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type"); + this->d0 = short_state[this->ds0state]; + + this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type"); + this->d1 = short_state[this->ds1state]; + + this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type"); + this->d2 = short_state[this->ds2state]; + + printf("%6d", pid); /* * State for the three downstairs */ - printf("%17s", json(copyinstr(arg1), "ok.ds_state[0]")); - printf(" %17s", json(copyinstr(arg1), "ok.ds_state[1]")); - printf(" %17s", json(copyinstr(arg1), "ok.ds_state[2]")); + printf(" %3s", this->d0); + printf(" %3s", this->d1); + printf(" %3s", this->d2); /* * Work queue counts for Upstairs and Downstairs */ - printf(" "); printf(" %5s", json(copyinstr(arg1), "ok.up_count")); printf(" %5s", json(copyinstr(arg1), "ok.ds_count")); /* * Job ID and outstanding bytes */ - printf(" %9s", json(copyinstr(arg1), "ok.next_job_id")); + printf(" %10s", json(copyinstr(arg1), "ok.next_job_id")); printf(" %10s", json(copyinstr(arg1), "ok.write_bytes_out")); /* diff --git a/tools/dtrace/upstairs_repair.d b/tools/dtrace/upstairs_repair.d index ea70d7b25..e1465d6b1 100755 --- a/tools/dtrace/upstairs_repair.d +++ b/tools/dtrace/upstairs_repair.d @@ -15,10 +15,10 @@ dtrace:::BEGIN * Every second, check and see if we have printed enough that it is * time to print the header again */ -tick-1s +dtrace:::BEGIN, tick-1s /show > 20/ { - printf("%17s %17s %17s", "DS STATE 0", "DS STATE 1", "DS STATE 2"); + printf("%3s %3s %3s", "DS0", "DS1", "DS2"); printf(" "); /* Header width, three downstairs, space between: 5+1+5+1+5 = 17 */ @@ -32,15 +32,41 @@ tick-1s show = 0; } +/* + * Translate the longer state string into a shorter version + */ +inline string short_state[string ss] = + ss == "active" ? "ACT" : + ss == "new" ? "NEW" : + ss == "live_repair_ready" ? "LRR" : + ss == "live_repair" ? "LR" : + ss == "faulted" ? "FLT" : + ss == "offline" ? "OFL" : + ss == "reconcile" ? "REC" : + ss == "wait_quorum" ? "WQ" : + ss == "wait_active" ? "WA" : + ss == "replaced" ? "RPL" : + ss; + crucible_upstairs*:::up-status { show = show + 1; /* * State for the three downstairs */ - printf("%17s", json(copyinstr(arg1), "ok.ds_state[0]")); - printf(" %17s", json(copyinstr(arg1), "ok.ds_state[1]")); - printf(" %17s", json(copyinstr(arg1), "ok.ds_state[2]")); + + this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type"); + this->d0 = short_state[this->ds0state]; + + this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type"); + this->d1 = short_state[this->ds1state]; + + this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type"); + this->d2 = short_state[this->ds2state]; + + printf("%3s", this->d0); + printf(" %3s", this->d1); + printf(" %3s", this->d2); printf(" "); printf(" %5s", json(copyinstr(arg1), "ok.ds_live_repair_completed[0]"));