From d252275b59feb8ca92078ca8f61bab691e539186 Mon Sep 17 00:00:00 2001 From: aggieNick02 Date: Fri, 8 Sep 2023 15:34:09 -0500 Subject: [PATCH] Make log_unix_epoch an official alias of log_alternate_epoch 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 | 10 ++++------ cconv.c | 2 -- fio.1 | 10 ++++------ options.c | 12 ++---------- stat.c | 2 +- thread_options.h | 5 +---- 6 files changed, 12 insertions(+), 29 deletions(-) diff --git a/HOWTO.rst b/HOWTO.rst index 9c825cc2..7f26978a 100644 --- 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 b0127dd8..341388d4 100644 --- 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 3e5b840c..8159caa4 100644 --- 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 diff --git a/options.c b/options.c index 281ea609..95001b4a 100644 --- 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 8c8d69f0..7cf6bee1 100644 --- 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; diff --git a/thread_options.h b/thread_options.h index 91c194cf..fdde055e 100644 --- a/thread_options.h +++ b/thread_options.h @@ -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]; -- 2.25.1