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.
[S390] perf: add DWARF register lookup for s390
Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ifndef NO_DWARF | ||
PERF_HAVE_DWARF_REGS := 1 | ||
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Mapping of DWARF debug register numbers into register names. | ||
* | ||
* Copyright IBM Corp. 2010 | ||
* Author(s): Heiko Carstens <[email protected]>, | ||
* | ||
*/ | ||
|
||
#include <libio.h> | ||
#include <dwarf-regs.h> | ||
|
||
#define NUM_GPRS 16 | ||
|
||
static const char *gpr_names[NUM_GPRS] = { | ||
"%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", | ||
"%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", | ||
}; | ||
|
||
const char *get_arch_regstr(unsigned int n) | ||
{ | ||
return (n >= NUM_GPRS) ? NULL : gpr_names[n]; | ||
} |