Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80369
b: refs/heads/master
c: a5ff677
h: refs/heads/master
i:
  80367: f693ba0
v: v3
  • Loading branch information
Harvey Harrison authored and Ingo Molnar committed Jan 30, 2008
1 parent 904889e commit bde4388
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 625d6cffcac1c96faa18d629f1271d63af0e05f2
refs/heads/master: a5ff677c2fb10567d1e750fb9e4417d95081071b
28 changes: 28 additions & 0 deletions trunk/arch/x86/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,34 @@ asmlinkage void machine_check(void);
int kstack_depth_to_print = 24;
static unsigned int code_bytes = 64;

void printk_address(unsigned long address, int reliable)
{
#ifdef CONFIG_KALLSYMS
unsigned long offset = 0, symsize;
const char *symname;
char *modname;
char *delim = ":";
char namebuf[128];
char reliab[4] = "";

symname = kallsyms_lookup(address, &symsize, &offset,
&modname, namebuf);
if (!symname) {
printk(" [<%08lx>]\n", address);
return;
}
if (!reliable)
strcpy(reliab, "? ");

if (!modname)
modname = delim = "";
printk(" [<%08lx>] %s%s%s%s%s+0x%lx/0x%lx\n",
address, reliab, delim, modname, delim, symname, offset, symsize);
#else
printk(" [<%08lx>]\n", address);
#endif
}

static inline int valid_stack_ptr(struct thread_info *tinfo, void *p, unsigned size)
{
return p > (void *)tinfo &&
Expand Down
11 changes: 4 additions & 7 deletions trunk/arch/x86/kernel/traps_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)

int kstack_depth_to_print = 12;

#ifdef CONFIG_KALLSYMS
void printk_address(unsigned long address, int reliable)
{
#ifdef CONFIG_KALLSYMS
unsigned long offset = 0, symsize;
const char *symname;
char *modname;
char *delim = ":";
char namebuf[128];
char reliab[4] = "";;
char reliab[4] = "";

symname = kallsyms_lookup(address, &symsize, &offset,
&modname, namebuf);
Expand All @@ -120,16 +120,13 @@ void printk_address(unsigned long address, int reliable)
strcpy(reliab, "? ");

if (!modname)
modname = delim = "";
modname = delim = "";
printk(" [<%016lx>] %s%s%s%s%s+0x%lx/0x%lx\n",
address, reliab, delim, modname, delim, symname, offset, symsize);
}
#else
void printk_address(unsigned long address, int reliable)
{
printk(" [<%016lx>]\n", address);
}
#endif
}

static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
unsigned *usedp, char **idp)
Expand Down

0 comments on commit bde4388

Please sign in to comment.