projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
testing: add test script for readonly parameter
[fio.git]
/
eta.c
diff --git
a/eta.c
b/eta.c
index c16b6cf9cdd4afd09da0ce206e3dc45e5804d34a..9111f5ec1e670bfc4177c12e24601795be291efb 100644
(file)
--- a/
eta.c
+++ b/
eta.c
@@
-2,8
+2,12
@@
* Status and ETA code
*/
#include <unistd.h>
* Status and ETA code
*/
#include <unistd.h>
-#include <fcntl.h>
#include <string.h>
#include <string.h>
+#ifdef CONFIG_VALGRIND_DEV
+#include <valgrind/drd.h>
+#else
+#define DRD_IGNORE_VAR(x) do { } while (0)
+#endif
#include "fio.h"
#include "lib/pow2.h"
#include "fio.h"
#include "lib/pow2.h"
@@
-145,7
+149,7
@@
void eta_to_str(char *str, unsigned long eta_sec)
str += sprintf(str, "%02uh:", h);
str += sprintf(str, "%02um:", m);
str += sprintf(str, "%02uh:", h);
str += sprintf(str, "%02um:", m);
- s
tr += s
printf(str, "%02us", s);
+ sprintf(str, "%02us", s);
}
/*
}
/*
@@
-520,7
+524,7
@@
void display_thread_status(struct jobs_eta *je)
static int eta_new_line_init, eta_new_line_pending;
static int linelen_last;
static int eta_good;
static int eta_new_line_init, eta_new_line_pending;
static int linelen_last;
static int eta_good;
- char output[
REAL_MAX_JOBS
+ 512], *p = output;
+ char output[
__THREAD_RUNSTR_SZ(REAL_MAX_JOBS)
+ 512], *p = output;
char eta_str[128];
double perc = 0.0;
char eta_str[128];
double perc = 0.0;
@@
-565,6
+569,7
@@
void display_thread_status(struct jobs_eta *je)
size_t left;
int l;
int ddir;
size_t left;
int l;
int ddir;
+ int linelen;
if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running ||
je->eta_sec == -1)
if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running ||
je->eta_sec == -1)
@@
-606,16
+611,17
@@
void display_thread_status(struct jobs_eta *je)
if (l >= left)
l = left - 1;
p += l;
if (l >= left)
l = left - 1;
p += l;
- if (l >= 0 && l < linelen_last)
- p += sprintf(p, "%*s", linelen_last - l, "");
- linelen_last = l;
+ linelen = p - output;
+ if (l >= 0 && linelen < linelen_last)
+ p += sprintf(p, "%*s", linelen_last - linelen, "");
+ linelen_last = linelen;
for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) {
free(rate_str[ddir]);
free(iops_str[ddir]);
}
}
for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) {
free(rate_str[ddir]);
free(iops_str[ddir]);
}
}
-
p +=
sprintf(p, "\r");
+ sprintf(p, "\r");
printf("%s", output);
printf("%s", output);
@@
-666,6
+672,7
@@
void print_thread_status(void)
void print_status_init(int thr_number)
{
void print_status_init(int thr_number)
{
+ DRD_IGNORE_VAR(__run_str);
__run_str[thr_number] = 'P';
update_condensed_str(__run_str, run_str);
}
__run_str[thr_number] = 'P';
update_condensed_str(__run_str, run_str);
}