- rt = runtime.r.tv_sec+runtime.r.tv_usec/1000000.0;
- snprintf(kb_str, sizeof(kb_str), "%ld", dumpsize - headersize);
- snprintf(kps_str, sizeof(kps_str), "%3.1f",
- rt ? dumpsize / rt : 0.0);
- errstr = newvstralloc(errstr,
- "sec ", walltime_str(runtime),
- " kb ", kb_str,
- " kps ", kps_str,
- NULL);
- q = squotef("[%s]", errstr);
- if(command_in_transit != -1)
- cmd = command_in_transit;
- else
- cmd = getcmd(&cmdargs);
- switch(cmd) {
+ rt = g_timeval_to_double(runtime);
+ g_snprintf(kb_str, SIZEOF(kb_str), "%lld",
+ (long long)(dumpsize - (off_t)headersize));
+ g_snprintf(kps_str, SIZEOF(kps_str), "%3.1lf",
+ isnormal(rt) ? (double)dumpsize / rt : 0.0);
+ errstr = newvstrallocf(errstr, "sec %s kb %s kps %s",
+ walltime_str(runtime), kb_str, kps_str);
+ m = vstrallocf("[%s]", errstr);
+ q = quote_string(m);
+ amfree(m);
+ if(command_in_transit != NULL) {
+ cmdargs = command_in_transit;
+ command_in_transit = NULL;
+ } else {
+ cmdargs = getcmd();
+ }
+ switch(cmdargs->cmd) {