From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751894AbbJVFON (ORCPT ); Thu, 22 Oct 2015 01:14:13 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:35521 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbbJVFOL (ORCPT ); Thu, 22 Oct 2015 01:14:11 -0400 Date: Thu, 22 Oct 2015 13:14:07 +0800 From: Minfei Huang To: Steven Rostedt Cc: mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, mhuang@redhat.com Subject: Re: [REPOST PATCH] ftrace: Calculate the correct dyn_ftrace number to report to the userspace Message-ID: <20151022051407.GA9292@t420s.redhat.com> References: <1442420382-13130-1-git-send-email-mnfhuang@gmail.com> <20151015222545.45a22b7e@grimm.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151015222545.45a22b7e@grimm.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/15/15 at 10:25pm, Steven Rostedt wrote: > On Thu, 17 Sep 2015 00:19:42 +0800 > Minfei Huang wrote: > > > Now, ftrace only calculate the dyn_ftrace number in the adding > > breakpoint loop, not in adding update and finish update loop. > > > > Calculate the correct dyn_ftrace, once ftrace reports the failure message > > to the userspace. > > > > Bah, your emails got lost in my Inbox. Sorry about that. > > I'll make an effort to look at this first thing tomorrow. Ping. Any comment is appreciate. Thanks Minfei > > [ Cc'ing myself to remind me ] > > -- Steve > > > Signed-off-by: Minfei Huang > > --- > > arch/x86/kernel/ftrace.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c > > index 8b7b0a5..311bcf3 100644 > > --- a/arch/x86/kernel/ftrace.c > > +++ b/arch/x86/kernel/ftrace.c > > @@ -556,6 +556,7 @@ void ftrace_replace_code(int enable) > > run_sync(); > > > > report = "updating code"; > > + count = 0; > > > > for_ftrace_rec_iter(iter) { > > rec = ftrace_rec_iter_record(iter); > > @@ -563,11 +564,13 @@ void ftrace_replace_code(int enable) > > ret = add_update(rec, enable); > > if (ret) > > goto remove_breakpoints; > > + count++; > > } > > > > run_sync(); > > > > report = "removing breakpoints"; > > + count = 0; > > > > for_ftrace_rec_iter(iter) { > > rec = ftrace_rec_iter_record(iter); > > @@ -575,6 +578,7 @@ void ftrace_replace_code(int enable) > > ret = finish_update(rec, enable); > > if (ret) > > goto remove_breakpoints; > > + count++; > > } > > > > run_sync(); >