Make log_unix_epoch an official alias of log_alternate_epoch
authoraggieNick02 <nick@pcpartpicker.com>
Fri, 8 Sep 2023 20:34:09 +0000 (15:34 -0500)
committeraggieNick02 <nick@pcpartpicker.com>
Fri, 8 Sep 2023 20:34:09 +0000 (15:34 -0500)
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 nick@pcpartpicker.com
HOWTO.rst
cconv.c
fio.1
options.c
stat.c
thread_options.h

index 9c825cc27dc6141242878f6e05f9e539b734ce03..7f26978a74efad628ed00264a56922bb755e621f 100644 (file)
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -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
 
@@ -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
 
diff --git a/cconv.c b/cconv.c
index b0127dd870f8c48252a9bfe7b8d44ccbdad0837d..341388d4568125c9bfc51bfb384b6e1909fecaf3 100644 (file)
--- a/cconv.c
+++ b/cconv.c
@@ -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);
@@ -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);
diff --git a/fio.1 b/fio.1
index 3e5b840c94bc2c71b4bc97a36e789b4f5f96021d..8159caa47f6e0856a346488a7dba6ce4912217ac 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -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
@@ -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
index 281ea609e41d4334f44b83679a2483707cdbf9a9..95001b4aafdb29b557359899acfe02cbf3b25467 100644 (file)
--- a/options.c
+++ b/options.c
@@ -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),
@@ -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,
        },
diff --git a/stat.c b/stat.c
index 8c8d69f0473ab8f33eaa0828d5e1a66065241145..7cf6bee1945aabea351f13853f5b32ba386881a9 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -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;
index 91c194cf7197df780c07e76cd23b168fdb33f535..fdde055e7d71932753b4b1fd500a510929f61693 100644 (file)
@@ -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;
@@ -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;
@@ -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;
@@ -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];