Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Aug 21, 2025

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit efaeeea4a8b04e1c315943684aabd84f3198256b:

Merge branch 'fix-install-paths' of https://github.com/kubo326/fio (2025-08-19 11:09:24 -0400)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 4b327db09de9651a70e9a603e36c44715bf43c8b:

engines: make engines static-correct (2025-08-20 10:25:11 -0400)

----------------------------------------------------------------
Tomas Winkler (3):
stat: make stat.c static and const-correct engines/http: make fio_http_getevents static
engines: make engines static-correct

 engines/cpu.c  |   4 +--
 engines/exec.c |   6 ++--
 engines/http.c |   2 +-
 engines/nvme.c |   4 +--
 engines/sg.c   |   2 +-
 stat.c         | 100 ++++++++++++++++++++++++++++-----------------------------
 stat.h         |  24 +++++++-------
 steadystate.c  |   4 +--
 steadystate.h  |   4 +--
 9 files changed, 75 insertions(+), 75 deletions(-)

---

Diff of recent changes:

engines/cpu.c +2 -2
index ce74dbce..898fc00e 100644
@@ -9,7 +9,7 @@
 #include "../optgroup.h"
 
 // number of 32 bit integers to sort
-size_t qsort_size = (256 * (1ULL << 10)); // 256KB
+static size_t qsort_size = (256 * (1ULL << 10)); // 256KB
 
 struct mwc {
 	uint32_t w;
@@ -93,7 +93,7 @@ static struct fio_option options[] = {
  *      fast pseudo random number generator, see
  *      http://www.cse.yorku.ca/~oz/marsaglia-rng.html
  */
-uint32_t mwc32(struct mwc *mwc)
+static uint32_t mwc32(struct mwc *mwc)
 {
         mwc->z = 36969 * (mwc->z & 65535) + (mwc->z >> 16);
         mwc->w = 18000 * (mwc->w & 65535) + (mwc->w >> 16);
engines/exec.c +3 -3
index 20e50e00..af20d5e1 100644
@@ -62,7 +62,7 @@ static struct fio_option options[] = {
 	},
 };
 
-char *str_replace(char *orig, const char *rep, const char *with)
+static char *str_replace(char *orig, const char *rep, const char *with)
 {
 	/*
 	 * Replace a substring by another.
@@ -106,7 +106,7 @@ char *str_replace(char *orig, const char *rep, const char *with)
 	return result;
 }
 
-char *expand_variables(struct thread_options *o, char *arguments)
+static char *expand_variables(const struct thread_options *o, char *arguments)
 {
 	char str[16];
 	char *expanded_runtime, *expanded_name;
@@ -122,7 +122,7 @@ char *expand_variables(struct thread_options *o, char *arguments)
 	return expanded_name;
 }
 
-static int exec_background(struct thread_options *o, struct exec_options *eo)
+static int exec_background(const struct thread_options *o, struct exec_options *eo)
 {
 	char *outfilename = NULL, *errfilename = NULL;
 	int outfd = 0, errfd = 0;
engines/http.c +1 -1
index 1a1787bf..83891f1f 100644
@@ -810,7 +810,7 @@ static struct io_u *fio_http_event(struct thread_data *td, int event)
 	return NULL;
 }
 
-int fio_http_getevents(struct thread_data *td, unsigned int min,
+static int fio_http_getevents(struct thread_data *td, unsigned int min,
 	unsigned int max, const struct timespec *t)
 {
 	/* sync IO engine - never any outstanding events */
engines/nvme.c +2 -2
index 4b3d3860..528b2a29 100644
@@ -312,8 +312,8 @@ next:
 
 	return 0;
 }
-void fio_nvme_uring_cmd_trim_prep(struct nvme_uring_cmd *cmd, struct io_u *io_u,
-				  struct nvme_dsm *dsm)
+static void fio_nvme_uring_cmd_trim_prep(struct nvme_uring_cmd *cmd, struct io_u *io_u,
+					 struct nvme_dsm *dsm)
 {
 	struct nvme_data *data = FILE_ENG_DATA(io_u->file);
 	struct trim_range *range;
engines/sg.c +1 -1
index 9df70bd2..7912e9c8 100644
@@ -1136,7 +1136,7 @@ static int fio_sgio_open(struct thread_data *td, struct fio_file *f)
 	return 0;
 }
 
-int fio_sgio_close(struct thread_data *td, struct fio_file *f)
+static int fio_sgio_close(struct thread_data *td, struct fio_file *f)
 {
 	struct sg_options *o = td->eo;
 	int ret;
stat.c +50 -50

334 lines not on this page · raw message

stat.h +12 -12
index ac74d6c2..02bea976 100644
@@ -344,24 +344,24 @@ extern void stat_init(void);
 extern void stat_exit(void);
 
 extern struct json_object * show_thread_status(struct thread_stat *ts, struct group_run_stats *rs, struct flist_head *, struct buf_output *);
-extern void show_group_stats(struct group_run_stats *rs, struct buf_output *);
+extern void show_group_stats(const struct group_run_stats *rs, struct buf_output *);
 extern void display_thread_status(struct jobs_eta *je);
 extern void __show_run_stats(void);
 extern int __show_running_run_stats(void);
 extern void show_running_run_stats(void);
 extern void check_for_running_stats(void);
-extern void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src);
-extern void sum_group_stats(struct group_run_stats *dst, struct group_run_stats *src);
+extern void sum_thread_stats(struct thread_stat *dst, const struct thread_stat *src);
+extern void sum_group_stats(struct group_run_stats *dst, const struct group_run_stats *src);
 extern void init_thread_stat_min_vals(struct thread_stat *ts);
 extern void init_thread_stat(struct thread_stat *ts);
 extern void init_group_run_stat(struct group_run_stats *gs);
 extern void eta_to_str(char *str, unsigned long eta_sec);
-extern bool calc_lat(struct io_stat *is, unsigned long long *min, unsigned long long *max, double *mean, double *dev);
-extern unsigned int calc_clat_percentiles(uint64_t *io_u_plat, unsigned long long nr, fio_fp64_t *plist, unsigned long long **output, unsigned long long *maxv, unsigned long long *minv);
-extern void stat_calc_lat_n(struct thread_stat *ts, double *io_u_lat);
-extern void stat_calc_lat_m(struct thread_stat *ts, double *io_u_lat);
-extern void stat_calc_lat_u(struct thread_stat *ts, double *io_u_lat);
-extern void stat_calc_dist(uint64_t *map, unsigned long total, double *io_u_dist);
+extern bool calc_lat(const struct io_stat *is, unsigned long long *min, unsigned long long *max, double *mean, double *dev);
+extern unsigned int calc_clat_percentiles(const uint64_t *io_u_plat, unsigned long long nr, fio_fp64_t *plist, unsigned long long **output, unsigned long long *maxv, unsigned long long *minv);
+extern void stat_calc_lat_n(const struct thread_stat *ts, double *io_u_lat);
+extern void stat_calc_lat_m(const struct thread_stat *ts, double *io_u_lat);
+extern void stat_calc_lat_u(const struct thread_stat *ts, double *io_u_lat);
+extern void stat_calc_dist(const uint64_t *map, unsigned long total, double *io_u_dist);
 extern void reset_io_stats(struct thread_data *);
 extern void update_rusage_stat(struct thread_data *);
 extern void clear_rusage_stat(struct thread_data *);
@@ -384,9 +384,9 @@ extern int calc_log_samples(void);
 extern void free_clat_prio_stats(struct thread_stat *);
 extern int alloc_clat_prio_stat_ddir(struct thread_stat *, enum fio_ddir, int);
 
-extern void print_disk_util(struct disk_util_stat *, struct disk_util_agg *, int terse, struct buf_output *);
-extern void json_array_add_disk_util(struct disk_util_stat *dus,
-				struct disk_util_agg *agg, struct json_array *parent);
+extern void print_disk_util(const struct disk_util_stat *, const struct disk_util_agg *, int terse, struct buf_output *);
+extern void json_array_add_disk_util(const struct disk_util_stat *dus,
+				     const struct disk_util_agg *agg, struct json_array *parent);
 
 extern struct io_log *agg_io_log[DDIR_RWDIR_CNT];
 extern bool write_bw_log;
steadystate.c +2 -2
index 3e3683f3..9e47df2c 100644
@@ -353,7 +353,7 @@ int td_steadystate_init(struct thread_data *td)
 	return 0;
 }
 
-uint64_t steadystate_bw_mean(struct thread_stat *ts)
+uint64_t steadystate_bw_mean(const struct thread_stat *ts)
 {
 	int i;
 	uint64_t sum;
@@ -368,7 +368,7 @@ uint64_t steadystate_bw_mean(struct thread_stat *ts)
 	return sum / intervals;
 }
 
-uint64_t steadystate_iops_mean(struct thread_stat *ts)
+uint64_t steadystate_iops_mean(const struct thread_stat *ts)
 {
 	int i;
 	uint64_t sum;
steadystate.h +2 -2
index f1ef2b20..e25fd9d0 100644
@@ -7,8 +7,8 @@ extern void steadystate_free(struct thread_data *);
 extern int steadystate_check(void);
 extern void steadystate_setup(void);
 extern int td_steadystate_init(struct thread_data *);
-extern uint64_t steadystate_bw_mean(struct thread_stat *);
-extern uint64_t steadystate_iops_mean(struct thread_stat *);
+extern uint64_t steadystate_bw_mean(const struct thread_stat *);
+extern uint64_t steadystate_iops_mean(const struct thread_stat *);
 
 extern bool steadystate_enabled;
 extern unsigned int ss_check_interval;