]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
s390/perf: add perf register support for floating-point registers
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Wed, 8 Nov 2017 08:17:38 +0000 (09:17 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 16 Nov 2017 14:06:15 +0000 (15:06 +0100)
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>
tools/perf/arch/s390/include/perf_regs.h
tools/perf/arch/s390/util/unwind-libdw.c

index ac4b8c8c49e2219bc381c97add79ec19089c78da..d2df54a6bc5a24a588ca3153833623ca0ecaa1c3 100644 (file)
@@ -49,6 +49,38 @@ static inline const char *perf_reg_name(int id)
                return "R14";
        case PERF_REG_S390_R15:
                return "R15";
+       case PERF_REG_S390_FP0:
+               return "FP0";
+       case PERF_REG_S390_FP1:
+               return "FP1";
+       case PERF_REG_S390_FP2:
+               return "FP2";
+       case PERF_REG_S390_FP3:
+               return "FP3";
+       case PERF_REG_S390_FP4:
+               return "FP4";
+       case PERF_REG_S390_FP5:
+               return "FP5";
+       case PERF_REG_S390_FP6:
+               return "FP6";
+       case PERF_REG_S390_FP7:
+               return "FP7";
+       case PERF_REG_S390_FP8:
+               return "FP8";
+       case PERF_REG_S390_FP9:
+               return "FP9";
+       case PERF_REG_S390_FP10:
+               return "FP10";
+       case PERF_REG_S390_FP11:
+               return "FP11";
+       case PERF_REG_S390_FP12:
+               return "FP12";
+       case PERF_REG_S390_FP13:
+               return "FP13";
+       case PERF_REG_S390_FP14:
+               return "FP14";
+       case PERF_REG_S390_FP15:
+               return "FP15";
        case PERF_REG_S390_MASK:
                return "MASK";
        case PERF_REG_S390_PC:
index ba8d98b8b09efe7409382df8ac45d6ccc39c95e2..387c698cdd1beace011c539c212ebb2374ec8237 100644 (file)
@@ -37,9 +37,27 @@ bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg)
        dwarf_regs[13] = REG(R13);
        dwarf_regs[14] = REG(R14);
        dwarf_regs[15] = REG(R15);
+
+       dwarf_regs[16] = REG(FP0);
+       dwarf_regs[17] = REG(FP2);
+       dwarf_regs[18] = REG(FP4);
+       dwarf_regs[19] = REG(FP6);
+       dwarf_regs[20] = REG(FP1);
+       dwarf_regs[21] = REG(FP3);
+       dwarf_regs[22] = REG(FP5);
+       dwarf_regs[23] = REG(FP7);
+       dwarf_regs[24] = REG(FP8);
+       dwarf_regs[25] = REG(FP10);
+       dwarf_regs[26] = REG(FP12);
+       dwarf_regs[27] = REG(FP14);
+       dwarf_regs[28] = REG(FP9);
+       dwarf_regs[29] = REG(FP11);
+       dwarf_regs[30] = REG(FP13);
+       dwarf_regs[31] = REG(FP15);
+
        dwarf_regs[64] = REG(MASK);
        dwarf_regs[65] = REG(PC);
 
        dwfl_thread_state_register_pc(thread, dwarf_regs[65]);
-       return dwfl_thread_state_registers(thread, 0, 16, dwarf_regs);
+       return dwfl_thread_state_registers(thread, 0, 32, dwarf_regs);
 }