forked from Sricharanti/sricharan
-
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] x86_64: reliable stack trace support
These are the generic bits needed to enable reliable stack traces based on Dwarf2-like (.eh_frame) unwind information. Subsequent patches will enable x86-64 and i386 to make use of this. Thanks to Andi Kleen and Ingo Molnar, who pointed out several possibilities for improvement. Signed-off-by: Jan Beulich <[email protected]> Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
Jan Beulich
authored and
Linus Torvalds
committed
Jun 26, 2006
1 parent
2b28592
commit 4552d5d
Showing
8 changed files
with
1,072 additions
and
3 deletions.
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
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,119 @@ | ||
#ifndef _LINUX_UNWIND_H | ||
#define _LINUX_UNWIND_H | ||
|
||
/* | ||
* Copyright (C) 2002-2006 Novell, Inc. | ||
* Jan Beulich <[email protected]> | ||
* This code is released under version 2 of the GNU GPL. | ||
* | ||
* A simple API for unwinding kernel stacks. This is used for | ||
* debugging and error reporting purposes. The kernel doesn't need | ||
* full-blown stack unwinding with all the bells and whistles, so there | ||
* is not much point in implementing the full Dwarf2 unwind API. | ||
*/ | ||
|
||
#include <linux/config.h> | ||
|
||
struct module; | ||
|
||
#ifdef CONFIG_STACK_UNWIND | ||
|
||
#include <asm/unwind.h> | ||
|
||
#ifndef ARCH_UNWIND_SECTION_NAME | ||
#define ARCH_UNWIND_SECTION_NAME ".eh_frame" | ||
#endif | ||
|
||
/* | ||
* Initialize unwind support. | ||
*/ | ||
extern void unwind_init(void); | ||
|
||
extern void *unwind_add_table(struct module *, | ||
const void *table_start, | ||
unsigned long table_size); | ||
|
||
extern void unwind_remove_table(void *handle, int init_only); | ||
|
||
extern int unwind_init_frame_info(struct unwind_frame_info *, | ||
struct task_struct *, | ||
/*const*/ struct pt_regs *); | ||
|
||
/* | ||
* Prepare to unwind a blocked task. | ||
*/ | ||
extern int unwind_init_blocked(struct unwind_frame_info *, | ||
struct task_struct *); | ||
|
||
/* | ||
* Prepare to unwind the currently running thread. | ||
*/ | ||
extern int unwind_init_running(struct unwind_frame_info *, | ||
asmlinkage void (*callback)(struct unwind_frame_info *, | ||
void *arg), | ||
void *arg); | ||
|
||
/* | ||
* Unwind to previous to frame. Returns 0 if successful, negative | ||
* number in case of an error. | ||
*/ | ||
extern int unwind(struct unwind_frame_info *); | ||
|
||
/* | ||
* Unwind until the return pointer is in user-land (or until an error | ||
* occurs). Returns 0 if successful, negative number in case of | ||
* error. | ||
*/ | ||
extern int unwind_to_user(struct unwind_frame_info *); | ||
|
||
#else | ||
|
||
struct unwind_frame_info {}; | ||
|
||
static inline void unwind_init(void) {} | ||
|
||
static inline void *unwind_add_table(struct module *mod, | ||
const void *table_start, | ||
unsigned long table_size) | ||
{ | ||
return NULL; | ||
} | ||
|
||
static inline void unwind_remove_table(void *handle, int init_only) | ||
{ | ||
} | ||
|
||
static inline int unwind_init_frame_info(struct unwind_frame_info *info, | ||
struct task_struct *tsk, | ||
const struct pt_regs *regs) | ||
{ | ||
return -ENOSYS; | ||
} | ||
|
||
static inline int unwind_init_blocked(struct unwind_frame_info *info, | ||
struct task_struct *tsk) | ||
{ | ||
return -ENOSYS; | ||
} | ||
|
||
static inline int unwind_init_running(struct unwind_frame_info *info, | ||
asmlinkage void (*cb)(struct unwind_frame_info *, | ||
void *arg), | ||
void *arg) | ||
{ | ||
return -ENOSYS; | ||
} | ||
|
||
static inline int unwind(struct unwind_frame_info *info) | ||
{ | ||
return -ENOSYS; | ||
} | ||
|
||
static inline int unwind_to_user(struct unwind_frame_info *info) | ||
{ | ||
return -ENOSYS; | ||
} | ||
|
||
#endif | ||
|
||
#endif /* _LINUX_UNWIND_H */ |
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
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
Oops, something went wrong.