[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160630230608.GS2279@X58A-UD3R>
Date: Fri, 1 Jul 2016 08:06:08 +0900
From: Byungchul Park <byungchul.park@....com>
To: xinhui <xinhui.pan@...ux.vnet.ibm.com>
Cc: peterz@...radead.org, mingo@...nel.org,
linux-kernel@...r.kernel.org, npiggin@...e.de, walken@...gle.com,
ak@...e.de
Subject: Re: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace
On Thu, Jun 30, 2016 at 06:38:47PM +0800, xinhui wrote:
> >>>>+static int save_stack_end(void *data)
> >>>>+{
> >>>>+ struct stack_trace *trace = data;
> >>>>+ return trace->nr_entries >= trace->max_entries;
> >>>>+}
> >>>>+
> >>>> static const struct stacktrace_ops save_stack_ops = {
> >>>> .stack = save_stack_stack,
> >>>> .address = save_stack_address,
> >>>then why not check the return value of ->address(), -1 indicate there is
> >>>no room to store any pointer.
> >>
> >>Hello,
> >>
> >>Indeed. It also looks good to me even though it has to propagate the condition
> >>between callback functions. I will modify it if it's better.
> >
> >Do you also think it would be better to make it propagate the result of
> >->address() rather than add a new callback, say, end_walk?
> >
> It's up to you. In my opinion, end_walk is better for reading.
I also prefer the way this patch works.
> >>
> >>Thank you.
> >>Byungchul
> >>
> >>>
> >>>> .walk_stack = print_context_stack,
> >>>>+ .end_walk = save_stack_end,
> >>>> };
> >>>>
> >>>> static const struct stacktrace_ops save_stack_ops_nosched = {
> >>>>
> >
Powered by blists - more mailing lists