Skip to content

Commit ebcf035

Browse files
leftwoAlan Hanson
andauthored
DTrace and log polish (#1773)
Cleanup DTrace printing of downstairs state. Convert the DsState type into a string before we stuff it into the DTrace probe. We were treating it as a string already on the other side, so why not just send the string we want to begin with. This avoids having to do more complicated processing inside the D scripts. Updated all the DTraces scripts that were using the old method to now expect the new string that is returned for the default display of DsState type. Updated the default display for DsState to provide a bit more info for states that were "Connecting". Changed a few log messages from error to warn in the case where we can't send an update message to Nexus. Fix for various bits in #1772 Here is some sample output from some of the DTrace scripts: ``` alan@etrium:crucible$ pfexec dtrace -Z -s tools/dtrace/up-info.d PID UUID SESSION DS0 DS1 DS2 NEXT_JOB DELTA CONN ELR ELC ERR ERN 12140 b088b7c5 2d9b1fec ACT ACT ACT 1004 0 3 0 0 0 0 12140 b088b7c5 2d9b1fec ACT ACT ACT 1004 0 3 0 0 0 0 12140 b088b7c5 2d9b1fec ACT ACT ACT 1004 0 3 0 0 0 0 12140 b088b7c5 2d9b1fec ACT ACT ACT 1004 0 3 0 0 0 0 12146 2d50ec4b 431c0edf ACT ACT ACT 1004 0 3 0 0 0 0 12146 2d50ec4b 431c0edf ACT ACT ACT 1004 0 3 0 0 0 0 12146 2d50ec4b 431c0edf ACT ACT ACT 1004 0 3 0 0 0 0 12146 2d50ec4b 431c0edf ACT ACT ACT 1004 0 3 0 0 0 0 12154 5f6d602e d8035684 WQ WQ NEW 1000 0 2 0 0 0 0 12154 5f6d602e d8035684 WQ WQ NEW 1000 0 2 0 0 0 0 12154 5f6d602e d8035684 WQ WQ NEW 1000 0 2 0 0 0 0 12154 5f6d602e d8035684 WQ WQ NEW 1000 0 2 0 0 0 0 12154 5f6d602e d8035684 WQ WQ NEW 1000 0 2 0 0 0 0 12154 5f6d602e d8035684 WQ WQ NEW 1000 0 2 0 0 0 0 12154 5f6d602e d8035684 WQ WQ NEW 1000 0 2 0 0 0 0 12154 5f6d602e d8035684 WQ WQ NEW 1000 0 2 0 0 0 0 12154 5f6d602e d8035684 WQ WQ NEW 1000 0 2 0 0 0 0 12154 5f6d602e d8035684 REC REC REC 1000 0 3 0 0 2 18 12154 5f6d602e d8035684 ACT ACT ACT 1002 2 3 0 0 20 0 12154 5f6d602e d8035684 ACT ACT ACT 1002 0 3 0 0 20 0 12154 5f6d602e d8035684 ACT ACT ACT 1002 0 3 0 0 20 0 PID UUID SESSION DS0 DS1 DS2 NEXT_JOB DELTA CONN ELR ELC ERR ERN 12154 5f6d602e d8035684 ACT ACT ACT 1002 0 3 0 0 20 0 12179 0817aca3 2a0fd3d4 OFL ACT ACT 1401 0 3 0 0 0 0 12179 0817aca3 2a0fd3d4 OFL ACT ACT 1401 0 3 0 0 0 0 12179 0817aca3 2a0fd3d4 OFL ACT ACT 1401 0 3 0 0 0 0 ``` I let the dtrace scripts run while running cargo test and I could see many of the states showing up. Here is a bunch of noise from that: ``` alan@etrium:crucible$ pfexec dtrace -Z -s tools/dtrace/sled_upstairs_info.d PID UUID SESSION DS0 DS1 DS2 UPW DSW NEXT_JOB WRITE_BO IP0 IP1 IP2 D0 D1 D2 S0 S1 S2 ER0 ER1 ER2 EC0 EC1 EC2 12494 7dc3f943 1bb2b697 FLT ACT ACT 0 0 1498 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12491 861995a1 e6a231de OFL OFL OFL 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12497 5bd17c94 fe8e0586 FLT ACT ACT 0 0 2201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12492 34940348 dd0721be FLT ACT ACT 0 497 1497 0 0 0 0 0 497 497 497 0 0 0 0 0 0 0 0 12501 dbb21d8c 932671af OFL ACT ACT 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12503 da39d261 17b1d5c7 OFL ACT ACT 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12498 09e744d8 e1e347c0 FLT ACT ACT 0 1200 2200 0 0 0 0 0 1200 1200 1200 0 0 0 0 0 0 0 0 12502 4137d113 1912fce1 OFL ACT ACT 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12965 5fed87cb 30bb4c55 ACT ACT ACT 1 40 1184 1048576 1 1 1 39 39 39 0 0 0 0 0 0 0 0 0 12494 7dc3f943 1bb2b697 FLT ACT ACT 0 0 1498 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12497 5bd17c94 fe8e0586 FLT ACT ACT 0 0 2201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12492 34940348 dd0721be FLT ACT ACT 0 497 1497 0 0 0 0 0 497 497 497 0 0 0 0 0 0 0 0 12501 dbb21d8c 932671af OFL ACT ACT 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12498 09e744d8 e1e347c0 FLT ACT ACT 0 1200 2200 0 0 0 0 0 1200 1200 1200 0 0 0 0 0 0 0 0 12965 5fed87cb 30bb4c55 ACT ACT ACT 1 43 1187 1048576 1 1 1 42 42 42 0 0 0 0 0 0 0 0 0 12494 7dc3f943 1bb2b697 FLT ACT ACT 0 0 1498 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12497 5bd17c94 fe8e0586 FLT ACT ACT 0 0 2201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12492 34940348 dd0721be FLT ACT ACT 0 497 1497 0 0 0 0 0 497 497 497 0 0 0 0 0 0 0 0 12501 dbb21d8c 932671af OFL ACT ACT 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12498 09e744d8 e1e347c0 FLT ACT ACT 0 0 2201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12965 5fed87cb 30bb4c55 ACT ACT ACT 1 46 1190 1048576 1 1 1 45 45 45 0 0 0 0 0 0 0 0 0 PID UUID SESSION DS0 DS1 DS2 UPW DSW NEXT_JOB WRITE_BO IP0 IP1 IP2 D0 D1 D2 S0 S1 S2 ER0 ER1 ER2 EC0 EC1 EC2 12494 7dc3f943 1bb2b697 FLT ACT ACT 0 0 1498 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12497 5bd17c94 fe8e0586 FLT ACT ACT 0 0 2201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12492 34940348 dd0721be FLT ACT ACT 0 0 1498 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12501 dbb21d8c 932671af OFL ACT ACT 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12498 09e744d8 e1e347c0 FLT ACT ACT 0 0 2201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12494 7dc3f943 1bb2b697 FLT ACT ACT 0 0 1498 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12497 5bd17c94 fe8e0586 FLT ACT ACT 0 0 2201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12492 34940348 dd0721be FLT ACT ACT 0 0 1498 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12501 dbb21d8c 932671af OFL ACT ACT 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12498 09e744d8 e1e347c0 FLT ACT ACT 0 0 2201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12494 7dc3f943 1bb2b697 LR ACT ACT 20 199 1699 17920 10 37 37 24 162 162 165 0 0 3 0 0 0 0 0 12497 5bd17c94 fe8e0586 LR ACT ACT 11 181 2384 8704 10 19 19 24 162 162 147 0 0 3 0 0 0 0 0 12492 34940348 dd0721be LR ACT ACT 2 164 1664 0 2 2 2 24 162 162 138 0 0 3 0 0 0 0 0 12501 dbb21d8c 932671af OFL ACT ACT 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12498 09e744d8 e1e347c0 LR ACT ACT 8 176 2379 6144 10 14 14 24 162 162 142 0 0 3 0 0 0 0 0 12501 dbb21d8c 932671af OFL ACT ACT 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12965 5fed87cb 30bb4c55 ACT ACT ACT 0 46 1190 0 0 0 0 46 46 46 0 0 0 0 0 0 0 0 0 12501 dbb21d8c 932671af ACT ACT ACT 0 1 1001 512 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 ``` --------- Co-authored-by: Alan Hanson <[email protected]>
1 parent 65ca41e commit ebcf035

File tree

14 files changed

+200
-178
lines changed

14 files changed

+200
-178
lines changed

cmon/src/main.rs

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ use strum::IntoEnumIterator;
88
use strum_macros::EnumIter;
99
use tokio::time::{sleep, Duration};
1010

11-
use crucible::{
12-
ClientStopReason, ConnectionMode, DsState, DtraceInfo, NegotiationState,
13-
};
11+
use crucible::DtraceInfo;
1412

1513
/// Connect to crucible control server
1614
#[derive(Parser, Debug)]
@@ -86,44 +84,25 @@ enum Action {
8684
Repair,
8785
}
8886

89-
/// Translate a [`DsState`] into a three letter string for printing.
90-
fn short_state(dss: DsState) -> String {
87+
/// Translate what the default DsState string is (that we are getting from DTrace)
88+
/// into a three letter string for printing.
89+
fn short_state(dss: &str) -> String {
9190
match dss {
92-
DsState::Connecting {
93-
state: NegotiationState::WaitQuorum,
94-
..
95-
} => "WQ".to_string(),
96-
DsState::Connecting {
97-
state: NegotiationState::Reconcile,
98-
..
99-
} => "REC".to_string(),
100-
DsState::Active => "ACT".to_string(),
101-
DsState::Connecting {
102-
state: NegotiationState::LiveRepairReady,
103-
..
104-
} => "LRR".to_string(),
105-
DsState::Stopping(ClientStopReason::NegotiationFailed(..))
106-
| DsState::Connecting {
107-
mode: ConnectionMode::New,
108-
..
109-
} => "NEW".to_string(),
110-
DsState::Connecting {
111-
mode: ConnectionMode::Faulted,
112-
..
113-
}
114-
| DsState::Stopping(ClientStopReason::Fault(..)) => "FLT".to_string(),
115-
DsState::LiveRepair => "LR".to_string(),
116-
DsState::Connecting {
117-
mode: ConnectionMode::Offline,
118-
..
119-
} => "OFL".to_string(),
120-
DsState::Stopping(ClientStopReason::Deactivated) => "DAV".to_string(),
121-
DsState::Stopping(ClientStopReason::Disabled) => "DIS".to_string(),
122-
DsState::Stopping(ClientStopReason::Replacing)
123-
| DsState::Connecting {
124-
mode: ConnectionMode::Replaced,
125-
..
126-
} => "RPL".to_string(),
91+
"Active" => "ACT".to_string(),
92+
"WaitQuorum" => "WQ".to_string(),
93+
"Reconcile" => "REC".to_string(),
94+
"LiveRepairReady" => "LRR".to_string(),
95+
"New" => "NEW".to_string(),
96+
"Faulted" => "FLT".to_string(),
97+
"Offline" => "OFL".to_string(),
98+
"Replaced" => "RPL".to_string(),
99+
"LiveRepair" => "LR".to_string(),
100+
"Replacing" => "RPC".to_string(),
101+
"Disabled" => "DIS".to_string(),
102+
"Deactivated" => "DAV".to_string(),
103+
"NegotiationFailed" => "NF".to_string(),
104+
"Fault" => "FLT".to_string(),
105+
x => x.to_string(),
127106
}
128107
}
129108

@@ -277,9 +256,9 @@ fn print_dtrace_row(
277256
DtraceDisplay::State => {
278257
print!(
279258
" {:>3} {:>3} {:>3}",
280-
short_state(d_out.ds_state[0]),
281-
short_state(d_out.ds_state[1]),
282-
short_state(d_out.ds_state[2]),
259+
short_state(&d_out.ds_state[0]),
260+
short_state(&d_out.ds_state[1]),
261+
short_state(&d_out.ds_state[2]),
283262
);
284263
}
285264
DtraceDisplay::UpCount => {

tools/dtrace/all_downstairs.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ crucible_downstairs*:::work-done
5757

5858
tick-4s
5959
{
60-
printf("%5s %4s %4s %4s %4s %5s %5s %5s %5s %5s\n",
60+
printf("%5s %5s %5s %5s %5s %5s %5s %5s %5s %5s\n",
6161
"PID", "F>", "F<", "W>", "W<", "R>", "R<", "WS", "WIP", "WD");
62-
printa("%05d %@4u %@4u %@4u %@4u %@5u %@5u %@5u %@5u %@5u\n",
62+
printa("%05d %@5u %@5u %@5u %@5u %@5u %@5u %@5u %@5u %@5u\n",
6363
@sf_start, @sf_done, @sw_start, @sw_done, @sr_start, @sr_done,
6464
@work_start, @work_process, @work_done
6565
);

tools/dtrace/get-ds-state.d

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,40 @@
33
* Exit after 5 seconds.
44
*/
55
#pragma D option quiet
6-
#pragma D option strsize=1k
6+
#pragma D option strsize=2k
77

88
/*
99
* Translate the longer state string into a shorter version
1010
*/
1111
inline string short_state[string ss] =
12-
ss == "active" ? "ACT" :
13-
ss == "new" ? "NEW" :
14-
ss == "replaced" ? "RPL" :
15-
ss == "live_repair_ready" ? "LRR" :
16-
ss == "live_repair" ? "LR" :
17-
ss == "faulted" ? "FLT" :
18-
ss == "offline" ? "OFL" :
19-
ss == "reconcile" ? "REC" :
20-
ss == "wait_quorum" ? "WQ" :
21-
ss == "wait_active" ? "WA" :
22-
ss == "connecting" ? "CON" :
12+
ss == "Active" ? "ACT" :
13+
ss == "WaitQuorum" ? "WQ" :
14+
ss == "Reconcile" ? "REC" :
15+
ss == "LiveRepairReady" ? "LRR" :
16+
ss == "New" ? "NEW" :
17+
ss == "Faulted" ? "FLT" :
18+
ss == "Offline" ? "OFL" :
19+
ss == "LiveRepair" ? "LR" :
20+
ss == "Replacing" ? "RPC" :
21+
ss == "Replaced" ? "RPL" :
22+
ss == "Disabled" ? "DIS" :
23+
ss == "Deactivated" ? "DAV" :
24+
ss == "NegotiationFailed" ? "NF" :
25+
ss == "Fault" ? "FLT" :
2326
ss;
2427

2528
crucible_upstairs*:::up-status
2629
{
2730
my_id = json(copyinstr(arg1), "ok.upstairs_id");
2831
my_sesh = json(copyinstr(arg1), "ok.session_id");
2932

30-
this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type");
33+
this->ds0state = json(copyinstr(arg1), "ok.ds_state[0]");
3134
this->d0 = short_state[this->ds0state];
3235

33-
this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type");
36+
this->ds1state = json(copyinstr(arg1), "ok.ds_state[1]");
3437
this->d1 = short_state[this->ds1state];
3538

36-
this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type");
39+
this->ds2state = json(copyinstr(arg1), "ok.ds_state[2]");
3740
this->d2 = short_state[this->ds2state];
3841

3942
printf("%6d %8s %8s %3s %3s %3s\n",

tools/dtrace/get-up-state.d

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Display Upstairs status for all matching processes
33
*/
44
#pragma D option quiet
5-
#pragma D option strsize=1k
5+
#pragma D option strsize=2k
66

77
/*
88
* Print the header right away
@@ -34,17 +34,20 @@ tick-10s
3434
* Translate the longer state string into a shorter version
3535
*/
3636
inline string short_state[string ss] =
37-
ss == "active" ? "ACT" :
38-
ss == "new" ? "NEW" :
39-
ss == "replaced" ? "RPL" :
40-
ss == "live_repair_ready" ? "LRR" :
41-
ss == "live_repair" ? "LR" :
42-
ss == "faulted" ? "FLT" :
43-
ss == "offline" ? "OFL" :
44-
ss == "reconcile" ? "REC" :
45-
ss == "wait_quorum" ? "WQ" :
46-
ss == "wait_active" ? "WA" :
47-
ss == "connecting" ? "CON" :
37+
ss == "Active" ? "ACT" :
38+
ss == "WaitQuorum" ? "WQ" :
39+
ss == "Reconcile" ? "REC" :
40+
ss == "LiveRepairReady" ? "LRR" :
41+
ss == "New" ? "NEW" :
42+
ss == "Faulted" ? "FLT" :
43+
ss == "Offline" ? "OFL" :
44+
ss == "LiveRepair" ? "LR" :
45+
ss == "Replacing" ? "RPC" :
46+
ss == "Replaced" ? "RPL" :
47+
ss == "Disabled" ? "DIS" :
48+
ss == "Deactivated" ? "DAV" :
49+
ss == "NegotiationFailed" ? "NF" :
50+
ss == "Fault" ? "FLT" :
4851
ss;
4952

5053
/*
@@ -54,13 +57,13 @@ inline string short_state[string ss] =
5457
*/
5558
crucible_upstairs*:::up-status
5659
{
57-
this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type");
60+
this->ds0state = json(copyinstr(arg1), "ok.ds_state[0]");
5861
this->d0 = short_state[this->ds0state];
5962

60-
this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type");
63+
this->ds1state = json(copyinstr(arg1), "ok.ds_state[1]");
6164
this->d1 = short_state[this->ds1state];
6265

63-
this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type");
66+
this->ds2state = json(copyinstr(arg1), "ok.ds_state[2]");
6467
this->d2 = short_state[this->ds2state];
6568

6669
this->full_session_id = json(copyinstr(arg1), "ok.session_id");

tools/dtrace/simple.d

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma D option quiet
2-
#pragma D option strsize=1k
2+
#pragma D option strsize=2k
33

44
dtrace:::BEGIN
55
{
@@ -28,17 +28,20 @@ dtrace:::BEGIN, tick-20s
2828
* Translate the longer state string into a shorter version
2929
*/
3030
inline string short_state[string ss] =
31-
ss == "active" ? "ACT" :
32-
ss == "new" ? "NEW" :
33-
ss == "live_repair_ready" ? "LRR" :
34-
ss == "live_repair" ? "LR" :
35-
ss == "faulted" ? "FLT" :
36-
ss == "offline" ? "OFL" :
37-
ss == "reconcile" ? "REC" :
38-
ss == "wait_quorum" ? "WQ" :
39-
ss == "wait_active" ? "WA" :
40-
ss == "replaced" ? "RPL" :
41-
ss == "connecting" ? "CON" :
31+
ss == "Active" ? "ACT" :
32+
ss == "WaitQuorum" ? "WQ" :
33+
ss == "Reconcile" ? "REC" :
34+
ss == "LiveRepairReady" ? "LRR" :
35+
ss == "New" ? "NEW" :
36+
ss == "Faulted" ? "FLT" :
37+
ss == "Offline" ? "OFL" :
38+
ss == "LiveRepair" ? "LR" :
39+
ss == "Replacing" ? "RPC" :
40+
ss == "Replaced" ? "RPL" :
41+
ss == "Disabled" ? "DIS" :
42+
ss == "Deactivated" ? "DAV" :
43+
ss == "NegotiationFailed" ? "NF" :
44+
ss == "Fault" ? "FLT" :
4245
ss;
4346

4447
/*
@@ -48,13 +51,13 @@ inline string short_state[string ss] =
4851
*/
4952
crucible_upstairs*:::up-status
5053
{
51-
this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type");
54+
this->ds0state = json(copyinstr(arg1), "ok.ds_state[0]");
5255
this->d0 = short_state[this->ds0state];
5356

54-
this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type");
57+
this->ds1state = json(copyinstr(arg1), "ok.ds_state[1]");
5558
this->d1 = short_state[this->ds1state];
5659

57-
this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type");
60+
this->ds2state = json(copyinstr(arg1), "ok.ds_state[2]");
5861
this->d2 = short_state[this->ds2state];
5962

6063
this->full_upstairs_id = json(copyinstr(arg1), "ok.upstairs_id");

tools/dtrace/single_up_info.d

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Display internal Upstairs status for the PID provided as $1
33
*/
44
#pragma D option quiet
5-
#pragma D option strsize=1k
5+
#pragma D option strsize=2k
66
/*
77
* Print the header right away
88
*/
@@ -40,17 +40,20 @@ dtrace:::BEGIN, tick-1s
4040
* Translate the longer state string into a shorter version
4141
*/
4242
inline string short_state[string ss] =
43-
ss == "active" ? "ACT" :
44-
ss == "new" ? "NEW" :
45-
ss == "live_repair_ready" ? "LRR" :
46-
ss == "live_repair" ? "LR" :
47-
ss == "faulted" ? "FLT" :
48-
ss == "offline" ? "OFL" :
49-
ss == "reconcile" ? "REC" :
50-
ss == "wait_quorum" ? "WQ" :
51-
ss == "wait_active" ? "WA" :
52-
ss == "replaced" ? "RPL" :
53-
ss == "connecting" ? "CON" :
43+
ss == "Active" ? "ACT" :
44+
ss == "WaitQuorum" ? "WQ" :
45+
ss == "Reconcile" ? "REC" :
46+
ss == "LiveRepairReady" ? "LRR" :
47+
ss == "New" ? "NEW" :
48+
ss == "Faulted" ? "FLT" :
49+
ss == "Offline" ? "OFL" :
50+
ss == "LiveRepair" ? "LR" :
51+
ss == "Replacing" ? "RPC" :
52+
ss == "Replaced" ? "RPL" :
53+
ss == "Disabled" ? "DIS" :
54+
ss == "Deactivated" ? "DAV" :
55+
ss == "NegotiationFailed" ? "NF" :
56+
ss == "Fault" ? "FLT" :
5457
ss;
5558

5659
crucible_upstairs*:::up-status
@@ -61,13 +64,13 @@ crucible_upstairs*:::up-status
6164
* All these local variables require the "this->" so the probe firing
6265
* from different sessions don't collide with each other.
6366
*/
64-
this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type");
67+
this->ds0state = json(copyinstr(arg1), "ok.ds_state[0]");
6568
this->d0 = short_state[this->ds0state];
6669

67-
this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type");
70+
this->ds1state = json(copyinstr(arg1), "ok.ds_state[1]");
6871
this->d1 = short_state[this->ds1state];
6972

70-
this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type");
73+
this->ds2state = json(copyinstr(arg1), "ok.ds_state[2]");
7174
this->d2 = short_state[this->ds2state];
7275

7376
this->full_upstairs_id = json(copyinstr(arg1), "ok.upstairs_id");

tools/dtrace/sled_upstairs_info.d

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* will share the PID, but have unique SESSIONs.
88
*/
99
#pragma D option quiet
10-
#pragma D option strsize=1k
10+
#pragma D option strsize=2k
1111
/*
1212
* Print the header right away
1313
*/
@@ -40,17 +40,20 @@ tick-1s
4040
* Translate the longer state string into a shorter version
4141
*/
4242
inline string short_state[string ss] =
43-
ss == "active" ? "ACT" :
44-
ss == "new" ? "NEW" :
45-
ss == "live_repair_ready" ? "LRR" :
46-
ss == "live_repair" ? "LR" :
47-
ss == "faulted" ? "FLT" :
48-
ss == "offline" ? "OFL" :
49-
ss == "reconcile" ? "REC" :
50-
ss == "wait_quorum" ? "WQ" :
51-
ss == "wait_active" ? "WA" :
52-
ss == "replaced" ? "RPL" :
53-
ss == "connecting" ? "CON" :
43+
ss == "Active" ? "ACT" :
44+
ss == "WaitQuorum" ? "WQ" :
45+
ss == "Reconcile" ? "REC" :
46+
ss == "LiveRepairReady" ? "LRR" :
47+
ss == "New" ? "NEW" :
48+
ss == "Faulted" ? "FLT" :
49+
ss == "Offline" ? "OFL" :
50+
ss == "LiveRepair" ? "LR" :
51+
ss == "Replacing" ? "RPC" :
52+
ss == "Replaced" ? "RPL" :
53+
ss == "Disabled" ? "DIS" :
54+
ss == "Deactivated" ? "DAV" :
55+
ss == "NegotiationFailed" ? "NF" :
56+
ss == "Fault" ? "FLT" :
5457
ss;
5558

5659
crucible_upstairs*:::up-status
@@ -59,13 +62,13 @@ crucible_upstairs*:::up-status
5962
this->upstairs_id = json(copyinstr(arg1), "ok.upstairs_id");
6063
this->session_id = json(copyinstr(arg1), "ok.session_id");
6164

62-
this->ds0state = json(copyinstr(arg1), "ok.ds_state[0].type");
65+
this->ds0state = json(copyinstr(arg1), "ok.ds_state[0]");
6366
this->d0 = short_state[this->ds0state];
6467

65-
this->ds1state = json(copyinstr(arg1), "ok.ds_state[1].type");
68+
this->ds1state = json(copyinstr(arg1), "ok.ds_state[1]");
6669
this->d1 = short_state[this->ds1state];
6770

68-
this->ds2state = json(copyinstr(arg1), "ok.ds_state[2].type");
71+
this->ds2state = json(copyinstr(arg1), "ok.ds_state[2]");
6972
this->d2 = short_state[this->ds2state];
7073

7174

0 commit comments

Comments
 (0)