Skip to content

Commit

Permalink
Make log_unix_epoch an official alias of log_alternate_epoch
Browse files Browse the repository at this point in the history
log_alternate_epoch was introduced along with
log_alternate_epoch_clock_id, and generalized the idea of
log_unix_epoch. Both options had the same effect. So we make
log_unix_epoch an official alias of log_alternate_epoch, instead of
maintaining both redundant options.

Signed-off-by: Nick Neumann [email protected]
  • Loading branch information
aggieNick02 committed Sep 8, 2023
1 parent 12d325c commit d252275
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 29 deletions.
10 changes: 4 additions & 6 deletions HOWTO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4114,9 +4114,7 @@ Measurements and reporting

.. option:: log_unix_epoch=bool

If set, fio will log Unix timestamps to the log files produced by enabling
write_type_log for each log type, instead of the default zero-based
timestamps.
Backwards compatible alias for log_alternate_epoch.

.. option:: log_alternate_epoch=bool

Expand All @@ -4127,9 +4125,9 @@ Measurements and reporting

.. option:: log_alternate_epoch_clock_id=int

Specifies the clock_id to be used by clock_gettime to obtain the alternate epoch
if either log_unix_epoch or log_alternate_epoch are true. Otherwise has no
effect. Default value is 0, or CLOCK_REALTIME.
Specifies the clock_id to be used by clock_gettime to obtain the alternate
epoch if log_alternate_epoch is true. Otherwise has no effect. Default
value is 0, or CLOCK_REALTIME.

.. option:: block_error_percentiles=bool

Expand Down
2 changes: 0 additions & 2 deletions cconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ int convert_thread_options_to_cpu(struct thread_options *o,
o->log_prio = le32_to_cpu(top->log_prio);
o->log_gz = le32_to_cpu(top->log_gz);
o->log_gz_store = le32_to_cpu(top->log_gz_store);
o->log_unix_epoch = le32_to_cpu(top->log_unix_epoch);
o->log_alternate_epoch = le32_to_cpu(top->log_alternate_epoch);
o->log_alternate_epoch_clock_id = le32_to_cpu(top->log_alternate_epoch_clock_id);
o->job_start_clock_id = le32_to_cpu(top->job_start_clock_id);
Expand Down Expand Up @@ -456,7 +455,6 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
top->log_prio = cpu_to_le32(o->log_prio);
top->log_gz = cpu_to_le32(o->log_gz);
top->log_gz_store = cpu_to_le32(o->log_gz_store);
top->log_unix_epoch = cpu_to_le32(o->log_unix_epoch);
top->log_alternate_epoch = cpu_to_le32(o->log_alternate_epoch);
top->log_alternate_epoch_clock_id = cpu_to_le32(o->log_alternate_epoch_clock_id);
top->job_start_clock_id = cpu_to_le32(o->job_start_clock_id);
Expand Down
10 changes: 4 additions & 6 deletions fio.1
Original file line number Diff line number Diff line change
Expand Up @@ -3808,9 +3808,7 @@ decompressed with fio, using the \fB\-\-inflate\-log\fR command line
parameter. The files will be stored with a `.fz' suffix.
.TP
.BI log_unix_epoch \fR=\fPbool
If set, fio will log Unix timestamps to the log files produced by enabling
write_type_log for each log type, instead of the default zero-based
timestamps.
Backward-compatible alias for \fBlog_alternate_epoch\fR.
.TP
.BI log_alternate_epoch \fR=\fPbool
If set, fio will log timestamps based on the epoch used by the clock specified
Expand All @@ -3819,9 +3817,9 @@ enabling write_type_log for each log type, instead of the default zero-based
timestamps.
.TP
.BI log_alternate_epoch_clock_id \fR=\fPint
Specifies the clock_id to be used by clock_gettime to obtain the alternate epoch
if either \fBBlog_unix_epoch\fR or \fBlog_alternate_epoch\fR are true. Otherwise has no
effect. Default value is 0, or CLOCK_REALTIME.
Specifies the clock_id to be used by clock_gettime to obtain the alternate
epoch if \fBlog_alternate_epoch\fR is true. Otherwise has no effect. Default
value is 0, or CLOCK_REALTIME.
.TP
.BI block_error_percentiles \fR=\fPbool
If set, record errors in trim block-sized units from writes and trims and
Expand Down
12 changes: 2 additions & 10 deletions options.c
Original file line number Diff line number Diff line change
Expand Up @@ -4600,17 +4600,9 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
.help = "Install libz-dev(el) to get compression support",
},
#endif
{
.name = "log_unix_epoch",
.lname = "Log epoch unix",
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct thread_options, log_unix_epoch),
.help = "Use Unix time in log files",
.category = FIO_OPT_C_LOG,
.group = FIO_OPT_G_INVALID,
},
{
.name = "log_alternate_epoch",
.alias = "log_unix_epoch",
.lname = "Log epoch alternate",
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct thread_options, log_alternate_epoch),
Expand All @@ -4623,7 +4615,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
.lname = "Log alternate epoch clock_id",
.type = FIO_OPT_INT,
.off1 = offsetof(struct thread_options, log_alternate_epoch_clock_id),
.help = "If log_alternate_epoch or log_unix_epoch is true, this option specifies the clock_id from clock_gettime whose epoch should be used. If neither of those is true, this option has no effect. Default value is 0, or CLOCK_REALTIME",
.help = "If log_alternate_epoch is true, this option specifies the clock_id from clock_gettime whose epoch should be used. If log_alternate_epoch is false, this option has no effect. Default value is 0, or CLOCK_REALTIME",
.category = FIO_OPT_C_LOG,
.group = FIO_OPT_G_INVALID,
},
Expand Down
2 changes: 1 addition & 1 deletion stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -3051,7 +3051,7 @@ static void __add_log_sample(struct io_log *iolog, union io_sample_data data,

s->data = data;
s->time = t;
if (iolog->td && (iolog->td->o.log_unix_epoch || iolog->td->o.log_alternate_epoch))
if (iolog->td && iolog->td->o.log_alternate_epoch)
s->time += iolog->td->alternate_epoch;
io_sample_set_ddir(iolog, s, ddir);
s->bs = bs;
Expand Down
5 changes: 1 addition & 4 deletions thread_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ struct thread_options {
unsigned int log_offset;
unsigned int log_gz;
unsigned int log_gz_store;
unsigned int log_unix_epoch;
unsigned int log_alternate_epoch;
unsigned int log_alternate_epoch_clock_id;
unsigned int norandommap;
Expand Down Expand Up @@ -492,7 +491,6 @@ struct thread_options_pack {
uint32_t log_offset;
uint32_t log_gz;
uint32_t log_gz_store;
uint32_t log_unix_epoch;
uint32_t log_alternate_epoch;
uint32_t log_alternate_epoch_clock_id;
uint32_t norandommap;
Expand All @@ -509,7 +507,6 @@ struct thread_options_pack {
struct zone_split zone_split[DDIR_RWDIR_CNT][ZONESPLIT_MAX];
uint32_t zone_split_nr[DDIR_RWDIR_CNT];

uint32_t pad;
fio_fp64_t zipf_theta;
fio_fp64_t pareto_h;
fio_fp64_t gauss_dev;
Expand Down Expand Up @@ -603,7 +600,7 @@ struct thread_options_pack {
uint32_t lat_percentiles;
uint32_t slat_percentiles;
uint32_t percentile_precision;
uint32_t pad2;
uint32_t pad;
fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];

uint8_t read_iolog_file[FIO_TOP_STR_MAX];
Expand Down

0 comments on commit d252275

Please sign in to comment.