summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1b4f8c7)
If you run a lot of jobs, the ETA output string will become way too
long. Add some condensing so that instead of displaying:
Jobs: 80 (f=80): [rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr] [10.2% done] [2110MB/0KB/0KB /s] [540K/0/0 iops] [eta 53m:55s]
we just display
Jobs: 80 (f=80): [r(80)] [10.2% done] [2110MB/0KB/0KB /s] [540K/0/0 iops] [eta 53m:55s]
instead.
Signed-off-by: Jens Axboe <axboe@fb.com>
X Thread reaped, exited with an error.
K Thread reaped, exited due to signal.
X Thread reaped, exited with an error.
K Thread reaped, exited due to signal.
+Fio will condense the thread string as not to take up more space on the
+command line as is needed. For instance, if you have 10 readers and 10
+writers running, the output would look like this:
+
+Jobs: 20 (f=20): [R(10),W(10)] [4.0% done] [2103MB/0KB/0KB /s] [538K/0/0 iops] [eta 57m:36s]
+
+Fio will still maintain the ordering, though. So the above means that jobs
+1..10 are readers, and 11..20 are writers.
+
The other values are fairly self explanatory - number of threads
currently running and doing io, rate of io since last check (read speed
listed first, then write speed), and the estimated completion percentage
The other values are fairly self explanatory - number of threads
currently running and doing io, rate of io since last check (read speed
listed first, then write speed), and the estimated completion percentage
-static char run_str[REAL_MAX_JOBS + 1];
+static char __run_str[REAL_MAX_JOBS + 1];
+
+/*
+ * Worst level condensing would be 1:4, so allow enough room for that
+ */
+static char run_str[(4 * REAL_MAX_JOBS) + 1];
+
+static void update_condensed_str(char *run_str, char *run_str_condensed)
+{
+ int i, ci, last, nr;
+ size_t len;
+
+ len = strlen(run_str);
+ if (!len)
+ return;
+
+ last = 0;
+ nr = 0;
+ ci = 0;
+ for (i = 0; i < len; i++) {
+ if (!last) {
+new:
+ run_str_condensed[ci] = run_str[i];
+ last = run_str[i];
+ nr = 1;
+ ci++;
+ } else if (last == run_str[i]) {
+ nr++;
+ } else {
+ int elen;
+
+ elen = sprintf(&run_str_condensed[ci], "(%u),", nr);
+ ci += elen;
+ goto new;
+ }
+ }
+
+ if (nr)
+ sprintf(&run_str_condensed[ci], "(%u)", nr);
+}
+
/*
* Sets the status of the 'td' in the printed status map.
*/
static void check_str_update(struct thread_data *td)
{
/*
* Sets the status of the 'td' in the printed status map.
*/
static void check_str_update(struct thread_data *td)
{
- char c = run_str[td->thread_number - 1];
+ char c = __run_str[td->thread_number - 1];
switch (td->runstate) {
case TD_REAPED:
switch (td->runstate) {
case TD_REAPED:
log_err("state %d\n", td->runstate);
}
log_err("state %d\n", td->runstate);
}
- run_str[td->thread_number - 1] = c;
+ __run_str[td->thread_number - 1] = c;
+ update_condensed_str(__run_str, run_str);
void print_status_init(int thr_number)
{
void print_status_init(int thr_number)
{
- run_str[thr_number] = 'P';
+ __run_str[thr_number] = 'P';
+ update_condensed_str(__run_str, run_str);