X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=stat.c;h=718a8ab2acc1ee65618f132c3efabb9dc6ce7aef;hp=e43a336108f0f78c18dcc28d5baf6cd1859b576c;hb=ec94ec567cae47f91fa31a18250c2a7a0029d2ad;hpb=53cdc6864f7471b28cc9b40a5314ab43e5b1cb5e diff --git a/stat.c b/stat.c index e43a3361..718a8ab2 100644 --- a/stat.c +++ b/stat.c @@ -239,7 +239,8 @@ void init_disk_util(struct thread_data *td) log_err("unknown sysfs layout\n"); return; } - sprintf(foo, "%s", p); + strcpy(tmp, p); + sprintf(foo, "%s", tmp); } td->sysfs_root = strdup(foo); @@ -445,11 +446,9 @@ void show_run_stats(void) rs->min_bw[1] = rs->min_run[1] = ~0UL; } - for (i = 0; i < thread_number; i++) { + for_each_td(td, i) { unsigned long long rbw, wbw; - td = &threads[i]; - if (td->error) { fprintf(f_out, "%s: %s\n", td->name, td->verror); continue; @@ -500,8 +499,7 @@ void show_run_stats(void) if (!terse_output) printf("\n"); - for (i = 0; i < thread_number; i++) { - td = &threads[i]; + for_each_td(td, i) { rs = &runstats[td->groupid]; if (terse_output)