ref: b43526da4f49142491954695917b090e0802b672
parent: 5a045db8d5f5f89a707a667c134919fe7f0608ff
author: gkostka <kostka.grzegorz@gmail.com>
date: Mon Sep 21 19:08:02 EDT 2015
Fix iostats in generic demo
--- a/blockdev/test_lwext4.c
+++ b/blockdev/test_lwext4.c
@@ -77,6 +77,9 @@
static void printf_io_timings(clock_t diff)
{
const struct ext4_io_stats *stats = io_timings_get(diff);
+ if (!stats)
+ return;
+
printf("io_timings:\n");
printf(" io_read: %.3f%%\n", stats->io_read);
printf(" io_write: %.3f%%\n", stats->io_write);
@@ -201,7 +204,7 @@
diff = stop - start;
test_lwext4_dir_ls("/mp/dir1");
printf("test_lwext4_dir_test: time: %d ms\n", (int)diff);
- printf("test_lwext4_dir_test: av: %d ms/entry\n", (int)diff / len);
+ printf("test_lwext4_dir_test: av: %d ms/entry\n", (int)diff / (len + 1));
printf_io_timings(diff);
return true;
}
--- a/demos/generic/generic.c
+++ b/demos/generic/generic.c
@@ -109,8 +109,7 @@
const struct ext4_io_stats *io_timings_get(uint32_t time_sum_ms)
{
- static struct ext4_io_stats s;
- return &s;
+ return NULL;
}
uint32_t tim_get_ms(void)