Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753167AbbGQDUu (ORCPT ); Thu, 16 Jul 2015 23:20:50 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.229]:18249 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751829AbbGQDUs (ORCPT ); Thu, 16 Jul 2015 23:20:48 -0400 Date: Thu, 16 Jul 2015 23:21:28 -0400 From: Steven Rostedt To: AKASHI Takahiro Cc: Jungseok Lee , catalin.marinas@arm.com, will.deacon@arm.com, olof@lixom.net, broonie@kernel.org, david.griego@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC 2/3] arm64: refactor save_stack_trace() Message-ID: <20150716232128.1a887a9f@grimm.local.home> In-Reply-To: <55A86D50.9060407@linaro.org> References: <1436765375-7119-1-git-send-email-takahiro.akashi@linaro.org> <1436765375-7119-3-git-send-email-takahiro.akashi@linaro.org> <20150714093154.4d73e551@gandalf.local.home> <55A5A75A.1060401@linaro.org> <20150714225105.6c1e4f15@gandalf.local.home> <55A646EE.6030402@linaro.org> <20150715105536.42949ea9@gandalf.local.home> <20150715121337.3b31aa84@gandalf.local.home> <55A6FA82.9000901@linaro.org> <55A703F3.8050203@linaro.org> <20150716102405.2cc8c406@gandalf.local.home> <12F47692-3010-4886-B87D-3D7820609177@gmail.com> <20150716113115.45a17f17@gandalf.local.home> <5176E676-1AAA-4F2B-827B-BEF3A2620D86@gmail.com> <20150716162255.0beedc76@gandalf.local.home> <55A86D50.9060407@linaro.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1756 Lines: 55 On Fri, 17 Jul 2015 11:49:52 +0900 AKASHI Takahiro wrote: > > - > > - if (using_ftrace_ops_list_func()) > > - max_stack_trace.skip = 4; > > - else > > - max_stack_trace.skip = 3; > > + max_stack_trace.skip = 3; > > I don't think this last line is necessary because we will skip all > the functions anyway below: I put this back more as an optimization as it is already known that it takes at least three calls to get to this point. Unless of course gcc decides to inline them. But currently I don't see that. > > > save_stack_trace(&max_stack_trace); > > > > - /* > > - * Add the passed in ip from the function tracer. > > - * Searching for this on the stack will skip over > > - * most of the overhead from the stack tracer itself. > > - */ > > - stack_dump_trace[0] = ip; > > - max_stack_trace.nr_entries++; > > + /* Skip over the overhead of the stack tracer itself */ > > + for (i = 0; i < max_stack_trace.nr_entries; i++) { > > + if (stack_dump_trace[i] == ip) > > + break; > > + } > > here. Now "i" indicates the start point, excepting tracer functions, > and "x" will eventually represent the exact number of functions > that we are interested in after searching the stack. > > To calc "stack_max_size" correctly, we should change the line: > if (unlikely(tracer_frame) && i == 1) { > to > if (unlikely(tracer_frame)) { Good catch, I'll fix that! -- Steve > > With these two changes applied, the issues Jungseok mentioned will be > fixed. > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/