fio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] stat: change json+ output format so that instead of printing the raw clat data structure, use actual durations instead of array indices and print only bins with nonzero counts
@ 2017-04-16 19:04 Vincent Fu
  2017-04-16 19:04 ` [PATCH 2/6] Revert "tools/fio_latency2csv.py: add tool that converts json+ to CSV" Vincent Fu
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Vincent Fu @ 2017-04-16 19:04 UTC (permalink / raw)
  To: axboe, fio; +Cc: Vincent Fu

From: Vincent Fu <Vincent.Fu@sandisk.com>

---
 stat.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/stat.c b/stat.c
index fde7af2..4a6e1b9 100644
--- a/stat.c
+++ b/stat.c
@@ -98,7 +98,7 @@ static unsigned int plat_val_to_idx(unsigned int val)
  * Convert the given index of the bucket array to the value
  * represented by the bucket
  */
-static unsigned int plat_idx_to_val(unsigned int idx)
+static unsigned long long plat_idx_to_val(unsigned int idx)
 {
 	unsigned int error_bits, k, base;
 
@@ -972,12 +972,11 @@ static void add_ddir_status_json(struct thread_stat *ts,
 		clat_bins_object = json_create_object();
 		json_object_add_value_object(tmp_object, "bins", clat_bins_object);
 		for(i = 0; i < FIO_IO_U_PLAT_NR; i++) {
-			snprintf(buf, sizeof(buf), "%d", i);
-			json_object_add_value_int(clat_bins_object, (const char *)buf, ts->io_u_plat[ddir][i]);
+			if (ts->io_u_plat[ddir][i]) {
+				snprintf(buf, sizeof(buf), "%llu", plat_idx_to_val(i));
+				json_object_add_value_int(clat_bins_object, (const char *)buf, ts->io_u_plat[ddir][i]);
+			}
 		}
-		json_object_add_value_int(clat_bins_object, "FIO_IO_U_PLAT_BITS", FIO_IO_U_PLAT_BITS);
-		json_object_add_value_int(clat_bins_object, "FIO_IO_U_PLAT_VAL", FIO_IO_U_PLAT_VAL);
-		json_object_add_value_int(clat_bins_object, "FIO_IO_U_PLAT_NR", FIO_IO_U_PLAT_NR);
 	}
 
 	if (!calc_lat(&ts->lat_stat[ddir], &min, &max, &mean, &dev)) {
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-05-03 14:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-16 19:04 [PATCH 1/6] stat: change json+ output format so that instead of printing the raw clat data structure, use actual durations instead of array indices and print only bins with nonzero counts Vincent Fu
2017-04-16 19:04 ` [PATCH 2/6] Revert "tools/fio_latency2csv.py: add tool that converts json+ to CSV" Vincent Fu
2017-04-16 19:04 ` [PATCH 3/6] server: update server version for the addition of the --stats option Vincent Fu
2017-04-16 19:04 ` [PATCH 4/6] stat: reset_io_stats: fix a problem, rearrange some code Vincent Fu
2017-04-16 19:04 ` [PATCH 5/6] client/server: make sure that all elements in io_u_lat_m[] are transferred and received Vincent Fu
2017-04-16 19:04 ` [PATCH 6/6] gettime: make utime_since_now and mtime_since_now consistent in how they record the caller and put this all behind FIO_DEBUG_TIME Vincent Fu
2017-05-03 14:47 ` [PATCH 1/6] stat: change json+ output format so that instead of printing the raw clat data structure, use actual durations instead of array indices and print only bins with nonzero counts Vincent Fu
2017-05-03 14:50   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).