diff mbox series

[5/7] core/stack: Convert stack check code to not use backtrace wrapper

Message ID 20190318042900.32558-5-andrew.donnellan@au1.ibm.com
State Accepted
Headers show
Series [1/7] core/stack: Remove r1 argument from ___backtrace() | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (2ba5ce84a197ee61423355f443a3ff3eea185ff1)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Andrew Donnellan March 18, 2019, 4:28 a.m. UTC
We're about to get rid of __backtrace() and __print_backtrace(), convert
the stack check code to not use them.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

---

Someone wanna review this to make sure I haven't subtly broken it?
---
 core/stack.c  | 10 +++++-----
 include/cpu.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/core/stack.c b/core/stack.c
index f7eca1ffb0ff..2e47cd4dbd4a 100644
--- a/core/stack.c
+++ b/core/stack.c
@@ -175,13 +175,12 @@  void __nomcount __mcount_stack_check(uint64_t sp, uint64_t lr)
 
 	/* Capture lowest stack for this thread */
 	if (mark < c->stack_bot_mark) {
-		unsigned int count = CPU_BACKTRACE_SIZE;
 		lock(&stack_check_lock);
 		c->stack_bot_mark = mark;
 		c->stack_bot_pc = lr;
 		c->stack_bot_tok = c->current_token;
-		__backtrace(c->stack_bot_bt, &count);
-		c->stack_bot_bt_count = count;
+		backtrace_create(c->stack_bot_bt, CPU_BACKTRACE_SIZE,
+				 &c->stack_bot_bt_metadata);
 		unlock(&stack_check_lock);
 	}
 
@@ -232,8 +231,9 @@  void check_stacks(void)
 		      " pc=%08llx token=%lld\n",
 		      lowest->pir, lowest->stack_bot_mark, lowest->stack_bot_pc,
 		      lowest->stack_bot_tok);
-		__print_backtrace(lowest->pir, lowest->stack_bot_bt,
-				  lowest->stack_bot_bt_count, NULL, NULL, true);
+		backtrace_print(lowest->stack_bot_bt,
+				&lowest->stack_bot_bt_metadata,
+				NULL, NULL, true);
 		unlock(&stack_check_lock);
 	}
 
diff --git a/include/cpu.h b/include/cpu.h
index 06d5c0d11229..39071a191793 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -81,7 +81,7 @@  struct cpu_thread {
 	uint64_t			stack_bot_tok;
 #define CPU_BACKTRACE_SIZE	60
 	struct bt_entry			stack_bot_bt[CPU_BACKTRACE_SIZE];
-	unsigned int			stack_bot_bt_count;
+	struct bt_metadata		stack_bot_bt_metadata;
 #endif
 	struct lock			job_lock;
 	struct list_head		job_queue;