* [PATCH v2] x86: use pr_cont() in dump_pagetable()
@ 2017-08-31 7:30 Jan Beulich
2017-08-31 9:55 ` [tip:x86/mm] x86/mm: Use " tip-bot for Jan Beulich
2017-08-31 18:51 ` [PATCH v2] x86: use " Joe Perches
0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2017-08-31 7:30 UTC (permalink / raw)
To: mingo, tglx, hpa; +Cc: linux-kernel
The lack of newlines in preceding format strings is a clear indication
that these were meant to be continuations of one another, and indeed
output ends up quite a bit more compact (and readable) that way.
Switch other plain printk()-s in the function instances to pr_info(),
as requested.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
arch/x86/mm/fault.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
---
v2: Use pr_cont() instead of printk(KERN_CONT ...) and switch others
to pr_info().
--- 4.13-rc7/arch/x86/mm/fault.c
+++ 4.13-rc7-x86-dumppgt-cont/arch/x86/mm/fault.c
@@ -396,14 +396,18 @@ static void dump_pagetable(unsigned long
pte_t *pte;
#ifdef CONFIG_X86_PAE
- printk("*pdpt = %016Lx ", pgd_val(*pgd));
+ pr_info("*pdpt = %016Lx ", pgd_val(*pgd));
if (!low_pfn(pgd_val(*pgd) >> PAGE_SHIFT) || !pgd_present(*pgd))
goto out;
+#define pr_pde pr_cont
+#else
+#define pr_pde pr_info
#endif
p4d = p4d_offset(pgd, address);
pud = pud_offset(p4d, address);
pmd = pmd_offset(pud, address);
- printk(KERN_CONT "*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)pmd_val(*pmd));
+ pr_pde("*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)pmd_val(*pmd));
+#undef pr_pde
/*
* We must not directly access the pte in the highpte
@@ -415,9 +419,9 @@ static void dump_pagetable(unsigned long
goto out;
pte = pte_offset_kernel(pmd, address);
- printk("*pte = %0*Lx ", sizeof(*pte) * 2, (u64)pte_val(*pte));
+ pr_cont("*pte = %0*Lx ", sizeof(*pte) * 2, (u64)pte_val(*pte));
out:
- printk("\n");
+ pr_cont("\n");
}
#else /* CONFIG_X86_64: */
@@ -565,7 +569,7 @@ static void dump_pagetable(unsigned long
if (bad_address(pgd))
goto bad;
- printk("PGD %lx ", pgd_val(*pgd));
+ pr_info("PGD %lx ", pgd_val(*pgd));
if (!pgd_present(*pgd))
goto out;
@@ -574,7 +578,7 @@ static void dump_pagetable(unsigned long
if (bad_address(p4d))
goto bad;
- printk("P4D %lx ", p4d_val(*p4d));
+ pr_cont("P4D %lx ", p4d_val(*p4d));
if (!p4d_present(*p4d) || p4d_large(*p4d))
goto out;
@@ -582,7 +586,7 @@ static void dump_pagetable(unsigned long
if (bad_address(pud))
goto bad;
- printk("PUD %lx ", pud_val(*pud));
+ pr_cont("PUD %lx ", pud_val(*pud));
if (!pud_present(*pud) || pud_large(*pud))
goto out;
@@ -590,7 +594,7 @@ static void dump_pagetable(unsigned long
if (bad_address(pmd))
goto bad;
- printk("PMD %lx ", pmd_val(*pmd));
+ pr_cont("PMD %lx ", pmd_val(*pmd));
if (!pmd_present(*pmd) || pmd_large(*pmd))
goto out;
@@ -598,12 +602,12 @@ static void dump_pagetable(unsigned long
if (bad_address(pte))
goto bad;
- printk("PTE %lx", pte_val(*pte));
+ pr_cont("PTE %lx", pte_val(*pte));
out:
- printk("\n");
+ pr_cont("\n");
return;
bad:
- printk("BAD\n");
+ pr_info("BAD\n");
}
#endif /* CONFIG_X86_64 */
^ permalink raw reply [flat|nested] 3+ messages in thread* [tip:x86/mm] x86/mm: Use pr_cont() in dump_pagetable()
2017-08-31 7:30 [PATCH v2] x86: use pr_cont() in dump_pagetable() Jan Beulich
@ 2017-08-31 9:55 ` tip-bot for Jan Beulich
2017-08-31 18:51 ` [PATCH v2] x86: use " Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Jan Beulich @ 2017-08-31 9:55 UTC (permalink / raw)
To: linux-tip-commits
Cc: torvalds, mingo, tglx, hpa, jbeulich, JBeulich, linux-kernel,
peterz
Commit-ID: 39e48d9b128abbd2ea9b8403bb1e2693323db2f4
Gitweb: http://git.kernel.org/tip/39e48d9b128abbd2ea9b8403bb1e2693323db2f4
Author: Jan Beulich <JBeulich@suse.com>
AuthorDate: Thu, 31 Aug 2017 01:30:19 -0600
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 31 Aug 2017 11:01:58 +0200
x86/mm: Use pr_cont() in dump_pagetable()
The lack of newlines in preceding format strings is a clear indication
that these were meant to be continuations of one another, and indeed
output ends up quite a bit more compact (and readable) that way.
Switch other plain printk()-s in the function instances to pr_info(),
as requested.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/59A7D72B0200007800175E4E@prv-mh.provo.novell.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/mm/fault.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 2a1fa10c..0cdf14c 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -396,14 +396,18 @@ static void dump_pagetable(unsigned long address)
pte_t *pte;
#ifdef CONFIG_X86_PAE
- printk("*pdpt = %016Lx ", pgd_val(*pgd));
+ pr_info("*pdpt = %016Lx ", pgd_val(*pgd));
if (!low_pfn(pgd_val(*pgd) >> PAGE_SHIFT) || !pgd_present(*pgd))
goto out;
+#define pr_pde pr_cont
+#else
+#define pr_pde pr_info
#endif
p4d = p4d_offset(pgd, address);
pud = pud_offset(p4d, address);
pmd = pmd_offset(pud, address);
- printk(KERN_CONT "*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)pmd_val(*pmd));
+ pr_pde("*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)pmd_val(*pmd));
+#undef pr_pde
/*
* We must not directly access the pte in the highpte
@@ -415,9 +419,9 @@ static void dump_pagetable(unsigned long address)
goto out;
pte = pte_offset_kernel(pmd, address);
- printk("*pte = %0*Lx ", sizeof(*pte) * 2, (u64)pte_val(*pte));
+ pr_cont("*pte = %0*Lx ", sizeof(*pte) * 2, (u64)pte_val(*pte));
out:
- printk("\n");
+ pr_cont("\n");
}
#else /* CONFIG_X86_64: */
@@ -565,7 +569,7 @@ static void dump_pagetable(unsigned long address)
if (bad_address(pgd))
goto bad;
- printk("PGD %lx ", pgd_val(*pgd));
+ pr_info("PGD %lx ", pgd_val(*pgd));
if (!pgd_present(*pgd))
goto out;
@@ -574,7 +578,7 @@ static void dump_pagetable(unsigned long address)
if (bad_address(p4d))
goto bad;
- printk("P4D %lx ", p4d_val(*p4d));
+ pr_cont("P4D %lx ", p4d_val(*p4d));
if (!p4d_present(*p4d) || p4d_large(*p4d))
goto out;
@@ -582,7 +586,7 @@ static void dump_pagetable(unsigned long address)
if (bad_address(pud))
goto bad;
- printk("PUD %lx ", pud_val(*pud));
+ pr_cont("PUD %lx ", pud_val(*pud));
if (!pud_present(*pud) || pud_large(*pud))
goto out;
@@ -590,7 +594,7 @@ static void dump_pagetable(unsigned long address)
if (bad_address(pmd))
goto bad;
- printk("PMD %lx ", pmd_val(*pmd));
+ pr_cont("PMD %lx ", pmd_val(*pmd));
if (!pmd_present(*pmd) || pmd_large(*pmd))
goto out;
@@ -598,12 +602,12 @@ static void dump_pagetable(unsigned long address)
if (bad_address(pte))
goto bad;
- printk("PTE %lx", pte_val(*pte));
+ pr_cont("PTE %lx", pte_val(*pte));
out:
- printk("\n");
+ pr_cont("\n");
return;
bad:
- printk("BAD\n");
+ pr_info("BAD\n");
}
#endif /* CONFIG_X86_64 */
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] x86: use pr_cont() in dump_pagetable()
2017-08-31 7:30 [PATCH v2] x86: use pr_cont() in dump_pagetable() Jan Beulich
2017-08-31 9:55 ` [tip:x86/mm] x86/mm: Use " tip-bot for Jan Beulich
@ 2017-08-31 18:51 ` Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2017-08-31 18:51 UTC (permalink / raw)
To: Jan Beulich, mingo, tglx, hpa; +Cc: linux-kernel
On Thu, 2017-08-31 at 01:30 -0600, Jan Beulich wrote:
> The lack of newlines in preceding format strings is a clear indication
> that these were meant to be continuations of one another, and indeed
> output ends up quite a bit more compact (and readable) that way.
>
> Switch other plain printk()-s in the function instances to pr_info(),
> as requested.
I think this is incorrect as the functions immediately
preceding this dump_pagetable emit at KERN_ALERT and
the pr_info("BAD") use pr_info incorrectly.
I believe the appropriate conversion is:
---
>From f8127e18e0a466dd9a1393a4964eb9297cf39cb2 Mon Sep 17 00:00:00 2001
Message-Id: <f8127e18e0a466dd9a1393a4964eb9297cf39cb2.1504205373.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Thu, 31 Aug 2017 11:48:02 -0700
Subject: [PATCH] x86: mm: fault: Use appropriate printk KERN_<level> output
printks without KERN_CONT are emitted on separate lines.
Emit the first line at KERN_ALERT and the continuations
at KERN_CONT as necessary.
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/x86/mm/fault.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 2a1fa10c6a98..4b6125ed216e 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -396,14 +396,18 @@ static void dump_pagetable(unsigned long address)
pte_t *pte;
#ifdef CONFIG_X86_PAE
- printk("*pdpt = %016Lx ", pgd_val(*pgd));
+ printk(KERN_ALERT "*pdpt = %016Lx ", pgd_val(*pgd));
if (!low_pfn(pgd_val(*pgd) >> PAGE_SHIFT) || !pgd_present(*pgd))
goto out;
#endif
p4d = p4d_offset(pgd, address);
pud = pud_offset(p4d, address);
pmd = pmd_offset(pud, address);
+#ifdef CONFIG_X86_PAE
printk(KERN_CONT "*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)pmd_val(*pmd));
+#else
+ printk(KERN_ALERT "*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)pmd_val(*pmd));
+#endif
/*
* We must not directly access the pte in the highpte
@@ -415,9 +419,9 @@ static void dump_pagetable(unsigned long address)
goto out;
pte = pte_offset_kernel(pmd, address);
- printk("*pte = %0*Lx ", sizeof(*pte) * 2, (u64)pte_val(*pte));
+ printk(KERN_CONT "*pte = %0*Lx ", sizeof(*pte) * 2, (u64)pte_val(*pte));
out:
- printk("\n");
+ printk(KERN_CONT "\n");
}
#else /* CONFIG_X86_64: */
@@ -565,7 +569,7 @@ static void dump_pagetable(unsigned long address)
if (bad_address(pgd))
goto bad;
- printk("PGD %lx ", pgd_val(*pgd));
+ printk(KERN_ALERT "PGD %lx ", pgd_val(*pgd));
if (!pgd_present(*pgd))
goto out;
@@ -574,7 +578,7 @@ static void dump_pagetable(unsigned long address)
if (bad_address(p4d))
goto bad;
- printk("P4D %lx ", p4d_val(*p4d));
+ printk(KERN_CONT "P4D %lx ", p4d_val(*p4d));
if (!p4d_present(*p4d) || p4d_large(*p4d))
goto out;
@@ -582,7 +586,7 @@ static void dump_pagetable(unsigned long address)
if (bad_address(pud))
goto bad;
- printk("PUD %lx ", pud_val(*pud));
+ printk(KERN_CONT "PUD %lx ", pud_val(*pud));
if (!pud_present(*pud) || pud_large(*pud))
goto out;
@@ -590,7 +594,7 @@ static void dump_pagetable(unsigned long address)
if (bad_address(pmd))
goto bad;
- printk("PMD %lx ", pmd_val(*pmd));
+ printk(KERN_CONT "PMD %lx ", pmd_val(*pmd));
if (!pmd_present(*pmd) || pmd_large(*pmd))
goto out;
@@ -598,12 +602,12 @@ static void dump_pagetable(unsigned long address)
if (bad_address(pte))
goto bad;
- printk("PTE %lx", pte_val(*pte));
+ printk(KERN_CONT "PTE %lx", pte_val(*pte));
out:
- printk("\n");
+ printk(KERN_CONT "\n");
return;
bad:
- printk("BAD\n");
+ printk(KERN_CONT "BAD\n");
}
#endif /* CONFIG_X86_64 */
--
2.10.0.rc2.1.g053435c
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-31 18:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-31 7:30 [PATCH v2] x86: use pr_cont() in dump_pagetable() Jan Beulich
2017-08-31 9:55 ` [tip:x86/mm] x86/mm: Use " tip-bot for Jan Beulich
2017-08-31 18:51 ` [PATCH v2] x86: use " Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox