From 584ef991437a3845d088b1c1594f406e4fa441bc Mon Sep 17 00:00:00 2001 From: Slawomir Jankowski Date: Mon, 8 Feb 2021 10:57:19 +0100 Subject: [PATCH] Change time parameter type in printing Type of `dirty_for` in structs needs to be unified. Values stored in these fields (both in cache and core info structs) are unsigned 64-bits ints but `dirty_for`s were unsigned 32-bits ints (vide changes in OCF). Signed-off-by: Slawomir Jankowski --- casadm/statistics_model.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/casadm/statistics_model.c b/casadm/statistics_model.c index 8061fac..fe35d85 100644 --- a/casadm/statistics_model.c +++ b/casadm/statistics_model.c @@ -70,11 +70,11 @@ static float calc_gb(uint32_t clines) return (float) clines * 4 * KiB / GiB; } -static void print_dirty_for_time(uint32_t t, FILE *outfile) +static void print_dirty_for_time(uint64_t t, FILE *outfile) { uint32_t d, h, m, s; - fprintf(outfile, "%u,[s],", t); + fprintf(outfile, "%lu,[s],", t); if (!t) { fprintf(outfile, "Cache clean"); @@ -112,7 +112,7 @@ static void print_kv_pair(FILE *outfile, const char *title, const char *fmt, ... fprintf(outfile, "\n"); } -static void print_kv_pair_time(FILE *outfile, const char *title, uint32_t time) +static void print_kv_pair_time(FILE *outfile, const char *title, uint64_t time) { fprintf(outfile, TAG(KV_PAIR) "\"%s\",", title); print_dirty_for_time(time, outfile);