diff mbox

[1/8] Filter xfs_io's output in units of page size

Message ID 1448878644-16503-2-git-send-email-chandan@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chandan Rajendra Nov. 30, 2015, 10:17 a.m. UTC
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>
---
 common/filter | 8 ++++++++
 common/rc     | 6 ++++++
 2 files changed, 14 insertions(+)

Comments

Filipe Manana Dec. 10, 2015, 5:26 p.m. UTC | #1
On Mon, Nov 30, 2015 at 10:17 AM, Chandan Rajendra
<chandan@linux.vnet.ibm.com> wrote:
> 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>

Thanks!

> ---
>  common/filter | 8 ++++++++
>  common/rc     | 6 ++++++
>  2 files changed, 14 insertions(+)
>
> diff --git a/common/filter b/common/filter
> index 05f2fab..1be377c 100644
> --- a/common/filter
> +++ b/common/filter
> @@ -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"
> diff --git a/common/rc b/common/rc
> index 4c2f42c..82c1bbb 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3151,6 +3151,12 @@ get_block_size()
>         echo `stat -f -c %S $1`
>  }
>
> +get_page_size()
> +{
> +       echo $(getconf PAGE_SIZE)
> +}
> +
> +
>  init_rc
>
>  ################################################################################
> --
> 2.1.0
>
diff mbox

Patch

diff --git a/common/filter b/common/filter
index 05f2fab..1be377c 100644
--- a/common/filter
+++ b/common/filter
@@ -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"
diff --git a/common/rc b/common/rc
index 4c2f42c..82c1bbb 100644
--- a/common/rc
+++ b/common/rc
@@ -3151,6 +3151,12 @@  get_block_size()
 	echo `stat -f -c %S $1`
 }
 
+get_page_size()
+{
+	echo $(getconf PAGE_SIZE)
+}
+
+
 init_rc
 
 ################################################################################