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

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Byungchul Park <byungchul.park@lge.com>
Newsgroups linux.kernel
Subject Re: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace
Date Fri, 01 Jul 2016 01:10:01 +0200
Message-ID <rPTfP-7eS-1@gated-at.bofh.it> (permalink)
References <rLZMR-42g-3@gated-at.bofh.it> <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>
X-Original-To xinhui <xinhui.pan@linux.vnet.ibm.com>
X-Original-Senderip 156.147.1.127
X-Original-Mailfrom byungchul.park@lge.com
X-Original-Senderip 10.177.222.33
X-Original-Mailfrom byungchul.park@lge.com
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 37
Organization linux.* mail to news gateway
X-Original-Cc peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, npiggin@suse.de, walken@google.com, ak@suse.de
X-Original-Date Fri, 1 Jul 2016 08:06:08 +0900
X-Original-Message-ID <20160630230608.GS2279@X58A-UD3R>
X-Original-References <1466398527-1122-1-git-send-email-byungchul.park@lge.com> <1466398527-1122-13-git-send-email-byungchul.park@lge.com> <57679B57.40905@linux.vnet.ibm.com> <000101d1cac8$6f321c40$4d9654c0$@lge.com> <20160629124343.GQ2279@X58A-UD3R> <5774F6B7.5050200@linux.vnet.ibm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1434898

Show key headers only | 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