Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155193
b: refs/heads/master
c: 0406ca6
h: refs/heads/master
i:
  155191: 6fab287
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Jul 1, 2009
1 parent 3109125 commit 3343cce
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 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: 5da50258584469ddfee6545feb4eb2252a8d7e7b
refs/heads/master: 0406ca6d8e849d9dd027c8cb6791448e81411aef
2 changes: 2 additions & 0 deletions trunk/arch/x86/include/asm/stacktrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

extern int kstack_depth_to_print;

int x86_is_stack_id(int id, char *name);

/* Generic stack tracer with callbacks */

struct stacktrace_ops {
Expand Down
8 changes: 7 additions & 1 deletion trunk/arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,7 @@ void callchain_store(struct perf_callchain_entry *entry, u64 ip)

static DEFINE_PER_CPU(struct perf_callchain_entry, irq_entry);
static DEFINE_PER_CPU(struct perf_callchain_entry, nmi_entry);
static DEFINE_PER_CPU(int, in_nmi_frame);


static void
Expand All @@ -1576,14 +1577,19 @@ static void backtrace_warning(void *data, char *msg)

static int backtrace_stack(void *data, char *name)
{
/* Process all stacks: */
per_cpu(in_nmi_frame, smp_processor_id()) =
x86_is_stack_id(NMI_STACK, name);

return 0;
}

static void backtrace_address(void *data, unsigned long addr, int reliable)
{
struct perf_callchain_entry *entry = data;

if (per_cpu(in_nmi_frame, smp_processor_id()))
return;

if (reliable)
callchain_store(entry, addr);
}
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/x86/kernel/dumpstack_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

#include "dumpstack.h"

/* Just a stub for now */
int x86_is_stack_id(int id, char *name)
{
return 0;
}

void dump_trace(struct task_struct *task, struct pt_regs *regs,
unsigned long *stack, unsigned long bp,
const struct stacktrace_ops *ops, void *data)
Expand Down
22 changes: 15 additions & 7 deletions trunk/arch/x86/kernel/dumpstack_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@

#include "dumpstack.h"

static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
unsigned *usedp, char **idp)
{
static char ids[][8] = {

static char x86_stack_ids[][8] = {
[DEBUG_STACK - 1] = "#DB",
[NMI_STACK - 1] = "NMI",
[DOUBLEFAULT_STACK - 1] = "#DF",
Expand All @@ -33,6 +31,15 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]"
#endif
};

int x86_is_stack_id(int id, char *name)
{
return x86_stack_ids[id - 1] == name;
}

static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
unsigned *usedp, char **idp)
{
unsigned k;

/*
Expand Down Expand Up @@ -61,7 +68,7 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
if (*usedp & (1U << k))
break;
*usedp |= 1U << k;
*idp = ids[k];
*idp = x86_stack_ids[k];
return (unsigned long *)end;
}
/*
Expand All @@ -81,12 +88,13 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
do {
++j;
end -= EXCEPTION_STKSZ;
ids[j][4] = '1' + (j - N_EXCEPTION_STACKS);
x86_stack_ids[j][4] = '1' +
(j - N_EXCEPTION_STACKS);
} while (stack < end - EXCEPTION_STKSZ);
if (*usedp & (1U << j))
break;
*usedp |= 1U << j;
*idp = ids[j];
*idp = x86_stack_ids[j];
return (unsigned long *)end;
}
#endif
Expand Down

0 comments on commit 3343cce

Please sign in to comment.