diff --git a/downstairs/Cargo.toml b/downstairs/Cargo.toml index b74a16aa2..81b1f4cce 100644 --- a/downstairs/Cargo.toml +++ b/downstairs/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.1" authors = ["Joshua M. Clulow ", "Alan Hanson " so the probe firing + * from different sessions don't collide with each other. + */ + this->full_session_id = json(copyinstr(arg1), "ok.session_id"); + this->session_id = substr(this->full_session_id, 0, 8); + this->next_id_str = json(copyinstr(arg1), "ok.next_job_id"); + this->next_id_value = strtoll(this->next_id_str); + + this->delta = this->next_id_value - last_id[this->session_id]; + + /* Set this for the next loop */ + last_id[this->session_id] = this->next_id_value; /* * 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 %5s %10s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s\n", - - substr(session_id, 0, 8), + 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", + this->session_id, /* * State for the three downstairs */ @@ -59,9 +75,10 @@ crucible_upstairs*:::up-status json(copyinstr(arg1), "ok.ds_count"), /* - * Job ID delta and backpressure + * Job ID, job delta and write bytes outstanding */ json(copyinstr(arg1), "ok.next_job_id"), + this->delta, json(copyinstr(arg1), "ok.write_bytes_out"), /* @@ -93,5 +110,4 @@ crucible_upstairs*:::up-status json(copyinstr(arg1), "ok.ds_extents_confirmed[0]"), json(copyinstr(arg1), "ok.ds_extents_confirmed[1]"), json(copyinstr(arg1), "ok.ds_extents_confirmed[2]")); - } diff --git a/tools/dtrace/sled_upstairs_info.d b/tools/dtrace/sled_upstairs_info.d index 28772bc06..6dbc85cba 100755 --- a/tools/dtrace/sled_upstairs_info.d +++ b/tools/dtrace/sled_upstairs_info.d @@ -39,7 +39,7 @@ tick-1s crucible_upstairs*:::up-status { show = show + 1; - session_id = json(copyinstr(arg1), "ok.session_id"); + this->session_id = json(copyinstr(arg1), "ok.session_id"); /* * I'm not very happy about this very long muli-line printf, but if @@ -48,7 +48,7 @@ crucible_upstairs*:::up-status */ printf("%5d %8s %17s %17s %17s %5s %5s %9s %10s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s\n", pid, - substr(session_id, 0, 8), + substr(this->session_id, 0, 8), /* State for the three downstairs */ json(copyinstr(arg1), "ok.ds_state[0]"), diff --git a/tools/dtrace/upstairs_info.d b/tools/dtrace/upstairs_info.d index 5cb4fc178..73d6e96a6 100755 --- a/tools/dtrace/upstairs_info.d +++ b/tools/dtrace/upstairs_info.d @@ -9,7 +9,6 @@ dtrace:::BEGIN { show = 21; - last[pid] = 0; } /* diff --git a/upstairs/Cargo.toml b/upstairs/Cargo.toml index ca4e37b7d..0e6c89e3a 100644 --- a/upstairs/Cargo.toml +++ b/upstairs/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.1" authors = ["Joshua M. Clulow ", "Alan Hanson (), } - if !self.downstairs.can_deactivate_immediately() { + if self.need_flush || !self.downstairs.can_deactivate_immediately() { debug!(self.log, "not ready to deactivate; submitting final flush"); let io_guard = self.try_acquire_io(0); self.submit_flush(None, None, io_guard);