-
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.
This follows the x86/ppc changes for kprobe-based event tracing on sh. While kprobes is only supported on 32-bit sh, we provide the API for HAVE_REGS_AND_STACK_ACCESS_API for both 32 and 64-bit. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
- Loading branch information
Paul Mundt
committed
Jun 14, 2010
1 parent
9973e38
commit eaaaeef
Showing
9 changed files
with
227 additions
and
11 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
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
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,33 @@ | ||
#include <linux/ptrace.h> | ||
|
||
/** | ||
* regs_query_register_offset() - query register offset from its name | ||
* @name: the name of a register | ||
* | ||
* regs_query_register_offset() returns the offset of a register in struct | ||
* pt_regs from its name. If the name is invalid, this returns -EINVAL; | ||
*/ | ||
int regs_query_register_offset(const char *name) | ||
{ | ||
const struct pt_regs_offset *roff; | ||
for (roff = regoffset_table; roff->name != NULL; roff++) | ||
if (!strcmp(roff->name, name)) | ||
return roff->offset; | ||
return -EINVAL; | ||
} | ||
|
||
/** | ||
* regs_query_register_name() - query register name from its offset | ||
* @offset: the offset of a register in struct pt_regs. | ||
* | ||
* regs_query_register_name() returns the name of a register from its | ||
* offset in struct pt_regs. If the @offset is invalid, this returns NULL; | ||
*/ | ||
const char *regs_query_register_name(unsigned int offset) | ||
{ | ||
const struct pt_regs_offset *roff; | ||
for (roff = regoffset_table; roff->name != NULL; roff++) | ||
if (roff->offset == offset) | ||
return roff->name; | ||
return NULL; | ||
} |
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