diff mbox series

[v4,07/45] powerpc/ptdump: Limit size of flags text to 1/2 chars on PPC32

Message ID 83a7a0cfca6198e63caf7a16839bd18454961f52.1589866984.git.christophe.leroy@csgroup.eu
State Rejected
Headers show
Series Use hugepages to map kernel mem on 8xx | expand

Commit Message

Christophe Leroy May 19, 2020, 5:48 a.m. UTC
In order to have all flags fit on a 80 chars wide screen,
reduce the flags to 1 char (2 where ambiguous).

No cache is 'i'
User is 'ur' (Supervisor would be sr)
Shared (for 8xx) becomes 'sh' (it was 'user' when not shared but
that was ambiguous because that's not entirely right)

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/mm/ptdump/8xx.c    | 33 ++++++++++++++++---------------
 arch/powerpc/mm/ptdump/shared.c | 35 +++++++++++++++++----------------
 2 files changed, 35 insertions(+), 33 deletions(-)

Comments

Michael Ellerman May 25, 2020, 5:15 a.m. UTC | #1
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> In order to have all flags fit on a 80 chars wide screen,
> reduce the flags to 1 char (2 where ambiguous).

I don't love this, the output is less readable. Is fitting on an 80 char
screen a real issue for you? I just make my terminal window bigger.

cheers


> No cache is 'i'
> User is 'ur' (Supervisor would be sr)
> Shared (for 8xx) becomes 'sh' (it was 'user' when not shared but
> that was ambiguous because that's not entirely right)
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>  arch/powerpc/mm/ptdump/8xx.c    | 33 ++++++++++++++++---------------
>  arch/powerpc/mm/ptdump/shared.c | 35 +++++++++++++++++----------------
>  2 files changed, 35 insertions(+), 33 deletions(-)
Christophe Leroy May 25, 2020, 11:06 a.m. UTC | #2
Le 25/05/2020 à 07:15, Michael Ellerman a écrit :
> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>> In order to have all flags fit on a 80 chars wide screen,
>> reduce the flags to 1 char (2 where ambiguous).
> 
> I don't love this, the output is less readable. Is fitting on an 80 char
> screen a real issue for you? I just make my terminal window bigger.

I don't have strong opinion about that, and the terminal can be made bigger.
I just don't like how messy it is, some flags are so big that they hide 
other ones and getting it more ordered and more compact helped me during 
all the verifications I did with this series, but we can leave it as is 
if you prefer.

Would you like a v5 without patches 7 and 8 ? Or I can just resend the 
patches that will be impacted, that is 9 and 38 ?

Without the changes I get:

---[ Start of kernel VM ]---
0xc0000000-0xc0ffffff  0x00000000        16M   huge  shared  r    X 
present                  accessed
0xc1000000-0xc7ffffff  0x01000000       112M   huge  shared  rw 
present           dirty  accessed
---[ vmalloc() Area ]---
0xc9000000-0xc9003fff  0x050e4000        16K         shared  rw 
present           dirty  accessed
0xc9008000-0xc900bfff  0x050ec000        16K         shared  rw 
present           dirty  accessed
0xc9010000-0xc9013fff  0xd0000000        16K         shared  rw 
present  guarded  dirty  accessed  no cache
0xc9018000-0xc901bfff  0x050f0000        16K         shared  rw 
present           dirty  accessed

---[ Fixmap start ]---
0xf7f00000-0xf7f7ffff  0xff000000       512K   huge  shared  rw 
present  guarded  dirty  accessed  no cache
---[ Fixmap end ]---
---[ kasan shadow mem start ]---
0xf8000000-0xf8ffffff  0x07000000        16M   huge  shared  rw 
present           dirty  accessed
0xf9000000-0xf91fffff [0x01288000]       16K         shared  r 
present                  accessed
0xf9200000-0xf9203fff  0x050e0000        16K         shared  rw 
present           dirty  accessed


With the change I get.

---[ Start of kernel VM ]---
0xc0000000-0xc0ffffff  0x00000000        16M   h  r   x  p        sh 
    a
0xc1000000-0xc7ffffff  0x01000000       112M   h  rw     p        sh 
d  a
---[ vmalloc() Area ]---
0xc9000000-0xc9003fff  0x050e4000        16K      rw     p        sh 
d  a
0xc9008000-0xc900bfff  0x050ec000        16K      rw     p        sh 
d  a
0xc9010000-0xc9013fff  0xd0000000        16K      rw     p  i  g  sh 
d  a
0xc9018000-0xc901bfff  0x050f0000        16K      rw     p        sh 
d  a

---[ Fixmap start ]---
0xf7f00000-0xf7f7ffff  0xff000000       512K   h  rw     p  i  g  sh 
d  a
---[ Fixmap end ]---
---[ kasan shadow mem start ]---
0xf8000000-0xf8ffffff  0x07000000        16M   h  rw     p        sh 
d  a
0xf9000000-0xf91fffff [0x01288000]       16K      r      p        sh 
    a
0xf9200000-0xf9203fff  0x050e0000        16K      rw     p        sh 
d  a


Christophe

> 
> cheers
> 
> 
>> No cache is 'i'
>> User is 'ur' (Supervisor would be sr)
>> Shared (for 8xx) becomes 'sh' (it was 'user' when not shared but
>> that was ambiguous because that's not entirely right)
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>>   arch/powerpc/mm/ptdump/8xx.c    | 33 ++++++++++++++++---------------
>>   arch/powerpc/mm/ptdump/shared.c | 35 +++++++++++++++++----------------
>>   2 files changed, 35 insertions(+), 33 deletions(-)
Michael Ellerman May 26, 2020, 12:53 p.m. UTC | #3
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Le 25/05/2020 à 07:15, Michael Ellerman a écrit :
>> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>>> In order to have all flags fit on a 80 chars wide screen,
>>> reduce the flags to 1 char (2 where ambiguous).
>> 
>> I don't love this, the output is less readable. Is fitting on an 80 char
>> screen a real issue for you? I just make my terminal window bigger.
>
> I don't have strong opinion about that, and the terminal can be made bigger.
> I just don't like how messy it is, some flags are so big that they hide 
> other ones and getting it more ordered and more compact helped me during 
> all the verifications I did with this series, but we can leave it as is 
> if you prefer.

I think I do.

> Would you like a v5 without patches 7 and 8 ? Or I can just resend the 
> patches that will be impacted, that is 9 and 38 ?

I dropped 7 and 8 and then fixed up 9 and 38, it was easy enough.

I used "coherent" and "huge".

> With the change I get.
>
> ---[ Start of kernel VM ]---
> 0xc0000000-0xc0ffffff  0x00000000        16M   h  r   x  p        sh     a
> 0xc1000000-0xc7ffffff  0x01000000       112M   h  rw     p        sh  d  a
> ---[ vmalloc() Area ]---
> 0xc9000000-0xc9003fff  0x050e4000        16K      rw     p        sh  d  a
> 0xc9008000-0xc900bfff  0x050ec000        16K      rw     p        sh  d  a
> 0xc9010000-0xc9013fff  0xd0000000        16K      rw     p  i  g  sh  d  a
> 0xc9018000-0xc901bfff  0x050f0000        16K      rw     p        sh  d  a

It's definitely more compact :)

But I worry no one other than you will be able to decipher it, without
constantly referring back to the source code.

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/mm/ptdump/8xx.c b/arch/powerpc/mm/ptdump/8xx.c
index 9e2d8e847d6e..ca9ce94672f5 100644
--- a/arch/powerpc/mm/ptdump/8xx.c
+++ b/arch/powerpc/mm/ptdump/8xx.c
@@ -12,9 +12,9 @@ 
 static const struct flag_info flag_array[] = {
 	{
 		.mask	= _PAGE_SH,
-		.val	= 0,
-		.set	= "user",
-		.clear	= "    ",
+		.val	= _PAGE_SH,
+		.set	= "sh",
+		.clear	= "  ",
 	}, {
 		.mask	= _PAGE_RO | _PAGE_NA,
 		.val	= 0,
@@ -30,37 +30,38 @@  static const struct flag_info flag_array[] = {
 	}, {
 		.mask	= _PAGE_EXEC,
 		.val	= _PAGE_EXEC,
-		.set	= " X ",
-		.clear	= "   ",
+		.set	= "x",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_PRESENT,
 		.val	= _PAGE_PRESENT,
-		.set	= "present",
-		.clear	= "       ",
+		.set	= "p",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_GUARDED,
 		.val	= _PAGE_GUARDED,
-		.set	= "guarded",
-		.clear	= "       ",
+		.set	= "g",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_DIRTY,
 		.val	= _PAGE_DIRTY,
-		.set	= "dirty",
-		.clear	= "     ",
+		.set	= "d",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_ACCESSED,
 		.val	= _PAGE_ACCESSED,
-		.set	= "accessed",
-		.clear	= "        ",
+		.set	= "a",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_NO_CACHE,
 		.val	= _PAGE_NO_CACHE,
-		.set	= "no cache",
-		.clear	= "        ",
+		.set	= "i",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_SPECIAL,
 		.val	= _PAGE_SPECIAL,
-		.set	= "special",
+		.set	= "s",
+		.clear	= " ",
 	}
 };
 
diff --git a/arch/powerpc/mm/ptdump/shared.c b/arch/powerpc/mm/ptdump/shared.c
index f7ed2f187cb0..44a8a64a664f 100644
--- a/arch/powerpc/mm/ptdump/shared.c
+++ b/arch/powerpc/mm/ptdump/shared.c
@@ -13,8 +13,8 @@  static const struct flag_info flag_array[] = {
 	{
 		.mask	= _PAGE_USER,
 		.val	= _PAGE_USER,
-		.set	= "user",
-		.clear	= "    ",
+		.set	= "ur",
+		.clear	= "  ",
 	}, {
 		.mask	= _PAGE_RW,
 		.val	= _PAGE_RW,
@@ -23,42 +23,43 @@  static const struct flag_info flag_array[] = {
 	}, {
 		.mask	= _PAGE_EXEC,
 		.val	= _PAGE_EXEC,
-		.set	= " X ",
-		.clear	= "   ",
+		.set	= "x",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_PRESENT,
 		.val	= _PAGE_PRESENT,
-		.set	= "present",
-		.clear	= "       ",
+		.set	= "p",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_GUARDED,
 		.val	= _PAGE_GUARDED,
-		.set	= "guarded",
-		.clear	= "       ",
+		.set	= "g",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_DIRTY,
 		.val	= _PAGE_DIRTY,
-		.set	= "dirty",
-		.clear	= "     ",
+		.set	= "d",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_ACCESSED,
 		.val	= _PAGE_ACCESSED,
-		.set	= "accessed",
-		.clear	= "        ",
+		.set	= "a",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_WRITETHRU,
 		.val	= _PAGE_WRITETHRU,
-		.set	= "write through",
-		.clear	= "             ",
+		.set	= "w",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_NO_CACHE,
 		.val	= _PAGE_NO_CACHE,
-		.set	= "no cache",
-		.clear	= "        ",
+		.set	= "i",
+		.clear	= " ",
 	}, {
 		.mask	= _PAGE_SPECIAL,
 		.val	= _PAGE_SPECIAL,
-		.set	= "special",
+		.set	= "s",
+		.clear	= " ",
 	}
 };