diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-04 18:59:17 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-05 23:24:21 -0500 |
commit | c13fbb7de2fc4fd61a44ebfa4ba182f35e0a3286 (patch) | |
tree | f72bdce818a9e89c7ed3c82692c19c233061172e /fs/bcachefs/util.c | |
parent | 074cbcdaeee433a02d6d0565b936bee0915cc5da (diff) | |
download | linux-c13fbb7de2fc4fd61a44ebfa4ba182f35e0a3286.tar.gz linux-c13fbb7de2fc4fd61a44ebfa4ba182f35e0a3286.tar.bz2 linux-c13fbb7de2fc4fd61a44ebfa4ba182f35e0a3286.zip |
bcachefs: Improve would_deadlock trace event
We now include backtraces for every thread involved in the cycle.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/util.c')
-rw-r--r-- | fs/bcachefs/util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 2e4c5d9606de..c2ef7cddaa4f 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -267,7 +267,7 @@ void bch2_print_string_as_lines(const char *prefix, const char *lines) console_unlock(); } -int bch2_save_backtrace(bch_stacktrace *stack, struct task_struct *task) +int bch2_save_backtrace(bch_stacktrace *stack, struct task_struct *task, unsigned skipnr) { #ifdef CONFIG_STACKTRACE unsigned nr_entries = 0; @@ -282,7 +282,7 @@ int bch2_save_backtrace(bch_stacktrace *stack, struct task_struct *task) return -1; do { - nr_entries = stack_trace_save_tsk(task, stack->data, stack->size, 0); + nr_entries = stack_trace_save_tsk(task, stack->data, stack->size, skipnr + 1); } while (nr_entries == stack->size && !(ret = darray_make_room(stack, stack->size * 2))); @@ -303,10 +303,10 @@ void bch2_prt_backtrace(struct printbuf *out, bch_stacktrace *stack) } } -int bch2_prt_task_backtrace(struct printbuf *out, struct task_struct *task) +int bch2_prt_task_backtrace(struct printbuf *out, struct task_struct *task, unsigned skipnr) { bch_stacktrace stack = { 0 }; - int ret = bch2_save_backtrace(&stack, task); + int ret = bch2_save_backtrace(&stack, task, skipnr + 1); bch2_prt_backtrace(out, &stack); darray_exit(&stack); |