fio
fio copied to clipboard
Option in fio to log with the same epoch as CLOCK_MONOTONIC_RAW
Right now fio offers two options for the various bandwidth, latency, etc. log files. You can use an epoch that is very close to when fio starts running, or the unix epoch.
If you are trying to synchronize your fio logs with other data acquired from other processes during a fio run, neither of these is a great option. (A good example would be another process running to acquire temperature data from the disk being tested.)
The default epoch - when fio starts running - is private to fio. Other processes don't know what it is, and the logs all start with times close to 0. The unix epoch is obtained via gettimeofday(), and is subject to discontinuity and not guaranteed to be monotonic (e.g.,ntp adjustments)
For logs from two processes to be synchronized, they need to be able to speak in terms of a common epoch in a continuous and monotonic time system.
I'm pretty sure all that is needed to support synchronizing fio logs with other processes is to allow for a different epoch to be used - namely, whatever epoch is used by CLOCK_MONOTONIC_RAW (clock_gettime(CLOCK_MONOTONIC_RAW,ts);
) .
Would fio be open to this option? If so, I'd be happy to work on the PR. I'd expect it to only be a few lines of code.
That sounds useful, please do feel free to work on that change.
Thanks for the quick feedback. I'll try to get a PR fairly quickly - first time to build it so I'll be learning a bit.
@axboe I have a PR at https://github.com/axboe/fio/pull/1315 for this little feature. I'm not sure if y'all take PRs directly here or need it in a different format. Just let me know if you have any feedback, questions, or changes you'd like. Thanks!
This was fixed by https://github.com/axboe/fio/pull/1315