Changeset 08a807b0 in rtems


Ignore:
Timestamp:
Nov 2, 2015, 7:20:11 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
2502e26d
Parents:
09d4f62
git-author:
Sebastian Huber <sebastian.huber@…> (11/02/15 07:20:11)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/02/15 07:21:49)
Message:

libblock: Print block sizes and count

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/include/rtems/blkdev.h

    r09d4f62 r08a807b0  
    346346void rtems_blkdev_print_stats(
    347347  const rtems_blkdev_stats *stats,
     348  uint32_t media_block_size,
     349  uint32_t media_block_count,
     350  uint32_t block_size,
    348351  rtems_printk_plugin_t print,
    349352  void *print_arg
  • cpukit/libblock/src/blkdev-blkstats.c

    r09d4f62 r08a807b0  
    4949          }
    5050        } else {
     51          uint32_t media_block_size = 0;
     52          uint32_t media_block_count = 0;
     53          uint32_t block_size = 0;
    5154          rtems_blkdev_stats stats;
     55
     56          rtems_disk_fd_get_media_block_size(fd, &media_block_size);
     57          rtems_disk_fd_get_block_count(fd, &media_block_count);
     58          rtems_disk_fd_get_block_size(fd, &block_size);
    5259
    5360          rv = rtems_disk_fd_get_device_stats(fd, &stats);
     
    5562            rtems_blkdev_print_stats(
    5663              &stats,
     64              media_block_size,
     65              media_block_count,
     66              block_size,
    5767              (rtems_printk_plugin_t) fprintf,
    5868              output
  • cpukit/libblock/src/blkdev-print-stats.c

    r09d4f62 r08a807b0  
    3030void rtems_blkdev_print_stats(
    3131  const rtems_blkdev_stats *stats,
     32  uint32_t media_block_size,
     33  uint32_t media_block_count,
     34  uint32_t block_size,
    3235  rtems_printk_plugin_t print,
    3336  void *print_arg
     
    3942     "                               DEVICE STATISTICS\n"
    4043     "----------------------+--------------------------------------------------------\n"
     44     " MEDIA BLOCK SIZE     | %" PRIu32 "\n"
     45     " MEDIA BLOCK COUNT    | %" PRIu32 "\n"
     46     " BLOCK SIZE           | %" PRIu32 "\n"
    4147     " READ HITS            | %" PRIu32 "\n"
    4248     " READ MISSES          | %" PRIu32 "\n"
     
    4854     " WRITE ERRORS         | %" PRIu32 "\n"
    4955     "----------------------+--------------------------------------------------------\n",
     56     media_block_size,
     57     media_block_count,
     58     block_size,
    5059     stats->read_hits,
    5160     stats->read_misses,
  • testsuites/libtests/block14/block14.scn

    r09d4f62 r08a807b0  
    1 *** TEST BLOCK 14 ***
     1*** BEGIN OF TEST BLOCK 14 ***
    22action 0
    33action 1
     
    1010                               DEVICE STATISTICS
    1111----------------------+--------------------------------------------------------
     12 MEDIA BLOCK SIZE     | 0
     13 MEDIA BLOCK COUNT    | 1
     14 BLOCK SIZE           | 2
    1215 READ HITS            | 2
    1316 READ MISSES          | 3
  • testsuites/libtests/block14/init.c

    r09d4f62 r08a807b0  
    156156  }
    157157
    158   rtems_blkdev_print_stats(&dd->stats, rtems_printf_plugin, NULL);
     158  rtems_blkdev_print_stats(&dd->stats, 0, 1, 2, rtems_printf_plugin, NULL);
    159159}
    160160
Note: See TracChangeset for help on using the changeset viewer.