lkml.org 
[lkml]   [2019]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC patch 29/41] btrfs: ref-verify: Simplify stack trace retrieval
On Wed, 10 Apr 2019, Johannes Thumshirn wrote:

> On Wed, Apr 10, 2019 at 12:28:23PM +0200, Thomas Gleixner wrote:
> > Replace the indirection through struct stack_trace with an invocation of
> > the storage array based interface.
> >
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Cc: David Sterba <dsterba@suse.com>
> > Cc: Chris Mason <clm@fb.com>
> > Cc: Josef Bacik <josef@toxicpanda.com>
> > Cc: linux-btrfs@vger.kernel.org
> > ---
> > fs/btrfs/ref-verify.c | 15 ++-------------
> > 1 file changed, 2 insertions(+), 13 deletions(-)
> >
> > --- a/fs/btrfs/ref-verify.c
> > +++ b/fs/btrfs/ref-verify.c
> > @@ -205,28 +205,17 @@ static struct root_entry *lookup_root_en
> > #ifdef CONFIG_STACKTRACE
> > static void __save_stack_trace(struct ref_action *ra)
> > {
> > - struct stack_trace stack_trace;
> > -
> > - stack_trace.max_entries = MAX_TRACE;
> > - stack_trace.nr_entries = 0;
> > - stack_trace.entries = ra->trace;
> > - stack_trace.skip = 2;
> > - save_stack_trace(&stack_trace);
> > - ra->trace_len = stack_trace.nr_entries;
> > + ra->trace_len = stack_trace_save(ra->trace, MAX_TRACE, 2);
>
>
> Stupid question: why are you passing a '2' for 'skipnr' and in
> stack_trace_save() from your series you set stack_trace::skip as skipnr + 1.
>
> Wouldn't this result in a stack_trace::skip = 3? Or is it the number of
> functions to be skipped and you don't want to have stack_trace_save() saved as
> well?

Correct. The extra call will shift the skipped one up, so I compensate for that.

Thanks,

tglx

\
 
 \ /
  Last update: 2019-04-10 14:07    [W:0.170 / U:0.472 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site