History

MIPS: dump_tlb: Fix printk continuations

Since commit 4bcc595ccd80 ("printk: reinstate KERN_CONT for printing continuation lines") the output from TLB dumps on MIPS has been pretty unreadable due to the lack of KERN_CONT markers. Use pr_cont to provide the appropriate markers & restore the expected output. Continuation is also used for the second line of each TLB entry printed in dump_tlb.c even though it has a newline, since it is a continuation of the interpretation of the same TLB entry. For example: [ 46.371884] Index: 0 pgmask=16kb va=77654000 asid=73 gid=00 [ri=0 xi=0 pa=ffc18000 c=5 d=0 v=1 g=0] [ri=0 xi=0 pa=ffc1c000 c=5 d=0 v=1 g=0] [ 46.385380] Index: 12 pgmask=16kb va=004b4000 asid=73 gid=00 [ri=0 xi=0 pa=00000000 c=0 d=0 v=0 g=0] [ri=0 xi=0 pa=ffb00000 c=5 d=1 v=1 g=0]

James Hogan committed 10 years ago

Commit 8a984951 parent 752f5492 files · +31 −31Browse files

Unified · Split

2 files
  1. arch/mips/lib/dump_tlb.c +22 −22
  2. arch/mips/lib/r3k_dump_tlb.c +9 −9
arch/mips/lib/dump_tlb.c+22−22
@@ -135,42 +135,42 @@ static void dump_tlb(int first, int last) · 134 unmodified lines
135135 c0 = (entrylo0 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;
136136 c1 = (entrylo1 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;
137137
138− printk("va=%0*lx asid=%0*lx",
139− vwidth, (entryhi & ~0x1fffUL),
140− asidwidth, entryhi & asidmask);
138+ pr_cont("va=%0*lx asid=%0*lx",
139+ vwidth, (entryhi & ~0x1fffUL),
140+ asidwidth, entryhi & asidmask);
141141 if (cpu_has_guestid)
142− printk(" gid=%02lx",
143− (guestctl1 & MIPS_GCTL1_RID)
142+ pr_cont(" gid=%02lx",
143+ (guestctl1 & MIPS_GCTL1_RID)
144144 >> MIPS_GCTL1_RID_SHIFT);
145145 /* RI/XI are in awkward places, so mask them off separately */
146146 pa = entrylo0 & ~(MIPS_ENTRYLO_RI | MIPS_ENTRYLO_XI);
147147 if (xpa)
148148 pa |= (unsigned long long)readx_c0_entrylo0() << 30;
149149 pa = (pa << 6) & PAGE_MASK;
150− printk("\n\t[");
150+ pr_cont("\n\t[");
151151 if (cpu_has_rixi)
152− printk("ri=%d xi=%d ",
153− (entrylo0 & MIPS_ENTRYLO_RI) ? 1 : 0,
154− (entrylo0 & MIPS_ENTRYLO_XI) ? 1 : 0);
155− printk("pa=%0*llx c=%d d=%d v=%d g=%d] [",
156− pwidth, pa, c0,
157− (entrylo0 & ENTRYLO_D) ? 1 : 0,
158− (entrylo0 & ENTRYLO_V) ? 1 : 0,
159− (entrylo0 & ENTRYLO_G) ? 1 : 0);
152+ pr_cont("ri=%d xi=%d ",
153+ (entrylo0 & MIPS_ENTRYLO_RI) ? 1 : 0,
154+ (entrylo0 & MIPS_ENTRYLO_XI) ? 1 : 0);
155+ pr_cont("pa=%0*llx c=%d d=%d v=%d g=%d] [",
156+ pwidth, pa, c0,
157+ (entrylo0 & ENTRYLO_D) ? 1 : 0,
158+ (entrylo0 & ENTRYLO_V) ? 1 : 0,
159+ (entrylo0 & ENTRYLO_G) ? 1 : 0);
160160 /* RI/XI are in awkward places, so mask them off separately */
161161 pa = entrylo1 & ~(MIPS_ENTRYLO_RI | MIPS_ENTRYLO_XI);
162162 if (xpa)
163163 pa |= (unsigned long long)readx_c0_entrylo1() << 30;
164164 pa = (pa << 6) & PAGE_MASK;
165165 if (cpu_has_rixi)
166− printk("ri=%d xi=%d ",
167− (entrylo1 & MIPS_ENTRYLO_RI) ? 1 : 0,
168− (entrylo1 & MIPS_ENTRYLO_XI) ? 1 : 0);
169− printk("pa=%0*llx c=%d d=%d v=%d g=%d]\n",
170− pwidth, pa, c1,
171− (entrylo1 & ENTRYLO_D) ? 1 : 0,
172− (entrylo1 & ENTRYLO_V) ? 1 : 0,
173− (entrylo1 & ENTRYLO_G) ? 1 : 0);
166+ pr_cont("ri=%d xi=%d ",
167+ (entrylo1 & MIPS_ENTRYLO_RI) ? 1 : 0,
168+ (entrylo1 & MIPS_ENTRYLO_XI) ? 1 : 0);
169+ pr_cont("pa=%0*llx c=%d d=%d v=%d g=%d]\n",
170+ pwidth, pa, c1,
171+ (entrylo1 & ENTRYLO_D) ? 1 : 0,
172+ (entrylo1 & ENTRYLO_V) ? 1 : 0,
173+ (entrylo1 & ENTRYLO_G) ? 1 : 0);
174174 }
175175 printk("\n");
176176
arch/mips/lib/r3k_dump_tlb.c+9−9
@@ -53,15 +53,15 @@ static void dump_tlb(int first, int last) · 52 unmodified lines
5353 */
5454 printk("Index: %2d ", i);
5555
56− printk("va=%08lx asid=%08lx"
57− " [pa=%06lx n=%d d=%d v=%d g=%d]",
58− entryhi & PAGE_MASK,
59− entryhi & asid_mask,
60− entrylo0 & PAGE_MASK,
61− (entrylo0 & R3K_ENTRYLO_N) ? 1 : 0,
62− (entrylo0 & R3K_ENTRYLO_D) ? 1 : 0,
63− (entrylo0 & R3K_ENTRYLO_V) ? 1 : 0,
64− (entrylo0 & R3K_ENTRYLO_G) ? 1 : 0);
56+ pr_cont("va=%08lx asid=%08lx"
57+ " [pa=%06lx n=%d d=%d v=%d g=%d]",
58+ entryhi & PAGE_MASK,
59+ entryhi & asid_mask,
60+ entrylo0 & PAGE_MASK,
61+ (entrylo0 & R3K_ENTRYLO_N) ? 1 : 0,
62+ (entrylo0 & R3K_ENTRYLO_D) ? 1 : 0,
63+ (entrylo0 & R3K_ENTRYLO_V) ? 1 : 0,
64+ (entrylo0 & R3K_ENTRYLO_G) ? 1 : 0);
6565 }
6666 }
6767 printk("\n");