X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=stat.h;h=3fda084156bbfb984d34985e686a33ad3bb44082;hp=ea45c00c2857c4479843d9ab66b0ce6d2508bd1a;hb=132b1ee42e63a5ca369d94d33d2a7337741d7458;hpb=d6bb626ef37d3905221ade2887b422717a07af09 diff --git a/stat.h b/stat.h index ea45c00c..3fda0841 100644 --- a/stat.h +++ b/stat.h @@ -23,6 +23,16 @@ struct group_run_stats { #define FIO_IO_U_LAT_U_NR 10 #define FIO_IO_U_LAT_M_NR 12 +/* + * Constants for clat percentiles + */ +#define FIO_IO_U_PLAT_BITS 6 +#define FIO_IO_U_PLAT_VAL (1 << FIO_IO_U_PLAT_BITS) +#define FIO_IO_U_PLAT_GROUP_NR 29 +#define FIO_IO_U_PLAT_NR (FIO_IO_U_PLAT_GROUP_NR * FIO_IO_U_PLAT_VAL) +#define FIO_IO_U_LIST_MAX_LEN 20 /* The size of the default and user-specified + list of percentiles */ + /* * Aggregate clat samples to report percentile(s) of them. * @@ -34,7 +44,7 @@ struct group_run_stats { * * FIO_IO_U_PLAT_GROUP_NR and FIO_IO_U_PLAT_BITS determine the maximum * range being tracked for latency samples. The maximum value tracked - * accurately will be 2^(GROUP_NR + PLAT_BITS -1) microseconds. + * accurately will be 2^(GROUP_NR + PLAT_BITS - 1) nanoseconds. * * FIO_IO_U_PLAT_GROUP_NR and FIO_IO_U_PLAT_BITS determine the memory * requirement of storing those aggregate counts. The memory used will @@ -98,22 +108,15 @@ struct group_run_stats { * 3 8 2 [256,511] 64 * 4 9 3 [512,1023] 64 * ... ... ... [...,...] ... - * 18 23 17 [8838608,+inf]** 64 + * 28 33 27 [8589934592,+inf]** 64 * * * Special cases: when n < (M-1) or when n == (M-1), in both cases, * the value cannot be rounded off. Use all bits of the sample as * index. * - * ** If a sample's MSB is greater than 23, it will be counted as 23. + * ** If a sample's MSB is greater than 33, it will be counted as 33. */ -#define FIO_IO_U_PLAT_BITS 6 -#define FIO_IO_U_PLAT_VAL (1 << FIO_IO_U_PLAT_BITS) -#define FIO_IO_U_PLAT_GROUP_NR 29 -#define FIO_IO_U_PLAT_NR (FIO_IO_U_PLAT_GROUP_NR * FIO_IO_U_PLAT_VAL) -#define FIO_IO_U_LIST_MAX_LEN 20 /* The size of the default and user-specified - list of percentiles */ - /* * Trim cycle count measurements */ @@ -172,7 +175,8 @@ struct thread_stat { /* * IO depth and latency stats */ - uint64_t clat_percentiles; + uint32_t clat_percentiles; + uint32_t lat_percentiles; uint64_t percentile_precision; fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN]; @@ -290,6 +294,7 @@ 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(unsigned int *io_u_plat, unsigned 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(unsigned int *map, unsigned long total, double *io_u_dist); @@ -313,8 +318,9 @@ extern int calc_log_samples(void); extern struct io_log *agg_io_log[DDIR_RWDIR_CNT]; extern int write_bw_log; -static inline bool nsec_to_usec(unsigned long long *min, unsigned long long *max, - double *mean, double *dev) +static inline bool nsec_to_usec(unsigned long long *min, + unsigned long long *max, double *mean, + double *dev) { if (*min > 2000 && *max > 99999 && *dev > 1000.0) { *min /= 1000; @@ -327,8 +333,9 @@ static inline bool nsec_to_usec(unsigned long long *min, unsigned long long *max return false; } -static inline bool nsec_to_msec(unsigned long long *min, unsigned long long *max, - double *mean, double *dev) +static inline bool nsec_to_msec(unsigned long long *min, + unsigned long long *max, double *mean, + double *dev) { if (*min > 2000000 && *max > 99999999ULL && *dev > 1000000.0) { *min /= 1000000; @@ -340,6 +347,7 @@ static inline bool nsec_to_msec(unsigned long long *min, unsigned long long *max return false; } + /* * Worst level condensing would be 1:5, so allow enough room for that */