Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Status and ETA code |
| 3 | */ |
| 4 | #include <unistd.h> |
| 5 | #include <fcntl.h> |
| 6 | #include <string.h> |
| 7 | |
| 8 | #include "fio.h" |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 9 | |
Jens Axboe | fca7035 | 2011-07-06 20:12:54 +0200 | [diff] [blame] | 10 | static char run_str[REAL_MAX_JOBS + 1]; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 11 | |
| 12 | /* |
| 13 | * Sets the status of the 'td' in the printed status map. |
| 14 | */ |
| 15 | static void check_str_update(struct thread_data *td) |
| 16 | { |
| 17 | char c = run_str[td->thread_number - 1]; |
| 18 | |
| 19 | switch (td->runstate) { |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 20 | case TD_REAPED: |
Jens Axboe | 4f7e57a | 2012-03-30 21:21:20 +0200 | [diff] [blame] | 21 | if (td->error) |
| 22 | c = 'X'; |
Jens Axboe | a5e371a | 2012-04-02 09:47:09 -0700 | [diff] [blame] | 23 | else if (td->sig) |
| 24 | c = 'K'; |
Jens Axboe | 4f7e57a | 2012-03-30 21:21:20 +0200 | [diff] [blame] | 25 | else |
| 26 | c = '_'; |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 27 | break; |
| 28 | case TD_EXITED: |
| 29 | c = 'E'; |
| 30 | break; |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 31 | case TD_RAMP: |
| 32 | c = '/'; |
| 33 | break; |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 34 | case TD_RUNNING: |
| 35 | if (td_rw(td)) { |
Jens Axboe | e3b3f81 | 2011-09-01 09:58:11 -0600 | [diff] [blame] | 36 | if (td_random(td)) { |
| 37 | if (td->o.rwmix[DDIR_READ] == 100) |
| 38 | c = 'r'; |
| 39 | else if (td->o.rwmix[DDIR_WRITE] == 100) |
| 40 | c = 'w'; |
| 41 | else |
| 42 | c = 'm'; |
| 43 | } else { |
| 44 | if (td->o.rwmix[DDIR_READ] == 100) |
| 45 | c = 'R'; |
| 46 | else if (td->o.rwmix[DDIR_WRITE] == 100) |
| 47 | c = 'W'; |
| 48 | else |
| 49 | c = 'M'; |
| 50 | } |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 51 | } else if (td_read(td)) { |
| 52 | if (td_random(td)) |
| 53 | c = 'r'; |
| 54 | else |
| 55 | c = 'R'; |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 56 | } else if (td_write(td)) { |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 57 | if (td_random(td)) |
| 58 | c = 'w'; |
| 59 | else |
| 60 | c = 'W'; |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 61 | } else { |
| 62 | if (td_random(td)) |
| 63 | c = 'd'; |
| 64 | else |
| 65 | c = 'D'; |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 66 | } |
| 67 | break; |
Jens Axboe | b0f6586 | 2009-05-20 11:52:15 +0200 | [diff] [blame] | 68 | case TD_PRE_READING: |
| 69 | c = 'p'; |
| 70 | break; |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 71 | case TD_VERIFYING: |
| 72 | c = 'V'; |
| 73 | break; |
| 74 | case TD_FSYNCING: |
| 75 | c = 'F'; |
| 76 | break; |
| 77 | case TD_CREATED: |
| 78 | c = 'C'; |
| 79 | break; |
| 80 | case TD_INITIALIZED: |
Jens Axboe | 9c6f631 | 2012-11-07 09:15:45 +0100 | [diff] [blame] | 81 | case TD_SETTING_UP: |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 82 | c = 'I'; |
| 83 | break; |
| 84 | case TD_NOT_CREATED: |
| 85 | c = 'P'; |
| 86 | break; |
| 87 | default: |
| 88 | log_err("state %d\n", td->runstate); |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | run_str[td->thread_number - 1] = c; |
| 92 | } |
| 93 | |
| 94 | /* |
| 95 | * Convert seconds to a printable string. |
| 96 | */ |
Jens Axboe | 3e47bd2 | 2012-02-29 13:45:02 +0100 | [diff] [blame] | 97 | void eta_to_str(char *str, unsigned long eta_sec) |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 98 | { |
| 99 | unsigned int d, h, m, s; |
Jens Axboe | 165faf1 | 2007-02-07 11:30:37 +0100 | [diff] [blame] | 100 | int disp_hour = 0; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 101 | |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 102 | s = eta_sec % 60; |
| 103 | eta_sec /= 60; |
| 104 | m = eta_sec % 60; |
| 105 | eta_sec /= 60; |
| 106 | h = eta_sec % 24; |
| 107 | eta_sec /= 24; |
| 108 | d = eta_sec; |
| 109 | |
Jens Axboe | 165faf1 | 2007-02-07 11:30:37 +0100 | [diff] [blame] | 110 | if (d) { |
| 111 | disp_hour = 1; |
Jens Axboe | 1e97cce | 2006-12-05 11:44:16 +0100 | [diff] [blame] | 112 | str += sprintf(str, "%02ud:", d); |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 113 | } |
Jens Axboe | 165faf1 | 2007-02-07 11:30:37 +0100 | [diff] [blame] | 114 | |
| 115 | if (h || disp_hour) |
Jens Axboe | 1e97cce | 2006-12-05 11:44:16 +0100 | [diff] [blame] | 116 | str += sprintf(str, "%02uh:", h); |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 117 | |
Jens Axboe | 1e97cce | 2006-12-05 11:44:16 +0100 | [diff] [blame] | 118 | str += sprintf(str, "%02um:", m); |
| 119 | str += sprintf(str, "%02us", s); |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | /* |
| 123 | * Best effort calculation of the estimated pending runtime of a job. |
| 124 | */ |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 125 | static int thread_eta(struct thread_data *td) |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 126 | { |
| 127 | unsigned long long bytes_total, bytes_done; |
Jens Axboe | 1e97cce | 2006-12-05 11:44:16 +0100 | [diff] [blame] | 128 | unsigned long eta_sec = 0; |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 129 | unsigned long elapsed; |
| 130 | |
| 131 | elapsed = (mtime_since_now(&td->epoch) + 999) / 1000; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 132 | |
| 133 | bytes_total = td->total_io_size; |
| 134 | |
Jens Axboe | 2e3bd4c | 2010-05-17 12:29:57 +0200 | [diff] [blame] | 135 | if (td->o.fill_device && td->o.size == -1ULL) { |
| 136 | if (!td->fill_device_size || td->fill_device_size == -1ULL) |
| 137 | return 0; |
| 138 | |
| 139 | bytes_total = td->fill_device_size; |
| 140 | } |
| 141 | |
Jens Axboe | 0d73a2f | 2013-02-07 12:54:10 +0100 | [diff] [blame] | 142 | if (td->o.zone_size && td->o.zone_skip && bytes_total) { |
| 143 | unsigned int nr_zones; |
| 144 | uint64_t zone_bytes; |
| 145 | |
| 146 | zone_bytes = bytes_total + td->o.zone_size + td->o.zone_skip; |
| 147 | nr_zones = (zone_bytes - 1) / (td->o.zone_size + td->o.zone_skip); |
| 148 | bytes_total -= nr_zones * td->o.zone_skip; |
| 149 | } |
| 150 | |
Jens Axboe | 74939e3 | 2006-10-19 20:37:12 +0200 | [diff] [blame] | 151 | /* |
Jens Axboe | 165eb05 | 2013-01-23 08:40:11 -0700 | [diff] [blame] | 152 | * if writing and verifying afterwards, bytes_total will be twice the |
| 153 | * size. In a mixed workload, verify phase will be the size of the |
| 154 | * first stage writes. |
Jens Axboe | 74939e3 | 2006-10-19 20:37:12 +0200 | [diff] [blame] | 155 | */ |
Jens Axboe | 0dd8377 | 2007-09-04 12:38:28 +0200 | [diff] [blame] | 156 | if (td->o.do_verify && td->o.verify && td_write(td)) { |
Jens Axboe | 165eb05 | 2013-01-23 08:40:11 -0700 | [diff] [blame] | 157 | if (td_rw(td)) { |
| 158 | unsigned int perc = 50; |
| 159 | |
| 160 | if (td->o.rwmix[DDIR_WRITE]) |
| 161 | perc = td->o.rwmix[DDIR_WRITE]; |
| 162 | |
| 163 | bytes_total += (bytes_total * perc) / 100; |
| 164 | } else |
Jens Axboe | 74939e3 | 2006-10-19 20:37:12 +0200 | [diff] [blame] | 165 | bytes_total <<= 1; |
| 166 | } |
| 167 | |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 168 | if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING) { |
Jens Axboe | cf4464c | 2007-04-17 20:14:42 +0200 | [diff] [blame] | 169 | double perc, perc_t; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 170 | |
Jens Axboe | 342f4be | 2012-09-14 08:59:20 +0200 | [diff] [blame] | 171 | bytes_done = ddir_rw_sum(td->io_bytes); |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 172 | perc = (double) bytes_done / (double) bytes_total; |
| 173 | if (perc > 1.0) |
| 174 | perc = 1.0; |
| 175 | |
Jens Axboe | cf4464c | 2007-04-17 20:14:42 +0200 | [diff] [blame] | 176 | if (td->o.time_based) { |
| 177 | perc_t = (double) elapsed / (double) td->o.timeout; |
| 178 | if (perc_t < perc) |
| 179 | perc = perc_t; |
| 180 | } |
| 181 | |
Jens Axboe | 1e97cce | 2006-12-05 11:44:16 +0100 | [diff] [blame] | 182 | eta_sec = (unsigned long) (elapsed * (1.0 / perc)) - elapsed; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 183 | |
Jens Axboe | d3eeeab | 2008-04-06 12:19:05 +0200 | [diff] [blame] | 184 | if (td->o.timeout && |
| 185 | eta_sec > (td->o.timeout + done_secs - elapsed)) |
| 186 | eta_sec = td->o.timeout + done_secs - elapsed; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 187 | } else if (td->runstate == TD_NOT_CREATED || td->runstate == TD_CREATED |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 188 | || td->runstate == TD_INITIALIZED |
Jens Axboe | 714e85f | 2013-04-15 10:21:56 +0200 | [diff] [blame] | 189 | || td->runstate == TD_SETTING_UP |
Jens Axboe | b0f6586 | 2009-05-20 11:52:15 +0200 | [diff] [blame] | 190 | || td->runstate == TD_RAMP |
| 191 | || td->runstate == TD_PRE_READING) { |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 192 | int t_eta = 0, r_eta = 0; |
Jens Axboe | 342f4be | 2012-09-14 08:59:20 +0200 | [diff] [blame] | 193 | unsigned long long rate_bytes; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 194 | |
| 195 | /* |
| 196 | * We can only guess - assume it'll run the full timeout |
| 197 | * if given, otherwise assume it'll run at the specified rate. |
| 198 | */ |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 199 | if (td->o.timeout) { |
Signed-off-by Steven Pratt | cda99fa | 2010-12-14 08:31:36 +0100 | [diff] [blame] | 200 | t_eta = td->o.timeout + td->o.start_delay + |
| 201 | td->o.ramp_time; |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 202 | |
| 203 | if (in_ramp_time(td)) { |
| 204 | unsigned long ramp_left; |
| 205 | |
Signed-off-by Steven Pratt | cda99fa | 2010-12-14 08:31:36 +0100 | [diff] [blame] | 206 | ramp_left = mtime_since_now(&td->epoch); |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 207 | ramp_left = (ramp_left + 999) / 1000; |
| 208 | if (ramp_left <= t_eta) |
| 209 | t_eta -= ramp_left; |
| 210 | } |
| 211 | } |
Jens Axboe | 342f4be | 2012-09-14 08:59:20 +0200 | [diff] [blame] | 212 | rate_bytes = ddir_rw_sum(td->o.rate); |
| 213 | if (rate_bytes) { |
| 214 | r_eta = (bytes_total / 1024) / rate_bytes; |
Jens Axboe | d3eeeab | 2008-04-06 12:19:05 +0200 | [diff] [blame] | 215 | r_eta += td->o.start_delay; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 216 | } |
| 217 | |
| 218 | if (r_eta && t_eta) |
| 219 | eta_sec = min(r_eta, t_eta); |
| 220 | else if (r_eta) |
| 221 | eta_sec = r_eta; |
| 222 | else if (t_eta) |
| 223 | eta_sec = t_eta; |
| 224 | else |
| 225 | eta_sec = 0; |
| 226 | } else { |
| 227 | /* |
| 228 | * thread is already done or waiting for fsync |
| 229 | */ |
| 230 | eta_sec = 0; |
| 231 | } |
| 232 | |
| 233 | return eta_sec; |
| 234 | } |
| 235 | |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 236 | static void calc_rate(int unified_rw_rep, unsigned long mtime, |
| 237 | unsigned long long *io_bytes, |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 238 | unsigned long long *prev_io_bytes, unsigned int *rate) |
| 239 | { |
Jens Axboe | b7f05eb | 2012-05-11 20:33:02 +0200 | [diff] [blame] | 240 | int i; |
| 241 | |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 242 | for (i = 0; i < DDIR_RWDIR_CNT; i++) { |
Jens Axboe | b7f05eb | 2012-05-11 20:33:02 +0200 | [diff] [blame] | 243 | unsigned long long diff; |
| 244 | |
| 245 | diff = io_bytes[i] - prev_io_bytes[i]; |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 246 | if (unified_rw_rep) { |
| 247 | rate[i] = 0; |
| 248 | rate[0] += ((1000 * diff) / mtime) / 1024; |
| 249 | } else |
| 250 | rate[i] = ((1000 * diff) / mtime) / 1024; |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 251 | |
| 252 | prev_io_bytes[i] = io_bytes[i]; |
Jens Axboe | b7f05eb | 2012-05-11 20:33:02 +0200 | [diff] [blame] | 253 | } |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 254 | } |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 255 | |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 256 | static void calc_iops(int unified_rw_rep, unsigned long mtime, |
| 257 | unsigned long long *io_iops, |
Jens Axboe | adb02ba | 2009-06-03 10:47:44 +0200 | [diff] [blame] | 258 | unsigned long long *prev_io_iops, unsigned int *iops) |
| 259 | { |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 260 | int i; |
| 261 | |
| 262 | for (i = 0; i < DDIR_RWDIR_CNT; i++) { |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 263 | unsigned long long diff; |
| 264 | |
| 265 | diff = io_iops[i] - prev_io_iops[i]; |
| 266 | if (unified_rw_rep) { |
| 267 | iops[i] = 0; |
| 268 | iops[0] += (diff * 1000) / mtime; |
| 269 | } else |
| 270 | iops[i] = (diff * 1000) / mtime; |
| 271 | |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 272 | prev_io_iops[i] = io_iops[i]; |
| 273 | } |
Jens Axboe | adb02ba | 2009-06-03 10:47:44 +0200 | [diff] [blame] | 274 | } |
| 275 | |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 276 | /* |
| 277 | * Print status of the jobs we know about. This includes rate estimates, |
| 278 | * ETA, thread state, etc. |
| 279 | */ |
Jens Axboe | af9c9fb | 2011-10-09 21:54:10 +0200 | [diff] [blame] | 280 | int calc_thread_status(struct jobs_eta *je, int force) |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 281 | { |
Jens Axboe | 34572e2 | 2006-10-20 09:33:18 +0200 | [diff] [blame] | 282 | struct thread_data *td; |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 283 | int i, unified_rw_rep; |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 284 | unsigned long rate_time, disp_time, bw_avg_time, *eta_secs; |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 285 | unsigned long long io_bytes[DDIR_RWDIR_CNT]; |
| 286 | unsigned long long io_iops[DDIR_RWDIR_CNT]; |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 287 | struct timeval now; |
| 288 | |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 289 | static unsigned long long rate_io_bytes[DDIR_RWDIR_CNT]; |
| 290 | static unsigned long long disp_io_bytes[DDIR_RWDIR_CNT]; |
| 291 | static unsigned long long disp_io_iops[DDIR_RWDIR_CNT]; |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 292 | static struct timeval rate_prev_time, disp_prev_time; |
Jens Axboe | 6043c57 | 2006-11-03 11:37:47 +0100 | [diff] [blame] | 293 | |
Jens Axboe | af9c9fb | 2011-10-09 21:54:10 +0200 | [diff] [blame] | 294 | if (!force) { |
Jens Axboe | fc47559 | 2013-01-31 15:24:34 +0100 | [diff] [blame] | 295 | if (output_format != FIO_OUTPUT_NORMAL && |
| 296 | f_out == stdout) |
Jens Axboe | f3afa57 | 2012-09-17 13:34:16 +0200 | [diff] [blame] | 297 | return 0; |
| 298 | if (temp_stall_ts || eta_print == FIO_ETA_NEVER) |
Jens Axboe | af9c9fb | 2011-10-09 21:54:10 +0200 | [diff] [blame] | 299 | return 0; |
Aaron Carroll | e592a06 | 2007-09-14 09:49:41 +0200 | [diff] [blame] | 300 | |
Jens Axboe | af9c9fb | 2011-10-09 21:54:10 +0200 | [diff] [blame] | 301 | if (!isatty(STDOUT_FILENO) && (eta_print != FIO_ETA_ALWAYS)) |
| 302 | return 0; |
| 303 | } |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 304 | |
Jens Axboe | 342f4be | 2012-09-14 08:59:20 +0200 | [diff] [blame] | 305 | if (!ddir_rw_sum(rate_io_bytes)) |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 306 | fill_start_time(&rate_prev_time); |
Jens Axboe | 342f4be | 2012-09-14 08:59:20 +0200 | [diff] [blame] | 307 | if (!ddir_rw_sum(disp_io_bytes)) |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 308 | fill_start_time(&disp_prev_time); |
Jens Axboe | 6043c57 | 2006-11-03 11:37:47 +0100 | [diff] [blame] | 309 | |
Jens Axboe | d3eeeab | 2008-04-06 12:19:05 +0200 | [diff] [blame] | 310 | eta_secs = malloc(thread_number * sizeof(unsigned long)); |
| 311 | memset(eta_secs, 0, thread_number * sizeof(unsigned long)); |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 312 | |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 313 | je->elapsed_sec = (mtime_since_genesis() + 999) / 1000; |
| 314 | |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 315 | io_bytes[DDIR_READ] = io_bytes[DDIR_WRITE] = io_bytes[DDIR_TRIM] = 0; |
| 316 | io_iops[DDIR_READ] = io_iops[DDIR_WRITE] = io_iops[DDIR_TRIM] = 0; |
Jens Axboe | bb3884d | 2007-01-17 17:23:11 +1100 | [diff] [blame] | 317 | bw_avg_time = ULONG_MAX; |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 318 | unified_rw_rep = 0; |
Jens Axboe | 34572e2 | 2006-10-20 09:33:18 +0200 | [diff] [blame] | 319 | for_each_td(td, i) { |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 320 | unified_rw_rep += td->o.unified_rw_rep; |
Jens Axboe | b7f05eb | 2012-05-11 20:33:02 +0200 | [diff] [blame] | 321 | if (is_power_of_2(td->o.kb_base)) |
| 322 | je->is_pow2 = 1; |
Steven Noonan | ad705bc | 2013-04-08 15:05:25 -0700 | [diff] [blame] | 323 | je->unit_base = td->o.unit_base; |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 324 | if (td->o.bw_avg_time < bw_avg_time) |
| 325 | bw_avg_time = td->o.bw_avg_time; |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 326 | if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING |
Jens Axboe | b0f6586 | 2009-05-20 11:52:15 +0200 | [diff] [blame] | 327 | || td->runstate == TD_FSYNCING |
| 328 | || td->runstate == TD_PRE_READING) { |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 329 | je->nr_running++; |
Jens Axboe | 242c38d | 2012-08-20 14:44:22 +0200 | [diff] [blame] | 330 | if (td_read(td)) { |
Jens Axboe | c2e9cc4 | 2012-08-21 15:34:13 +0200 | [diff] [blame] | 331 | je->t_rate[0] += td->o.rate[DDIR_READ]; |
| 332 | je->t_iops[0] += td->o.rate_iops[DDIR_READ]; |
| 333 | je->m_rate[0] += td->o.ratemin[DDIR_READ]; |
| 334 | je->m_iops[0] += td->o.rate_iops_min[DDIR_READ]; |
Jens Axboe | 242c38d | 2012-08-20 14:44:22 +0200 | [diff] [blame] | 335 | } |
| 336 | if (td_write(td)) { |
Jens Axboe | c2e9cc4 | 2012-08-21 15:34:13 +0200 | [diff] [blame] | 337 | je->t_rate[1] += td->o.rate[DDIR_WRITE]; |
| 338 | je->t_iops[1] += td->o.rate_iops[DDIR_WRITE]; |
| 339 | je->m_rate[1] += td->o.ratemin[DDIR_WRITE]; |
| 340 | je->m_iops[1] += td->o.rate_iops_min[DDIR_WRITE]; |
Jens Axboe | 242c38d | 2012-08-20 14:44:22 +0200 | [diff] [blame] | 341 | } |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 342 | if (td_trim(td)) { |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 343 | je->t_rate[2] += td->o.rate[DDIR_TRIM]; |
| 344 | je->t_iops[2] += td->o.rate_iops[DDIR_TRIM]; |
| 345 | je->m_rate[2] += td->o.ratemin[DDIR_TRIM]; |
| 346 | je->m_iops[2] += td->o.rate_iops_min[DDIR_TRIM]; |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 347 | } |
| 348 | |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 349 | je->files_open += td->nr_open_files; |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 350 | } else if (td->runstate == TD_RAMP) { |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 351 | je->nr_running++; |
| 352 | je->nr_ramp++; |
Jens Axboe | 714e85f | 2013-04-15 10:21:56 +0200 | [diff] [blame] | 353 | } else if (td->runstate == TD_SETTING_UP) { |
Jens Axboe | 9c6f631 | 2012-11-07 09:15:45 +0100 | [diff] [blame] | 354 | je->nr_running++; |
Jens Axboe | 714e85f | 2013-04-15 10:21:56 +0200 | [diff] [blame] | 355 | je->nr_setting_up++; |
| 356 | } else if (td->runstate < TD_RUNNING) |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 357 | je->nr_pending++; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 358 | |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 359 | if (je->elapsed_sec >= 3) |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 360 | eta_secs[i] = thread_eta(td); |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 361 | else |
| 362 | eta_secs[i] = INT_MAX; |
| 363 | |
| 364 | check_str_update(td); |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 365 | |
Jens Axboe | 714e85f | 2013-04-15 10:21:56 +0200 | [diff] [blame] | 366 | if (td->runstate > TD_SETTING_UP) { |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 367 | int ddir; |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 368 | |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 369 | for (ddir = DDIR_READ; ddir < DDIR_RWDIR_CNT; ddir++) { |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 370 | if (unified_rw_rep) { |
| 371 | io_bytes[0] += td->io_bytes[ddir]; |
| 372 | io_iops[0] += td->io_blocks[ddir]; |
| 373 | } else { |
| 374 | io_bytes[ddir] += td->io_bytes[ddir]; |
| 375 | io_iops[ddir] += td->io_blocks[ddir]; |
| 376 | } |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 377 | } |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 378 | } |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 379 | } |
| 380 | |
| 381 | if (exitall_on_terminate) |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 382 | je->eta_sec = INT_MAX; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 383 | else |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 384 | je->eta_sec = 0; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 385 | |
Jens Axboe | 34572e2 | 2006-10-20 09:33:18 +0200 | [diff] [blame] | 386 | for_each_td(td, i) { |
Shaozhi Shawn Ye | 9c5a385 | 2008-09-10 09:09:37 +0200 | [diff] [blame] | 387 | if (exitall_on_terminate) { |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 388 | if (eta_secs[i] < je->eta_sec) |
| 389 | je->eta_sec = eta_secs[i]; |
Shaozhi Shawn Ye | 9c5a385 | 2008-09-10 09:09:37 +0200 | [diff] [blame] | 390 | } else { |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 391 | if (eta_secs[i] > je->eta_sec) |
| 392 | je->eta_sec = eta_secs[i]; |
Shaozhi Shawn Ye | 9c5a385 | 2008-09-10 09:09:37 +0200 | [diff] [blame] | 393 | } |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 394 | } |
| 395 | |
Jens Axboe | eecf272 | 2006-10-20 14:00:36 +0200 | [diff] [blame] | 396 | free(eta_secs); |
| 397 | |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 398 | fio_gettime(&now, NULL); |
| 399 | rate_time = mtime_since(&rate_prev_time, &now); |
| 400 | |
Jens Axboe | b29ee5b | 2008-09-11 10:17:26 +0200 | [diff] [blame] | 401 | if (write_bw_log && rate_time > bw_avg_time && !in_ramp_time(td)) { |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 402 | calc_rate(unified_rw_rep, rate_time, io_bytes, rate_io_bytes, |
| 403 | je->rate); |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 404 | memcpy(&rate_prev_time, &now, sizeof(now)); |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 405 | add_agg_sample(je->rate[DDIR_READ], DDIR_READ, 0); |
| 406 | add_agg_sample(je->rate[DDIR_WRITE], DDIR_WRITE, 0); |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 407 | add_agg_sample(je->rate[DDIR_TRIM], DDIR_TRIM, 0); |
Jens Axboe | 6043c57 | 2006-11-03 11:37:47 +0100 | [diff] [blame] | 408 | } |
| 409 | |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 410 | disp_time = mtime_since(&disp_prev_time, &now); |
Jens Axboe | a5b01f1 | 2010-11-11 09:19:49 +0100 | [diff] [blame] | 411 | |
| 412 | /* |
| 413 | * Allow a little slack, the target is to print it every 1000 msecs |
| 414 | */ |
Jens Axboe | af9c9fb | 2011-10-09 21:54:10 +0200 | [diff] [blame] | 415 | if (!force && disp_time < 900) |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 416 | return 0; |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 417 | |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 418 | calc_rate(unified_rw_rep, disp_time, io_bytes, disp_io_bytes, je->rate); |
| 419 | calc_iops(unified_rw_rep, disp_time, io_iops, disp_io_iops, je->iops); |
Jens Axboe | adb02ba | 2009-06-03 10:47:44 +0200 | [diff] [blame] | 420 | |
Jens Axboe | 46fda8d | 2007-02-11 00:49:30 +0100 | [diff] [blame] | 421 | memcpy(&disp_prev_time, &now, sizeof(now)); |
| 422 | |
Jens Axboe | af9c9fb | 2011-10-09 21:54:10 +0200 | [diff] [blame] | 423 | if (!force && !je->nr_running && !je->nr_pending) |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 424 | return 0; |
| 425 | |
Jens Axboe | 1d1f45a | 2011-10-03 19:44:41 +0200 | [diff] [blame] | 426 | je->nr_threads = thread_number; |
| 427 | memcpy(je->run_str, run_str, thread_number * sizeof(char)); |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 428 | return 1; |
| 429 | } |
| 430 | |
Jens Axboe | cf451d1 | 2011-10-03 16:48:30 +0200 | [diff] [blame] | 431 | void display_thread_status(struct jobs_eta *je) |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 432 | { |
Jens Axboe | e382e66 | 2013-02-22 20:48:56 +0100 | [diff] [blame] | 433 | static struct timeval disp_eta_new_line; |
| 434 | static int eta_new_line_init, eta_new_line_pending; |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 435 | static int linelen_last; |
| 436 | static int eta_good; |
Jens Axboe | 79074e7 | 2012-04-18 20:39:48 +0200 | [diff] [blame] | 437 | char output[REAL_MAX_JOBS + 512], *p = output; |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 438 | char eta_str[128]; |
| 439 | double perc = 0.0; |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 440 | |
Jens Axboe | cf451d1 | 2011-10-03 16:48:30 +0200 | [diff] [blame] | 441 | if (je->eta_sec != INT_MAX && je->elapsed_sec) { |
| 442 | perc = (double) je->elapsed_sec / (double) (je->elapsed_sec + je->eta_sec); |
| 443 | eta_to_str(eta_str, je->eta_sec); |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 444 | } |
| 445 | |
Jens Axboe | e382e66 | 2013-02-22 20:48:56 +0100 | [diff] [blame] | 446 | if (eta_new_line_pending) { |
| 447 | eta_new_line_pending = 0; |
| 448 | p += sprintf(p, "\n"); |
| 449 | } |
| 450 | |
Jens Axboe | cf451d1 | 2011-10-03 16:48:30 +0200 | [diff] [blame] | 451 | p += sprintf(p, "Jobs: %d (f=%d)", je->nr_running, je->files_open); |
Jens Axboe | 3e47bd2 | 2012-02-29 13:45:02 +0100 | [diff] [blame] | 452 | if (je->m_rate[0] || je->m_rate[1] || je->t_rate[0] || je->t_rate[1]) { |
Jens Axboe | 581e714 | 2009-06-09 12:47:16 +0200 | [diff] [blame] | 453 | char *tr, *mr; |
| 454 | |
Jens Axboe | 22f8045 | 2013-04-09 20:29:16 +0200 | [diff] [blame] | 455 | mr = num2str(je->m_rate[0] + je->m_rate[1], 4, 0, je->is_pow2, 8); |
| 456 | tr = num2str(je->t_rate[0] + je->t_rate[1], 4, 0, je->is_pow2, 8); |
Jens Axboe | 37db14f | 2011-09-30 17:00:42 -0600 | [diff] [blame] | 457 | p += sprintf(p, ", CR=%s/%s KB/s", tr, mr); |
Jens Axboe | 581e714 | 2009-06-09 12:47:16 +0200 | [diff] [blame] | 458 | free(tr); |
| 459 | free(mr); |
Jens Axboe | 3e47bd2 | 2012-02-29 13:45:02 +0100 | [diff] [blame] | 460 | } else if (je->m_iops[0] || je->m_iops[1] || je->t_iops[0] || je->t_iops[1]) { |
| 461 | p += sprintf(p, ", CR=%d/%d IOPS", |
| 462 | je->t_iops[0] + je->t_iops[1], |
Jens Axboe | 88e4bea | 2012-08-21 15:34:36 +0200 | [diff] [blame] | 463 | je->m_iops[0] + je->m_iops[1]); |
Jens Axboe | 3e47bd2 | 2012-02-29 13:45:02 +0100 | [diff] [blame] | 464 | } |
Jens Axboe | cf451d1 | 2011-10-03 16:48:30 +0200 | [diff] [blame] | 465 | if (je->eta_sec != INT_MAX && je->nr_running) { |
Jens Axboe | 0721d11 | 2008-06-05 09:03:05 +0200 | [diff] [blame] | 466 | char perc_str[32]; |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 467 | char *iops_str[DDIR_RWDIR_CNT]; |
| 468 | char *rate_str[DDIR_RWDIR_CNT]; |
Jens Axboe | 79074e7 | 2012-04-18 20:39:48 +0200 | [diff] [blame] | 469 | size_t left; |
Jens Axboe | adb02ba | 2009-06-03 10:47:44 +0200 | [diff] [blame] | 470 | int l; |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 471 | int ddir; |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 472 | |
Jens Axboe | cf451d1 | 2011-10-03 16:48:30 +0200 | [diff] [blame] | 473 | if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running) |
Jens Axboe | cac58fd | 2008-06-06 01:17:03 +0200 | [diff] [blame] | 474 | strcpy(perc_str, "-.-% done"); |
| 475 | else { |
Jens Axboe | 714e85f | 2013-04-15 10:21:56 +0200 | [diff] [blame] | 476 | double mult = 100.0; |
| 477 | |
| 478 | if (je->nr_setting_up && je->nr_running) |
| 479 | mult *= (1.0 - (double) je->nr_setting_up / (double) je->nr_running); |
| 480 | |
Jens Axboe | cac58fd | 2008-06-06 01:17:03 +0200 | [diff] [blame] | 481 | eta_good = 1; |
Jens Axboe | 714e85f | 2013-04-15 10:21:56 +0200 | [diff] [blame] | 482 | perc *= mult; |
Jens Axboe | 0721d11 | 2008-06-05 09:03:05 +0200 | [diff] [blame] | 483 | sprintf(perc_str, "%3.1f%% done", perc); |
Jens Axboe | cac58fd | 2008-06-06 01:17:03 +0200 | [diff] [blame] | 484 | } |
Jens Axboe | 0721d11 | 2008-06-05 09:03:05 +0200 | [diff] [blame] | 485 | |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 486 | for (ddir = DDIR_READ; ddir < DDIR_RWDIR_CNT; ddir++) { |
| 487 | rate_str[ddir] = num2str(je->rate[ddir], 5, |
Steven Noonan | ad705bc | 2013-04-08 15:05:25 -0700 | [diff] [blame] | 488 | 1024, je->is_pow2, je->unit_base); |
Steven Noonan | 73798eb | 2013-04-05 16:57:38 -0700 | [diff] [blame] | 489 | iops_str[ddir] = num2str(je->iops[ddir], 4, 1, 0, 0); |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 490 | } |
Jens Axboe | adb02ba | 2009-06-03 10:47:44 +0200 | [diff] [blame] | 491 | |
Jens Axboe | 79074e7 | 2012-04-18 20:39:48 +0200 | [diff] [blame] | 492 | left = sizeof(output) - (p - output) - 1; |
| 493 | |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 494 | l = snprintf(p, left, ": [%s] [%s] [%s/%s/%s /s] [%s/%s/%s iops] [eta %s]", |
| 495 | je->run_str, perc_str, rate_str[DDIR_READ], |
| 496 | rate_str[DDIR_WRITE], rate_str[DDIR_TRIM], |
| 497 | iops_str[DDIR_READ], iops_str[DDIR_WRITE], |
| 498 | iops_str[DDIR_TRIM], eta_str); |
Jens Axboe | 37db14f | 2011-09-30 17:00:42 -0600 | [diff] [blame] | 499 | p += l; |
Jens Axboe | adb02ba | 2009-06-03 10:47:44 +0200 | [diff] [blame] | 500 | if (l >= 0 && l < linelen_last) |
Jens Axboe | 37db14f | 2011-09-30 17:00:42 -0600 | [diff] [blame] | 501 | p += sprintf(p, "%*s", linelen_last - l, ""); |
Jens Axboe | adb02ba | 2009-06-03 10:47:44 +0200 | [diff] [blame] | 502 | linelen_last = l; |
Jens Axboe | d1bd721 | 2009-06-03 10:53:45 +0200 | [diff] [blame] | 503 | |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 504 | for (ddir = DDIR_READ; ddir < DDIR_RWDIR_CNT; ddir++) { |
| 505 | free(rate_str[ddir]); |
| 506 | free(iops_str[ddir]); |
| 507 | } |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 508 | } |
Jens Axboe | 37db14f | 2011-09-30 17:00:42 -0600 | [diff] [blame] | 509 | p += sprintf(p, "\r"); |
| 510 | |
Jens Axboe | 3e47bd2 | 2012-02-29 13:45:02 +0100 | [diff] [blame] | 511 | printf("%s", output); |
Jens Axboe | e382e66 | 2013-02-22 20:48:56 +0100 | [diff] [blame] | 512 | |
| 513 | if (!eta_new_line_init) { |
| 514 | fio_gettime(&disp_eta_new_line, NULL); |
| 515 | eta_new_line_init = 1; |
| 516 | } else if (eta_new_line && |
| 517 | mtime_since_now(&disp_eta_new_line) > eta_new_line * 1000) { |
| 518 | fio_gettime(&disp_eta_new_line, NULL); |
| 519 | eta_new_line_pending = 1; |
| 520 | } |
| 521 | |
Jens Axboe | 3e47bd2 | 2012-02-29 13:45:02 +0100 | [diff] [blame] | 522 | fflush(stdout); |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 523 | } |
| 524 | |
Jens Axboe | cf451d1 | 2011-10-03 16:48:30 +0200 | [diff] [blame] | 525 | void print_thread_status(void) |
| 526 | { |
Jens Axboe | 1d1f45a | 2011-10-03 19:44:41 +0200 | [diff] [blame] | 527 | struct jobs_eta *je; |
Jens Axboe | b814fb2 | 2011-10-12 09:20:34 +0200 | [diff] [blame] | 528 | size_t size; |
Jens Axboe | cf451d1 | 2011-10-03 16:48:30 +0200 | [diff] [blame] | 529 | |
Jens Axboe | b814fb2 | 2011-10-12 09:20:34 +0200 | [diff] [blame] | 530 | if (!thread_number) |
| 531 | return; |
Jens Axboe | cf451d1 | 2011-10-03 16:48:30 +0200 | [diff] [blame] | 532 | |
Jens Axboe | b814fb2 | 2011-10-12 09:20:34 +0200 | [diff] [blame] | 533 | size = sizeof(*je) + thread_number * sizeof(char) + 1; |
| 534 | je = malloc(size); |
| 535 | memset(je, 0, size); |
Jens Axboe | cf451d1 | 2011-10-03 16:48:30 +0200 | [diff] [blame] | 536 | |
Jens Axboe | af9c9fb | 2011-10-09 21:54:10 +0200 | [diff] [blame] | 537 | if (calc_thread_status(je, 0)) |
Jens Axboe | 1d1f45a | 2011-10-03 19:44:41 +0200 | [diff] [blame] | 538 | display_thread_status(je); |
| 539 | |
| 540 | free(je); |
Jens Axboe | cf451d1 | 2011-10-03 16:48:30 +0200 | [diff] [blame] | 541 | } |
Jens Axboe | b75a394 | 2011-10-03 16:03:43 +0200 | [diff] [blame] | 542 | |
Jens Axboe | 2b13e71 | 2011-01-19 14:04:16 -0700 | [diff] [blame] | 543 | void print_status_init(int thr_number) |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 544 | { |
Jens Axboe | 2b13e71 | 2011-01-19 14:04:16 -0700 | [diff] [blame] | 545 | run_str[thr_number] = 'P'; |
Jens Axboe | 263e529 | 2006-10-18 15:37:01 +0200 | [diff] [blame] | 546 | } |