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
135 c0 = (entrylo0 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;135 c0 = (entrylo0 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;
136 c1 = (entrylo1 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;136 c1 = (entrylo1 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;
137 137
138 printk("va=%0*lx asid=%0*lx",138 pr_cont("va=%0*lx asid=%0*lx",
139 vwidth, (entryhi & ~0x1fffUL),139 vwidth, (entryhi & ~0x1fffUL),
140 asidwidth, entryhi & asidmask);140 asidwidth, entryhi & asidmask);
141 if (cpu_has_guestid)141 if (cpu_has_guestid)
142 printk(" gid=%02lx",142 pr_cont(" gid=%02lx",
143 (guestctl1 & MIPS_GCTL1_RID)143 (guestctl1 & MIPS_GCTL1_RID)
144 >> MIPS_GCTL1_RID_SHIFT);144 >> MIPS_GCTL1_RID_SHIFT);
145 /* RI/XI are in awkward places, so mask them off separately */145 /* RI/XI are in awkward places, so mask them off separately */
146 pa = entrylo0 & ~(MIPS_ENTRYLO_RI | MIPS_ENTRYLO_XI);146 pa = entrylo0 & ~(MIPS_ENTRYLO_RI | MIPS_ENTRYLO_XI);
147 if (xpa)147 if (xpa)
148 pa |= (unsigned long long)readx_c0_entrylo0() << 30;148 pa |= (unsigned long long)readx_c0_entrylo0() << 30;
149 pa = (pa << 6) & PAGE_MASK;149 pa = (pa << 6) & PAGE_MASK;
150 printk("\n\t[");150 pr_cont("\n\t[");
151 if (cpu_has_rixi)151 if (cpu_has_rixi)
152 printk("ri=%d xi=%d ",152 pr_cont("ri=%d xi=%d ",
153 (entrylo0 & MIPS_ENTRYLO_RI) ? 1 : 0,153 (entrylo0 & MIPS_ENTRYLO_RI) ? 1 : 0,
154 (entrylo0 & MIPS_ENTRYLO_XI) ? 1 : 0);154 (entrylo0 & MIPS_ENTRYLO_XI) ? 1 : 0);
155 printk("pa=%0*llx c=%d d=%d v=%d g=%d] [",155 pr_cont("pa=%0*llx c=%d d=%d v=%d g=%d] [",
156 pwidth, pa, c0,156 pwidth, pa, c0,
157 (entrylo0 & ENTRYLO_D) ? 1 : 0,157 (entrylo0 & ENTRYLO_D) ? 1 : 0,
158 (entrylo0 & ENTRYLO_V) ? 1 : 0,158 (entrylo0 & ENTRYLO_V) ? 1 : 0,
159 (entrylo0 & ENTRYLO_G) ? 1 : 0);159 (entrylo0 & ENTRYLO_G) ? 1 : 0);
160 /* RI/XI are in awkward places, so mask them off separately */160 /* RI/XI are in awkward places, so mask them off separately */
161 pa = entrylo1 & ~(MIPS_ENTRYLO_RI | MIPS_ENTRYLO_XI);161 pa = entrylo1 & ~(MIPS_ENTRYLO_RI | MIPS_ENTRYLO_XI);
162 if (xpa)162 if (xpa)
163 pa |= (unsigned long long)readx_c0_entrylo1() << 30;163 pa |= (unsigned long long)readx_c0_entrylo1() << 30;
164 pa = (pa << 6) & PAGE_MASK;164 pa = (pa << 6) & PAGE_MASK;
165 if (cpu_has_rixi)165 if (cpu_has_rixi)
166 printk("ri=%d xi=%d ",166 pr_cont("ri=%d xi=%d ",
167 (entrylo1 & MIPS_ENTRYLO_RI) ? 1 : 0,167 (entrylo1 & MIPS_ENTRYLO_RI) ? 1 : 0,
168 (entrylo1 & MIPS_ENTRYLO_XI) ? 1 : 0);168 (entrylo1 & MIPS_ENTRYLO_XI) ? 1 : 0);
169 printk("pa=%0*llx c=%d d=%d v=%d g=%d]\n",169 pr_cont("pa=%0*llx c=%d d=%d v=%d g=%d]\n",
170 pwidth, pa, c1,170 pwidth, pa, c1,
171 (entrylo1 & ENTRYLO_D) ? 1 : 0,171 (entrylo1 & ENTRYLO_D) ? 1 : 0,
172 (entrylo1 & ENTRYLO_V) ? 1 : 0,172 (entrylo1 & ENTRYLO_V) ? 1 : 0,
173 (entrylo1 & ENTRYLO_G) ? 1 : 0);173 (entrylo1 & ENTRYLO_G) ? 1 : 0);
174 }174 }
175 printk("\n");175 printk("\n");
176 176
arch/mips/lib/r3k_dump_tlb.c+9−9
@@ -53,15 +53,15 @@ static void dump_tlb(int first, int last) · 52 unmodified lines
53 */53 */
54 printk("Index: %2d ", i);54 printk("Index: %2d ", i);
55 55
56 printk("va=%08lx asid=%08lx"56 pr_cont("va=%08lx asid=%08lx"
57 " [pa=%06lx n=%d d=%d v=%d g=%d]",57 " [pa=%06lx n=%d d=%d v=%d g=%d]",
58 entryhi & PAGE_MASK,58 entryhi & PAGE_MASK,
59 entryhi & asid_mask,59 entryhi & asid_mask,
60 entrylo0 & PAGE_MASK,60 entrylo0 & PAGE_MASK,
61 (entrylo0 & R3K_ENTRYLO_N) ? 1 : 0,61 (entrylo0 & R3K_ENTRYLO_N) ? 1 : 0,
62 (entrylo0 & R3K_ENTRYLO_D) ? 1 : 0,62 (entrylo0 & R3K_ENTRYLO_D) ? 1 : 0,
63 (entrylo0 & R3K_ENTRYLO_V) ? 1 : 0,63 (entrylo0 & R3K_ENTRYLO_V) ? 1 : 0,
64 (entrylo0 & R3K_ENTRYLO_G) ? 1 : 0);64 (entrylo0 & R3K_ENTRYLO_G) ? 1 : 0);
65 }65 }
66 }66 }
67 printk("\n");67 printk("\n");