From 9b17135694e7345ea861a51aa8537c87e51afab3 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Tue, 12 Nov 2019 17:16:29 +0100 Subject: [PATCH] casadm: Unify "4KiB Blocks" string Signed-off-by: Robert Baldyga --- casadm/statistics_model.c | 6 +++--- casadm/statistics_view_csv.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/casadm/statistics_model.c b/casadm/statistics_model.c index ac208ca..cd78f9b 100644 --- a/casadm/statistics_model.c +++ b/casadm/statistics_model.c @@ -37,7 +37,7 @@ #define IOCLASS_UNCLASSIFIED (0) #define UNIT_REQUESTS "Requests" -#define UNIT_BLOCKS "4KiB blocks" +#define UNIT_BLOCKS "4KiB Blocks" static inline float fraction(uint64_t numerator, uint64_t denominator) { @@ -197,7 +197,7 @@ static void print_core_conf(const struct kcas_core_info *info, FILE *outfile) info->core_path_name); print_kv_pair(outfile, "Exported Object", "/dev/cas%d-%d", info->cache_id, info->core_id); - print_kv_pair(outfile, "Core Size", "%lu, [4KiB Blocks], %.2f, [GiB]", + print_kv_pair(outfile, "Core Size", "%lu, [" UNIT_BLOCKS "], %.2f, [GiB]", core_size, core_size_gb); print_kv_pair_time(outfile, "Dirty for", info->info.dirty_for); @@ -532,7 +532,7 @@ int cache_stats_conf(int ctrl_fd, const struct kcas_cache_info *cache_info, cache_size = cache_line_in_4k(cache_info->info.size, cache_info->info.cache_line_size / KiB); - print_kv_pair(outfile, "Cache Size", "%lu, [4KiB Blocks], %.2f, [GiB]", + print_kv_pair(outfile, "Cache Size", "%lu, [" UNIT_BLOCKS "], %.2f, [GiB]", cache_size, (float) cache_size * (4 * KiB) / GiB); diff --git a/casadm/statistics_view_csv.c b/casadm/statistics_view_csv.c index 35d3ab8..783b714 100644 --- a/casadm/statistics_view_csv.c +++ b/casadm/statistics_view_csv.c @@ -229,10 +229,10 @@ int csv_process_row(struct view_t *this, int type, int num_fields, char *fields[ * with units, so output every second value, * and use units to construct column headers. * For example: - * KV_PAIR,Cache Size,10347970,[4KiB blocks],39.47,[GiB] + * KV_PAIR,Cache Size,10347970,[4KiB Blocks],39.47,[GiB] * will result in: * data row: 10347970,39.47 - * header row: Cache Size [4KiB blocks],Cache Size [GiB] + * header row: Cache Size [4KiB Blocks],Cache Size [GiB] */ case KV_PAIR: for (i = 1; i < num_fields; i += 2) {