Skip to content

Commit 4fe3ebe

Browse files
committed
sparc: Use new '%pS' infrastructure to print symbols.
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f538f3d commit 4fe3ebe

6 files changed

Lines changed: 37 additions & 56 deletions

File tree

‎arch/sparc/kernel/process.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* linux/arch/sparc/kernel/process.c
22
*
3-
* Copyright (C) 1995 David S. Miller (davem@davemloft.net)
3+
* Copyright (C) 1995, 2008 David S. Miller (davem@davemloft.net)
44
* Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
55
*/
66

@@ -14,7 +14,6 @@
1414
#include <linux/module.h>
1515
#include <linux/sched.h>
1616
#include <linux/kernel.h>
17-
#include <linux/kallsyms.h>
1817
#include <linux/mm.h>
1918
#include <linux/stddef.h>
2019
#include <linux/ptrace.h>
@@ -198,7 +197,7 @@ void __show_backtrace(unsigned long fp)
198197
rw->ins[4], rw->ins[5],
199198
rw->ins[6],
200199
rw->ins[7]);
201-
print_symbol("%s\n", rw->ins[7]);
200+
printk("%pS\n", (void *) rw->ins[7]);
202201
rw = (struct reg_window *) rw->ins[6];
203202
}
204203
spin_unlock_irqrestore(&sparc_backtrace_lock, flags);
@@ -265,14 +264,14 @@ void show_regs(struct pt_regs *r)
265264

266265
printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n",
267266
r->psr, r->pc, r->npc, r->y, print_tainted());
268-
print_symbol("PC: <%s>\n", r->pc);
267+
printk("PC: <%pS>\n", (void *) r->pc);
269268
printk("%%G: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
270269
r->u_regs[0], r->u_regs[1], r->u_regs[2], r->u_regs[3],
271270
r->u_regs[4], r->u_regs[5], r->u_regs[6], r->u_regs[7]);
272271
printk("%%O: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
273272
r->u_regs[8], r->u_regs[9], r->u_regs[10], r->u_regs[11],
274273
r->u_regs[12], r->u_regs[13], r->u_regs[14], r->u_regs[15]);
275-
print_symbol("RPC: <%s>\n", r->u_regs[15]);
274+
printk("RPC: <%pS>\n", (void *) r->u_regs[15]);
276275

277276
printk("%%L: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
278277
rw->locals[0], rw->locals[1], rw->locals[2], rw->locals[3],
@@ -307,7 +306,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
307306
rw = (struct reg_window *) fp;
308307
pc = rw->ins[7];
309308
printk("[%08lx : ", pc);
310-
print_symbol("%s ] ", pc);
309+
printk("%pS ] ", (void *) pc);
311310
fp = rw->ins[6];
312311
} while (++count < 16);
313312
printk("\n");

‎arch/sparc/kernel/traps.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* arch/sparc/kernel/traps.c
33
*
4-
* Copyright 1995 David S. Miller (davem@caip.rutgers.edu)
4+
* Copyright 1995, 2008 David S. Miller (davem@davemloft.net)
55
* Copyright 2000 Jakub Jelinek (jakub@redhat.com)
66
*/
77

@@ -11,7 +11,6 @@
1111

1212
#include <linux/sched.h> /* for jiffies */
1313
#include <linux/kernel.h>
14-
#include <linux/kallsyms.h>
1514
#include <linux/signal.h>
1615
#include <linux/smp.h>
1716
#include <linux/smp_lock.h>
@@ -116,8 +115,8 @@ void die_if_kernel(char *str, struct pt_regs *regs)
116115
count++ < 30 &&
117116
(((unsigned long) rw) >= PAGE_OFFSET) &&
118117
!(((unsigned long) rw) & 0x7)) {
119-
printk("Caller[%08lx]", rw->ins[7]);
120-
print_symbol(": %s\n", rw->ins[7]);
118+
printk("Caller[%08lx]: %pS\n", rw->ins[7],
119+
(void *) rw->ins[7]);
121120
rw = (struct reg_window *)rw->ins[6];
122121
}
123122
}

