forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PATCH] lockdep: stacktrace subsystem, core
Framework to generate and save stacktraces quickly, without printing anything to the console. Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Arjan van de Ven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
Ingo Molnar
authored and
Linus Torvalds
committed
Jul 3, 2006
1 parent
f0a5c31
commit 8637c09
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef __LINUX_STACKTRACE_H | ||
#define __LINUX_STACKTRACE_H | ||
|
||
#ifdef CONFIG_STACKTRACE | ||
struct stack_trace { | ||
unsigned int nr_entries, max_entries; | ||
unsigned long *entries; | ||
}; | ||
|
||
extern void save_stack_trace(struct stack_trace *trace, | ||
struct task_struct *task, int all_contexts, | ||
unsigned int skip); | ||
|
||
extern void print_stack_trace(struct stack_trace *trace, int spaces); | ||
#else | ||
# define save_stack_trace(trace, task, all, skip) do { } while (0) | ||
# define print_stack_trace(trace) do { } while (0) | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* kernel/stacktrace.c | ||
* | ||
* Stack trace management functions | ||
* | ||
* Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <[email protected]> | ||
*/ | ||
#include <linux/sched.h> | ||
#include <linux/kallsyms.h> | ||
#include <linux/stacktrace.h> | ||
|
||
void print_stack_trace(struct stack_trace *trace, int spaces) | ||
{ | ||
int i, j; | ||
|
||
for (i = 0; i < trace->nr_entries; i++) { | ||
unsigned long ip = trace->entries[i]; | ||
|
||
for (j = 0; j < spaces + 1; j++) | ||
printk(" "); | ||
print_ip_sym(ip); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters