Browse Source

Fix iostats in generic demo

pull/6/head
gkostka 9 years ago
parent
commit
b43526da4f
  1. 5
      blockdev/test_lwext4.c
  2. 3
      demos/generic/generic.c

5
blockdev/test_lwext4.c

@ -77,6 +77,9 @@ static clock_t get_ms(void) { return tim_get_ms(); }
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 @@ bool test_lwext4_dir_test(int len)
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;
}

3
demos/generic/generic.c

@ -109,8 +109,7 @@ void io_timings_clear(void)
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)

Loading…
Cancel
Save