filesize = ffsb_get_filesize(fname);
if (filesize < minsize || filesize > maxsize) {
- printf("size %llu bytes for file %s is invalid\n",
+ printf("size %"PRIu64" bytes for file %s is invalid\n",
filesize, fname);
return 1;
}
int i;
printf("\t Fileset weight:\n");
for (i = 0; i < fs->num_weights; i++)
- printf("\t\t %12llu (%6s) -> %u (%.2f\%)\n",
+ printf("\t\t %12"PRIu64" (%6s) -> %u (%.2f%%)\n",
fs->size_weights[i].size,
ffsb_printsize(buf, fs->size_weights[i].size, 256),
fs->size_weights[i].weight,
(float)fs->sum_weights) * 100);
}
else {
- printf("\t min file size = %llu\t(%s)\n", fs->minfilesize,
+ printf("\t min file size = %"PRIu64"\t(%s)\n", fs->minfilesize,
ffsb_printsize(buf, fs->minfilesize, 256));
- printf("\t max file size = %llu\t(%s)\n", fs->maxfilesize,
+ printf("\t max file size = %"PRIu64"\t(%s)\n", fs->maxfilesize,
ffsb_printsize(buf, fs->maxfilesize, 256));
}
printf("\t directio = %s\n", (fs->flags & FFSB_FS_DIRECTIO) ?
"on" : "off");
printf("\t\n");
printf("\t aging is %s\n", (fs->age_fs) ? "on" : "off");
- printf("\t current utilization = %.2f\%\n", getfsutil(fs->basedir)*100);
+ printf("\t current utilization = %.2f%%\n", getfsutil(fs->basedir)*100);
if (fs->age_fs) {
- printf("\t desired utilization = %.2lf%\n", fs->desired_fsutil * 100);
+ printf("\t desired utilization = %.2lf%%\n", fs->desired_fsutil * 100);
printf("\t \n");
tg_print_config_aging(fs->aging_tg, fs->basedir);
}
printf("\t\n");
}
-int fs_needs_stats(ffsb_fs_t *fs, syscall_t sys)
+intptr_t fs_needs_stats(ffsb_fs_t *fs, syscall_t sys)
{
- return (fs != NULL) ? (int)fs->fsd.config : 0;
+ return (fs != NULL) ? (intptr_t)(fs->fsd.config) : 0;
}
void fs_add_stat(ffsb_fs_t *fs, syscall_t sys, uint32_t val)
double fs_get_desired_fsutil(ffsb_fs_t *fs);
/* For these two, fs == NULL is OK */
-int fs_needs_stats(ffsb_fs_t *fs, syscall_t s);
+intptr_t fs_needs_stats(ffsb_fs_t *fs, syscall_t s);
void fs_add_stat(ffsb_fs_t *fs, syscall_t sys, uint32_t val);
#endif /* _FFSB_FS_H_ */
total_weight += results->op_weight[i];
}
- printf(" Op Name Transactions\t Trans/sec\t% Trans\t % Op Weight\t Throughput\n");
+ printf(" Op Name Transactions\t Trans/sec\t%% Trans\t %% Op Weight\t Throughput\n");
printf(" ======= ============\t =========\t=======\t ===========\t ==========\n");
for (i = 0; i < FFSB_NUMOPS ; i++)
if (results->ops[i] != 0)
printf("\t num_threads = %d\n", tg->num_threads);
printf("\t\n");
printf("\t read_random = %s\n", (tg->read_random) ? "on" : "off");
- printf("\t read_size = %llu\t(%s)\n", tg->read_size,
+ printf("\t read_size = %"PRIu64"\t(%s)\n", tg->read_size,
ffsb_printsize(buf, tg->read_size, 256));
printf("\t read_blocksize = %u\t(%s)\n", tg->read_blocksize,
ffsb_printsize(buf, tg->read_blocksize, 256));
ffsb_printsize(buf, tg->read_skipsize, 256));
printf("\t\n");
printf("\t write_random = %s\n", (tg->write_random) ? "on" : "off");
- printf("\t write_size = %llu\t(%s)\n", tg->write_size,
+ printf("\t write_size = %"PRIu64"\t(%s)\n", tg->write_size,
ffsb_printsize(buf, tg->write_size, 256));
printf("\t fsync_file = %d\n", tg->fsync_file);
printf("\t write_blocksize = %u\t(%s)\n", tg->write_blocksize,
}
if (realsize != size) {
- printf("Wrote %d instead of %d bytes.\n"
+ printf("Wrote %zd instead of %d bytes.\n"
"Probably out of disk space\n", realsize, size);
perror("write");
exit(1);
if (res == -1) {
if (whence == SEEK_SET)
- fprintf(stderr, "tried to seek to %lld\n", offset);
+ fprintf(stderr, "tried to seek to %"PRIu64"\n", offset);
else
fprintf(stderr, "tried to seek from current "
- "position to %lld\n", offset);
+ "position to %"PRIu64"\n", offset);
perror("seek");
exit(1);
(read_blocksize + read_skipsize);
if (minfilesize > filesize) {
- printf("Error: read size %llu bytes too big "
+ printf("Error: read size %"PRIu64" bytes too big "
"w/ skipsize %u and blocksize %u,"
- " for file of size %llu bytes\n"
+ " for file of size %"PRIu64" bytes\n"
" aborting\n\n", read_size,
read_skipsize, read_blocksize,
filesize);
printf("minimum file size must be at least "
- " %llu bytes\n", minfilesize);
+ " %"PRIu64" bytes\n", minfilesize);
exit(1);
}
total_usec = difftime.tv_sec * 1000000;
total_usec += difftime.tv_usec;
average = total_usec / 1000ull;
- printf("average time for gettimeofday(): %llu nsec\n", average);
+ printf("average time for gettimeofday(): %"PRIu64" nsec\n", average);
}
void ffsb_bench_getpid(void)
total_usec = difftime.tv_sec * 1000000;
total_usec += difftime.tv_usec;
average = total_usec / 1000ull;
- printf("average time for getpid(): %llu nsec\n", average);
+ printf("average time for getpid(): %"PRIu64" nsec\n", average);
}