Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1434898

Re: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace

From Byungchul Park <byungchul.park@lge.com>
Newsgroups linux.kernel
Subject Re: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace
Date 2016-07-01 01:10 +0200
Message-ID <rPTfP-7eS-1@gated-at.bofh.it> (permalink)
References (1 earlier) <rLZMS-42g-27@gated-at.bofh.it> <rM1OF-5eM-23@gated-at.bofh.it> <rM2hH-5qN-7@gated-at.bofh.it> <rPn6h-4ei-13@gated-at.bofh.it> <rPHy1-8rT-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 = {
> >>>>
> >

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace Byungchul Park <byungchul.park@lge.com> - 2016-06-29 14:50 +0200
  Re: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-30 12:40 +0200
    Re: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace Byungchul Park <byungchul.park@lge.com> - 2016-07-01 01:10 +0200

csiph-web