[PATCH 6/7] xen/arm: Tweak the dump page-table walk output

Julien Grall posted 7 patches 3 years, 6 months ago
[PATCH 6/7] xen/arm: Tweak the dump page-table walk output
Posted by Julien Grall 3 years, 6 months ago
From: Julien Grall <jgrall@amazon.com>

Currently the output is looking like:

(XEN) 1ST[0x1] = 0x000000004015ff7f
(XEN) 2ND[0x1f] = 0x00500000bfe00f7d

The content of the entries are not aligned making a bit trickier to
read (I appreciate this is a matter of taste).

Align the values by forcing the index to be always printed using
3 characters (enough to cover 512 in hexadecimal).

New output:

(XEN) 1ST[0x001] = 0x000000004015ff7f
(XEN) 2ND[0x01f] = 0x00500000bfe00f7d

Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index b42cddb1b446..c81c706c8b23 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -234,7 +234,7 @@ void dump_pt_walk(paddr_t ttbr, paddr_t addr,
 
         pte = mapping[offsets[level]];
 
-        printk("%s[0x%x] = 0x%"PRIpaddr"\n",
+        printk("%s[0x%03x] = 0x%"PRIpaddr"\n",
                level_strs[level], offsets[level], pte.bits);
 
         if ( level == 3 || !pte.walk.valid || !pte.walk.table )
-- 
2.37.1
Re: [PATCH 6/7] xen/arm: Tweak the dump page-table walk output
Posted by Bertrand Marquis 3 years, 5 months ago
Hi Julien,

> On 12 Aug 2022, at 20:24, Julien Grall <julien@xen.org> wrote:
> 
> From: Julien Grall <jgrall@amazon.com>
> 
> Currently the output is looking like:
> 
> (XEN) 1ST[0x1] = 0x000000004015ff7f
> (XEN) 2ND[0x1f] = 0x00500000bfe00f7d
> 
> The content of the entries are not aligned making a bit trickier to
> read (I appreciate this is a matter of taste).
> 
> Align the values by forcing the index to be always printed using
> 3 characters (enough to cover 512 in hexadecimal).
> 
> New output:
> 
> (XEN) 1ST[0x001] = 0x000000004015ff7f
> (XEN) 2ND[0x01f] = 0x00500000bfe00f7d
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/mm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index b42cddb1b446..c81c706c8b23 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -234,7 +234,7 @@ void dump_pt_walk(paddr_t ttbr, paddr_t addr,
> 
>         pte = mapping[offsets[level]];
> 
> -        printk("%s[0x%x] = 0x%"PRIpaddr"\n",
> +        printk("%s[0x%03x] = 0x%"PRIpaddr"\n",
>                level_strs[level], offsets[level], pte.bits);
> 
>         if ( level == 3 || !pte.walk.valid || !pte.walk.table )
> -- 
> 2.37.1
> 
RE: [PATCH 6/7] xen/arm: Tweak the dump page-table walk output
Posted by Henry Wang 3 years, 5 months ago
Hi Julien,

> -----Original Message-----
> Subject: [PATCH 6/7] xen/arm: Tweak the dump page-table walk output
> 
> From: Julien Grall <jgrall@amazon.com>
> 
> Currently the output is looking like:
> 
> (XEN) 1ST[0x1] = 0x000000004015ff7f
> (XEN) 2ND[0x1f] = 0x00500000bfe00f7d
> 
> The content of the entries are not aligned making a bit trickier to
> read (I appreciate this is a matter of taste).
> 
> Align the values by forcing the index to be always printed using
> 3 characters (enough to cover 512 in hexadecimal).
> 
> New output:
> 
> (XEN) 1ST[0x001] = 0x000000004015ff7f
> (XEN) 2ND[0x01f] = 0x00500000bfe00f7d
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Henry Wang <Henry.Wang@arm.com>

Kind regards,
Henry