‎arch/sparc64/kernel/process.c‎

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/module.h>
1616
#include <linux/sched.h>
1717
#include <linux/kernel.h>
18-
#include <linux/kallsyms.h>
1918
#include <linux/mm.h>
2019
#include <linux/fs.h>
2120
#include <linux/smp.h>
@@ -211,7 +210,7 @@ static void show_regwindow(struct pt_regs *regs)
211210
printk("i4: %016lx i5: %016lx i6: %016lx i7: %016lx\n",
212211
rwk->ins[4], rwk->ins[5], rwk->ins[6], rwk->ins[7]);
213212
if (regs->tstate & TSTATE_PRIV)
214-
print_symbol("I7: <%s>\n", rwk->ins[7]);
213+
printk("I7: <%pS>\n", (void *) rwk->ins[7]);
215214
}
216215

217216
#ifdef CONFIG_SMP
@@ -232,7 +231,7 @@ void __show_regs(struct pt_regs * regs)
232231
#endif
233232
printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x %s\n", regs->tstate,
234233
regs->tpc, regs->tnpc, regs->y, print_tainted());
235-
print_symbol("TPC: <%s>\n", regs->tpc);
234+
printk("TPC: <%pS>\n", (void *) regs->tpc);
236235
printk("g0: %016lx g1: %016lx g2: %016lx g3: %016lx\n",
237236
regs->u_regs[0], regs->u_regs[1], regs->u_regs[2],
238237
regs->u_regs[3]);
@@ -245,7 +244,7 @@ void __show_regs(struct pt_regs * regs)
245244
printk("o4: %016lx o5: %016lx sp: %016lx ret_pc: %016lx\n",
246245
regs->u_regs[12], regs->u_regs[13], regs->u_regs[14],
247246
regs->u_regs[15]);
248-
print_symbol("RPC: <%s>\n", regs->u_regs[15]);
247+
printk("RPC: <%pS>\n", (void *) regs->u_regs[15]);
249248
show_regwindow(regs);
250249
#ifdef CONFIG_SMP
251250
spin_unlock(&regdump_lock);
@@ -346,9 +345,6 @@ static void sysrq_handle_globreg(int key, struct tty_struct *tty)
346345
{
347346
struct thread_info *tp = current_thread_info();
348347
struct pt_regs *regs = get_irq_regs();
349-
#ifdef CONFIG_KALLSYMS
350-
char buffer[KSYM_SYMBOL_LEN];
351-
#endif
352348
unsigned long flags;
353349
int this_cpu, cpu;
354350

@@ -377,17 +373,13 @@ static void sysrq_handle_globreg(int key, struct tty_struct *tty)
377373
gp->tstate, gp->tpc, gp->tnpc,
378374
((tp && tp->task) ? tp->task->comm : "NULL"),
379375
((tp && tp->task) ? tp->task->pid : -1));
380-
#ifdef CONFIG_KALLSYMS
376+
381377
if (gp->tstate & TSTATE_PRIV) {
382-
sprint_symbol(buffer, gp->tpc);
383-
printk(" TPC[%s] ", buffer);
384-
sprint_symbol(buffer, gp->o7);
385-
printk("O7[%s] ", buffer);
386-
sprint_symbol(buffer, gp->i7);
387-
printk("I7[%s]\n", buffer);
388-
} else
389-
#endif
390-
{
378+
printk(" TPC[%pS] O7[%pS] I7[%pS]\n",
379+
(void *) gp->tpc,
380+
(void *) gp->o7,
381+
(void *) gp->i7);
382+
} else {
391383
printk(" TPC[%lx] O7[%lx] I7[%lx]\n",
392384
gp->tpc, gp->o7, gp->i7);
393385
}

‎arch/sparc64/kernel/traps.c‎

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* arch/sparc64/kernel/traps.c
22
*
3-
* Copyright (C) 1995,1997 David S. Miller (davem@davemloft.net)
3+
* Copyright (C) 1995,1997,2008 David S. Miller (davem@davemloft.net)
44
* Copyright (C) 1997,1999,2000 Jakub Jelinek (jakub@redhat.com)
55
*/
66

