X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=stat.h;h=084724669bbb3ebed266933783d5a6478296af62;hp=289223cbe814e2b90d9d26b0ab272edbb3dc0e99;hb=21ba904bc046827309a340db62bc4e399ce412ac;hpb=b75a394fd0e9455ab71912d4462aaae7e6e4366b diff --git a/stat.h b/stat.h index 289223cb..08472466 100644 --- a/stat.h +++ b/stat.h @@ -1,6 +1,8 @@ #ifndef FIO_STAT_H #define FIO_STAT_H +#include "iolog.h" + struct group_run_stats { uint64_t max_run[2], min_run[2]; uint64_t max_bw[2], min_bw[2]; @@ -128,6 +130,7 @@ struct thread_stat { struct io_stat slat_stat[2]; /* submission latency */ struct io_stat lat_stat[2]; /* total latency */ struct io_stat bw_stat[2]; /* bandwidth stats */ + struct io_stat iops_stat[2]; /* IOPS stats */ /* * fio system usage accounting @@ -141,7 +144,7 @@ struct thread_stat { * IO depth and latency stats */ uint64_t clat_percentiles; - double *percentile_list; + fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN]; uint32_t io_u_map[FIO_IO_U_MAP_NR]; uint32_t io_u_submit[FIO_IO_U_MAP_NR]; @@ -173,16 +176,50 @@ struct jobs_eta { uint32_t nr_ramp; uint32_t nr_pending; uint32_t files_open; - uint32_t m_rate, t_rate; - uint32_t m_iops, t_iops; + uint32_t m_rate[2], t_rate[2]; + uint32_t m_iops[2], t_iops[2]; uint32_t rate[2]; uint32_t iops[2]; uint64_t elapsed_sec; uint64_t eta_sec; + + /* + * Network 'copy' of run_str[] + */ + uint32_t nr_threads; + uint8_t run_str[0]; }; extern void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs); extern void show_group_stats(struct group_run_stats *rs); - +extern int calc_thread_status(struct jobs_eta *je, int force); +extern void display_thread_status(struct jobs_eta *je); +extern void show_run_stats(void); +extern void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src, int nr); +extern void sum_group_stats(struct group_run_stats *dst, struct group_run_stats *src); +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 int calc_lat(struct io_stat *is, unsigned long *min, unsigned long *max, double *mean, double *dev); +extern unsigned int calc_clat_percentiles(unsigned int *io_u_plat, unsigned long nr, fio_fp64_t *plist, unsigned int **output, unsigned int *maxv, unsigned int *minv); +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(unsigned int *map, unsigned long total, double *io_u_dist); + +#define ts_total_io_u(ts) ((ts)->total_io_u[0] + (ts)->total_io_u[1]) + +static inline int usec_to_msec(unsigned long *min, unsigned long *max, + double *mean, double *dev) +{ + if (*min > 1000 && *max > 1000 && *mean > 1000.0 && *dev > 1000.0) { + *min /= 1000; + *max /= 1000; + *mean /= 1000.0; + *dev /= 1000.0; + return 0; + } + + return 1; +} #endif