-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional scripts, single_up_info.d and sled_upstairs_info.d to give you a specific script for a specific PID, or for an entire system. A new script, all_downstairs.d, to display IO stats for all downstairs running on a system. Updated the README single_up_info.d requires a PID and adds a SESSION column to tell apart different upstairs inside a single process. sled_upstairs_info.d has both a PID and a SESSION column and will print out stats for the whole system. Co-authored-by: Alan Hanson <[email protected]>
- Loading branch information
Showing
5 changed files
with
369 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#pragma D option quiet | ||
/* | ||
* Print IO counters for all running downstairs. | ||
*/ | ||
crucible_downstairs*:::submit-flush-start | ||
{ | ||
@sf_start[pid] = count(); | ||
} | ||
|
||
crucible_downstairs*:::submit-flush-done | ||
{ | ||
@sf_done[pid] = count(); | ||
} | ||
|
||
crucible_downstairs*:::submit-write-start | ||
{ | ||
@sw_start[pid] = count(); | ||
} | ||
|
||
crucible_downstairs*:::submit-write-done | ||
{ | ||
@sw_done[pid] = count(); | ||
} | ||
|
||
crucible_downstairs*:::submit-read-start | ||
{ | ||
@sr_start[pid] = count(); | ||
} | ||
|
||
crucible_downstairs*:::submit-read-done | ||
{ | ||
@sr_done[pid] = count(); | ||
} | ||
|
||
crucible_downstairs*:::submit-writeunwritten-start | ||
{ | ||
@swu_start[pid] = count(); | ||
} | ||
|
||
crucible_downstairs*:::submit-writeunwritten-done | ||
{ | ||
@swu_done[pid] = count(); | ||
} | ||
crucible_downstairs*:::work-start | ||
{ | ||
@work_start[pid] = count(); | ||
} | ||
crucible_downstairs*:::work-process | ||
{ | ||
@work_process[pid] = count(); | ||
} | ||
crucible_downstairs*:::work-done | ||
{ | ||
@work_done[pid] = count(); | ||
} | ||
|
||
|
||
tick-4s | ||
{ | ||
printf("%5s %4s %4s %4s %4s %5s %5s %5s %5s %5s\n", | ||
"PID", "F>", "F<", "W>", "W<", "R>", "R<", "WS", "WIP", "WD"); | ||
printa("%05d %@4u %@4u %@4u %@4u %@5u %@5u %@5u %@5u %@5u\n", | ||
@sf_start, @sf_done, @sw_start, @sw_done, @sr_start, @sr_done, | ||
@work_start, @work_process, @work_done | ||
); | ||
clear(@sf_start); | ||
clear(@sf_done); | ||
clear(@sw_start); | ||
clear(@sw_done); | ||
clear(@sr_start); | ||
clear(@sr_done); | ||
clear(@swu_start); | ||
clear(@swu_done); | ||
clear(@work_start); | ||
clear(@work_process); | ||
clear(@work_done); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* | ||
* Display internal Upstairs status for the PID provided as $1 | ||
*/ | ||
#pragma D option quiet | ||
#pragma D option strsize=1k | ||
/* | ||
* Print the header right away | ||
*/ | ||
dtrace:::BEGIN | ||
{ | ||
show = 21; | ||
} | ||
|
||
/* | ||
* Every second, check and see if we have printed enough that it is | ||
* time to print the header again | ||
*/ | ||
tick-1s | ||
/show > 20/ | ||
{ | ||
printf("%8s ", "SESSION"); | ||
printf("%17s %17s %17s", "DS STATE 0", "DS STATE 1", "DS STATE 2"); | ||
printf(" %5s %5s %9s %5s", "UPW", "DSW", "NEXT_JOB", "BAKPR"); | ||
printf(" %10s", "WRITE_BO"); | ||
printf(" %5s %5s %5s", "NEW0", "NEW1", "NEW2"); | ||
printf(" %5s %5s %5s", "IP0", "IP1", "IP2"); | ||
printf(" %5s %5s %5s", "D0", "D1", "D2"); | ||
printf(" %5s %5s %5s", "S0", "S1", "S2"); | ||
printf(" %5s %5s %5s", "ER0", "ER1", "ER2"); | ||
printf(" %5s %5s %5s", "EC0", "EC1", "EC2"); | ||
printf("\n"); | ||
show = 0; | ||
} | ||
|
||
crucible_upstairs*:::up-status | ||
/pid==$1/ | ||
{ | ||
show = show + 1; | ||
session_id = json(copyinstr(arg1), "ok.session_id"); | ||
|
||
/* | ||
* 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 %9s %5s %10s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s\n", | ||
|
||
substr(session_id, 0, 8), | ||
|
||
/* | ||
* 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]"), | ||
|
||
/* | ||
* Work queue counts for Upstairs and Downstairs | ||
*/ | ||
json(copyinstr(arg1), "ok.up_count"), | ||
json(copyinstr(arg1), "ok.ds_count"), | ||
|
||
/* | ||
* Job ID delta and backpressure | ||
*/ | ||
json(copyinstr(arg1), "ok.next_job_id"), | ||
json(copyinstr(arg1), "ok.up_backpressure"), | ||
json(copyinstr(arg1), "ok.write_bytes_out"), | ||
|
||
/* | ||
* New jobs on the work list for each downstairs | ||
*/ | ||
json(copyinstr(arg1), "ok.ds_io_count.new[0]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.new[1]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.new[2]"), | ||
|
||
/* | ||
* In progress jobs on the work list for each downstairs | ||
*/ | ||
json(copyinstr(arg1), "ok.ds_io_count.in_progress[0]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.in_progress[1]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.in_progress[2]"), | ||
|
||
/* | ||
* Completed (done) jobs on the work list for each downstairs | ||
*/ | ||
json(copyinstr(arg1), "ok.ds_io_count.done[0]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.done[1]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.done[2]"), | ||
|
||
/* | ||
* Skipped jobs on the work list for each downstairs | ||
*/ | ||
json(copyinstr(arg1), "ok.ds_io_count.skipped[0]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.skipped[1]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.skipped[2]"), | ||
|
||
/* Extents Repaired */ | ||
json(copyinstr(arg1), "ok.ds_extents_repaired[0]"), | ||
json(copyinstr(arg1), "ok.ds_extents_repaired[1]"), | ||
json(copyinstr(arg1), "ok.ds_extents_repaired[2]"), | ||
/* Extents Confirmed */ | ||
json(copyinstr(arg1), "ok.ds_extents_confirmed[0]"), | ||
json(copyinstr(arg1), "ok.ds_extents_confirmed[1]"), | ||
json(copyinstr(arg1), "ok.ds_extents_confirmed[2]")); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* | ||
* Display internal Upstairs status. | ||
* This is an ease of use script that can be run on a sled and will | ||
* output stats for all propolis-server or pantry process (anything | ||
* that has an upstairs). The PID and SESSION will be unique for | ||
* an upstairs. Multiple disks attached to a single propolis server | ||
* will share the PID, but have unique SESSIONs. | ||
*/ | ||
#pragma D option quiet | ||
#pragma D option strsize=1k | ||
/* | ||
* Print the header right away | ||
*/ | ||
dtrace:::BEGIN | ||
{ | ||
show = 21; | ||
} | ||
|
||
/* | ||
* Every second, check and see if we have printed enough that it is | ||
* time to print the header again | ||
*/ | ||
tick-1s | ||
/show > 20/ | ||
{ | ||
printf("%5s %8s ", "PID", "SESSION"); | ||
printf("%17s %17s %17s", "DS STATE 0", "DS STATE 1", "DS STATE 2"); | ||
printf(" %5s %5s %9s %5s", "UPW", "DSW", "NEXT_JOB", "BAKPR"); | ||
printf(" %10s", "WRITE_BO"); | ||
printf(" %5s %5s %5s", "NEW0", "NEW1", "NEW2"); | ||
printf(" %5s %5s %5s", "IP0", "IP1", "IP2"); | ||
printf(" %5s %5s %5s", "D0", "D1", "D2"); | ||
printf(" %5s %5s %5s", "S0", "S1", "S2"); | ||
printf(" %5s %5s %5s", "ER0", "ER1", "ER2"); | ||
printf(" %5s %5s %5s", "EC0", "EC1", "EC2"); | ||
printf("\n"); | ||
show = 0; | ||
} | ||
|
||
crucible_upstairs*:::up-status | ||
{ | ||
show = show + 1; | ||
session_id = json(copyinstr(arg1), "ok.session_id"); | ||
|
||
/* | ||
* I'm not very happy about this very long muli-line printf, but if | ||
* we don't print it all on one line, then multiple sessions will | ||
* clobber each others output. | ||
*/ | ||
printf("%5d %8s %17s %17s %17s %5s %5s %9s %5s %10s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s\n", | ||
|
||
pid, | ||
substr(session_id, 0, 8), | ||
|
||
/* 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]"), | ||
|
||
/* Work queue counts for Upstairs and Downstairs */ | ||
json(copyinstr(arg1), "ok.up_count"), | ||
json(copyinstr(arg1), "ok.ds_count"), | ||
|
||
/* Job ID and backpressure */ | ||
json(copyinstr(arg1), "ok.next_job_id"), | ||
json(copyinstr(arg1), "ok.up_backpressure"), | ||
json(copyinstr(arg1), "ok.write_bytes_out"), | ||
|
||
/* New jobs on the work list for each downstairs */ | ||
json(copyinstr(arg1), "ok.ds_io_count.new[0]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.new[1]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.new[2]"), | ||
|
||
/* In progress jobs on the work list for each downstairs */ | ||
json(copyinstr(arg1), "ok.ds_io_count.in_progress[0]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.in_progress[1]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.in_progress[2]"), | ||
|
||
/* Completed (done) jobs on the work list for each downstairs */ | ||
json(copyinstr(arg1), "ok.ds_io_count.done[0]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.done[1]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.done[2]"), | ||
|
||
/* Skipped jobs on the work list for each downstairs */ | ||
json(copyinstr(arg1), "ok.ds_io_count.skipped[0]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.skipped[1]"), | ||
json(copyinstr(arg1), "ok.ds_io_count.skipped[2]"), | ||
|
||
/* Extents Repaired */ | ||
json(copyinstr(arg1), "ok.ds_extents_repaired[0]"), | ||
json(copyinstr(arg1), "ok.ds_extents_repaired[1]"), | ||
json(copyinstr(arg1), "ok.ds_extents_repaired[2]"), | ||
|
||
/* Extents Confirmed */ | ||
json(copyinstr(arg1), "ok.ds_extents_confirmed[0]"), | ||
json(copyinstr(arg1), "ok.ds_extents_confirmed[1]"), | ||
json(copyinstr(arg1), "ok.ds_extents_confirmed[2]")); | ||
} |