@@ -11,7 +11,6 @@
1111
#include <linux/module.h>
1212
#include <linux/sched.h>
1313
#include <linux/kernel.h>
14-
#include <linux/kallsyms.h>
1514
#include <linux/signal.h>
1615
#include <linux/smp.h>
1716
#include <linux/mm.h>
@@ -74,7 +73,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
7473
i + 1,
7574
p->trapstack[i].tstate, p->trapstack[i].tpc,
7675
p->trapstack[i].tnpc, p->trapstack[i].tt);
77-
print_symbol("TRAPLOG: TPC<%s>\n", p->trapstack[i].tpc);
76+
printk("TRAPLOG: TPC<%pS>\n", (void *) p->trapstack[i].tpc);
7877
}
7978
}
8079

@@ -1081,7 +1080,7 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in
10811080
regs->tpc, regs->tnpc, regs->u_regs[UREG_I7], regs->tstate);
10821081
printk("%s" "ERROR(%d): ",
10831082
(recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id());
1084-
print_symbol("TPC<%s>\n", regs->tpc);
1083+
printk("TPC<%pS>\n", (void *) regs->tpc);
10851084
printk("%s" "ERROR(%d): M_SYND(%lx), E_SYND(%lx)%s%s\n",
10861085
(recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
10871086
(afsr & CHAFSR_M_SYNDROME) >> CHAFSR_M_SYNDROME_SHIFT,
@@ -1689,15 +1688,15 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs)
16891688
smp_processor_id(),
16901689
(type & 0x1) ? 'I' : 'D',
16911690
regs->tpc);
1692-
print_symbol(KERN_EMERG "TPC<%s>\n", regs->tpc);
1691+
printk(KERN_EMERG "TPC<%pS>\n", (void *) regs->tpc);
16931692
panic("Irrecoverable Cheetah+ parity error.");
16941693
}
16951694

16961695
printk(KERN_WARNING "CPU[%d]: Cheetah+ %c-cache parity error at TPC[%016lx]\n",
16971696
smp_processor_id(),
16981697
(type & 0x1) ? 'I' : 'D',
16991698
regs->tpc);
1700-
print_symbol(KERN_WARNING "TPC<%s>\n", regs->tpc);
1699+
printk(KERN_WARNING "TPC<%pS>\n", (void *) regs->tpc);
17011700
}
17021701

17031702
struct sun4v_error_entry {
@@ -1904,9 +1903,10 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
19041903

19051904
printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
19061905
regs->tpc, tl);
1907-
print_symbol(KERN_EMERG "SUN4V-ITLB: TPC<%s>\n", regs->tpc);
1906+
printk(KERN_EMERG "SUN4V-ITLB: TPC<%pS>\n", (void *) regs->tpc);
19081907
printk(KERN_EMERG "SUN4V-ITLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
1909-
print_symbol(KERN_EMERG "SUN4V-ITLB: O7<%s>\n", regs->u_regs[UREG_I7]);
1908+
printk(KERN_EMERG "SUN4V-ITLB: O7<%pS>\n",
1909+
(void *) regs->u_regs[UREG_I7]);
19101910
printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] "
19111911
"pte[%lx] error[%lx]\n",
19121912
sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx,
@@ -1927,9 +1927,10 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl)
19271927

19281928
printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n",
19291929
regs->tpc, tl);
1930-
print_symbol(KERN_EMERG "SUN4V-DTLB: TPC<%s>\n", regs->tpc);
1930+
printk(KERN_EMERG "SUN4V-DTLB: TPC<%pS>\n", (void *) regs->tpc);
19311931
printk(KERN_EMERG "SUN4V-DTLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
1932-
print_symbol(KERN_EMERG "SUN4V-DTLB: O7<%s>\n", regs->u_regs[UREG_I7]);
1932+
printk(KERN_EMERG "SUN4V-DTLB: O7<%pS>\n",
1933+
(void *) regs->u_regs[UREG_I7]);
19331934
printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] "
19341935
"pte[%lx] error[%lx]\n",
19351936
sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx,
@@ -2111,10 +2112,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
21112112
fp = ksp + STACK_BIAS;
21122113
thread_base = (unsigned long) tp;
21132114

