filter: filter xfs_io's output in units of page size
authorChandan Rajendra <chandan@linux.vnet.ibm.com>
Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)
The helpers introduced in this commit will be used to make btrfs tests that
assume 4k as the page size to work on non-4k page-sized systems as well.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/filter
common/rc

index 05f2fab3c1c17490847ad80d78e528929f8eea69..1be377c06392ac3941b59ddbdf0c2f673f3e4bd3 100644 (file)
@@ -261,6 +261,14 @@ _filter_xfs_io_blocks_modified()
        _filter_xfs_io_units_modified "Block" $BLOCK_SIZE
 }
 
+_filter_xfs_io_pages_modified()
+{
+       PAGE_SIZE=$(get_page_size)
+
+       _filter_xfs_io_units_modified "Page" $PAGE_SIZE
+}
+
+
 _filter_test_dir()
 {
        sed -e "s,$TEST_DEV,TEST_DEV,g" -e "s,$TEST_DIR,TEST_DIR,g"
index c825229ab0508f96fee4d6d6f5545be864e3e2cf..4164d9e13275df429e1fbd131d2273904de5fe31 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -3212,6 +3212,12 @@ get_block_size()
        echo `stat -f -c %S $1`
 }
 
+get_page_size()
+{
+       echo $(getconf PAGE_SIZE)
+}
+
+
 init_rc
 
 ################################################################################