Skip to content

Commit

Permalink
core/stack: Convert stack check code to not use backtrace wrapper
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
ajdlinux authored and stewartsmith committed Mar 28, 2019
1 parent 8dddd75 commit e5a7411
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions core/stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e5a7411

Please sign in to comment.