2114-
printk("Call Trace:");
2115-
#ifdef CONFIG_KALLSYMS
2116-
printk("\n");
2117-
#endif
2115+
printk("Call Trace:\n");
21182116
do {
21192117
struct sparc_stackf *sf;
21202118
struct pt_regs *regs;
@@ -2137,12 +2135,8 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
21372135
fp = (unsigned long)sf->fp + STACK_BIAS;
21382136
}
21392137

2140-
printk(" [%016lx] ", pc);
2141-
print_symbol("%s\n", pc);
2138+
printk(" [%016lx] %pS\n", pc, (void *) pc);
21422139
} while (++count < 16);
2143-
#ifndef CONFIG_KALLSYMS
2144-
printk("\n");
2145-
#endif
21462140
}
21472141

21482142
void dump_stack(void)
@@ -2211,9 +2205,8 @@ void die_if_kernel(char *str, struct pt_regs *regs)
22112205
while (rw &&
22122206
count++ < 30&&
22132207
is_kernel_stack(current, rw)) {
2214-
printk("Caller[%016lx]", rw->ins[7]);
2215-
print_symbol(": %s", rw->ins[7]);
2216-
printk("\n");
2208+
printk("Caller[%016lx]: %pS\n", rw->ins[7],
2209+
(void *) rw->ins[7]);
22172210

22182211
rw = kernel_stack_up(rw);
22192212
}

‎arch/sparc64/kernel/unaligned.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* unaligned.c: Unaligned load/store trap handling with special
33
* cases for the kernel to do them more quickly.
44
*
5-
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5+
* Copyright (C) 1996,2008 David S. Miller (davem@davemloft.net)
66
* Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
77
*/
88

@@ -20,7 +20,6 @@
2020
#include <asm/uaccess.h>
2121
#include <linux/smp.h>
2222
#include <linux/bitops.h>
23-
#include <linux/kallsyms.h>
2423
#include <asm/fpumacro.h>
2524

2625
/* #define DEBUG_MNA */
@@ -289,8 +288,8 @@ static void log_unaligned(struct pt_regs *regs)
289288
if (count < 5) {
290289
last_time = jiffies;
291290
count++;
292-
printk("Kernel unaligned access at TPC[%lx] ", regs->tpc);
293-
print_symbol("%s\n", regs->tpc);
291+
printk("Kernel unaligned access at TPC[%lx] %pS\n",
292+
regs->tpc, (void *) regs->tpc);
294293
}
295294
}
296295

‎arch/sparc64/mm/fault.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* arch/sparc64/mm/fault.c: Page fault handlers for the 64-bit Sparc.
33
*
4-
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
4+
* Copyright (C) 1996, 2008 David S. Miller (davem@davemloft.net)
55
* Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz)
66
*/
77

@@ -18,7 +18,6 @@
1818
#include <linux/init.h>
1919
#include <linux/interrupt.h>
2020
#include <linux/kprobes.h>
21-
#include <linux/kallsyms.h>
2221
#include <linux/kdebug.h>
2322

2423
#include <asm/page.h>
@@ -115,7 +114,7 @@ static void bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr)
115114
printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
116115
regs->tpc);
117116
printk(KERN_CRIT "OOPS: RPC [%016lx]\n", regs->u_regs[15]);
118-
print_symbol("RPC: <%s>\n", regs->u_regs[15]);
117+
printk("OOPS: RPC <%pS>\n", (void *) regs->u_regs[15]);
119118
printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr);
120119
dump_stack();
121120
unhandled_fault(regs->tpc, current, regs);

0 commit comments

Comments
 (0)