stat: rename add_lat_percentile_sample()
authorNiklas Cassel <niklas.cassel@wdc.com>
Thu, 25 Nov 2021 13:20:31 +0000 (13:20 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 25 Nov 2021 16:03:10 +0000 (09:03 -0700)
The name for add_lat_percentile_sample() is confusing, since the function
actually adds a per priority percentile sample (it also adds a regular
sample), yet it doesn't have prio as part of the function name.

Rename the function so that it is more obvious that this function should
be used if you want to add a prio percentile sample.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20211125132020.109955-4-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
stat.c

diff --git a/stat.c b/stat.c
index 8bb49e4be9181918870752bdd40eb5591b21e63e..1e0da99dd43f594bdc38d4b90c9e63787183a073 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -3061,9 +3061,10 @@ static void add_lat_percentile_sample_noprio(struct thread_stat *ts,
        ts->io_u_plat[lat][ddir][idx]++;
 }
 
-static void add_lat_percentile_sample(struct thread_stat *ts,
-                               unsigned long long nsec, enum fio_ddir ddir,
-                               bool high_prio, enum fio_lat lat)
+static void add_lat_percentile_prio_sample(struct thread_stat *ts,
+                                          unsigned long long nsec,
+                                          enum fio_ddir ddir,
+                                          bool high_prio, enum fio_lat lat)
 {
        unsigned int idx = plat_val_to_idx(nsec);
 
@@ -3118,7 +3119,8 @@ void add_clat_sample(struct thread_data *td, enum fio_ddir ddir,
                if (ts->lat_percentiles)
                        add_lat_percentile_sample_noprio(ts, nsec, ddir, FIO_CLAT);
                else
-                       add_lat_percentile_sample(ts, nsec, ddir, high_prio, FIO_CLAT);
+                       add_lat_percentile_prio_sample(ts, nsec, ddir, high_prio,
+                                                      FIO_CLAT);
        }
 
        if (iolog && iolog->hist_msec) {
@@ -3219,7 +3221,8 @@ void add_lat_sample(struct thread_data *td, enum fio_ddir ddir,
         * lat_percentiles=0.
         */
        if (ts->lat_percentiles) {
-               add_lat_percentile_sample(ts, nsec, ddir, high_prio, FIO_LAT);
+               add_lat_percentile_prio_sample(ts, nsec, ddir, high_prio,
+                                              FIO_LAT);
                if (high_prio)
                        add_stat_sample(&ts->clat_high_prio_stat[ddir], nsec);
                else