aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2017-11-08 03:17:38 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2017-11-16 09:06:15 -0500
commitde9954b75e992d26a67d83990e6219dcb6edc3bf (patch)
treeb3f83b1ce69110268dc4965e47c487bc5325b625 /tools/perf
parent0da0017f72554c005c1a04c3adc5da9eb64fa7e5 (diff)
s390/perf: add perf register support for floating-point registers
For correct unwinding of user space processes, the floating-point register contents are required. For example, leaf functions might use fp registers to temporarily store the return address. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Reviewed-and-tested-by: Thomas Richter <tmricht@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/arch/s390/include/perf_regs.h32
-rw-r--r--tools/perf/arch/s390/util/unwind-libdw.c20
2 files changed, 51 insertions, 1 deletions
diff --git a/tools/perf/arch/s390/include/perf_regs.h b/tools/perf/arch/s390/include/perf_regs.h
index ac4b8c8c49e2..d2df54a6bc5a 100644
--- a/tools/perf/arch/s390/include/perf_regs.h
+++ b/tools/perf/arch/s390/include/perf_regs.h
@@ -49,6 +49,38 @@ static inline const char *perf_reg_name(int id)
49 return "R14"; 49 return "R14";
50 case PERF_REG_S390_R15: 50 case PERF_REG_S390_R15:
51 return "R15"; 51 return "R15";
52 case PERF_REG_S390_FP0:
53 return "FP0";
54 case PERF_REG_S390_FP1:
55 return "FP1";
56 case PERF_REG_S390_FP2:
57 return "FP2";
58 case PERF_REG_S390_FP3:
59 return "FP3";
60 case PERF_REG_S390_FP4:
61 return "FP4";
62 case PERF_REG_S390_FP5:
63 return "FP5";
64 case PERF_REG_S390_FP6:
65 return "FP6";
66 case PERF_REG_S390_FP7:
67 return "FP7";
68 case PERF_REG_S390_FP8:
69 return "FP8";
70 case PERF_REG_S390_FP9:
71 return "FP9";
72 case PERF_REG_S390_FP10:
73 return "FP10";
74 case PERF_REG_S390_FP11:
75 return "FP11";
76 case PERF_REG_S390_FP12:
77 return "FP12";
78 case PERF_REG_S390_FP13:
79 return "FP13";
80 case PERF_REG_S390_FP14:
81 return "FP14";
82 case PERF_REG_S390_FP15:
83 return "FP15";
52 case PERF_REG_S390_MASK: 84 case PERF_REG_S390_MASK:
53 return "MASK"; 85 return "MASK";
54 case PERF_REG_S390_PC: 86 case PERF_REG_S390_PC:
diff --git a/tools/perf/arch/s390/util/unwind-libdw.c b/tools/perf/arch/s390/util/unwind-libdw.c
index ba8d98b8b09e..387c698cdd1b 100644
--- a/tools/perf/arch/s390/util/unwind-libdw.c
+++ b/tools/perf/arch/s390/util/unwind-libdw.c
@@ -37,9 +37,27 @@ bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg)
37 dwarf_regs[13] = REG(R13); 37 dwarf_regs[13] = REG(R13);
38 dwarf_regs[14] = REG(R14); 38 dwarf_regs[14] = REG(R14);
39 dwarf_regs[15] = REG(R15); 39 dwarf_regs[15] = REG(R15);
40
41 dwarf_regs[16] = REG(FP0);
42 dwarf_regs[17] = REG(FP2);
43 dwarf_regs[18] = REG(FP4);
44 dwarf_regs[19] = REG(FP6);
45 dwarf_regs[20] = REG(FP1);
46 dwarf_regs[21] = REG(FP3);
47 dwarf_regs[22] = REG(FP5);
48 dwarf_regs[23] = REG(FP7);
49 dwarf_regs[24] = REG(FP8);
50 dwarf_regs[25] = REG(FP10);
51 dwarf_regs[26] = REG(FP12);
52 dwarf_regs[27] = REG(FP14);
53 dwarf_regs[28] = REG(FP9);
54 dwarf_regs[29] = REG(FP11);
55 dwarf_regs[30] = REG(FP13);
56 dwarf_regs[31] = REG(FP15);
57
40 dwarf_regs[64] = REG(MASK); 58 dwarf_regs[64] = REG(MASK);
41 dwarf_regs[65] = REG(PC); 59 dwarf_regs[65] = REG(PC);
42 60
43 dwfl_thread_state_register_pc(thread, dwarf_regs[65]); 61 dwfl_thread_state_register_pc(thread, dwarf_regs[65]);
44 return dwfl_thread_state_registers(thread, 0, 16, dwarf_regs); 62 return dwfl_thread_state_registers(thread, 0, 32, dwarf_regs);
45} 63}