hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/s390/oprofile/init.c
....@@ -13,23 +13,17 @@
1313 #include <linux/oprofile.h>
1414 #include <linux/init.h>
1515 #include <asm/processor.h>
16
-
17
-static int __s390_backtrace(void *data, unsigned long address, int reliable)
18
-{
19
- unsigned int *depth = data;
20
-
21
- if (*depth == 0)
22
- return 1;
23
- (*depth)--;
24
- oprofile_add_trace(address);
25
- return 0;
26
-}
16
+#include <asm/unwind.h>
2717
2818 static void s390_backtrace(struct pt_regs *regs, unsigned int depth)
2919 {
30
- if (user_mode(regs))
31
- return;
32
- dump_trace(__s390_backtrace, &depth, NULL, regs->gprs[15]);
20
+ struct unwind_state state;
21
+
22
+ unwind_for_each_frame(&state, current, regs, 0) {
23
+ if (depth-- == 0)
24
+ break;
25
+ oprofile_add_trace(state.ip);
26
+ }
3327 }
3428
3529 int __init oprofile_arch_init(struct oprofile_operations *ops)