From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754090AbdEPSeH (ORCPT ); Tue, 16 May 2017 14:34:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:32948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbdEPSeB (ORCPT ); Tue, 16 May 2017 14:34:01 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA2E9239CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 16 May 2017 14:33:58 -0400 From: Steven Rostedt To: "Naveen N. Rao" Cc: Shuah Khan , Michael Ellerman , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 2/4] ftrace/instances: Clear function triggers when removing instances Message-ID: <20170516143358.49b64ed5@gandalf.local.home> In-Reply-To: <20170516174423.GF19390@naverao1-tp.localdomain> References: <437c3409d58c2ab065233df57d82425a90c5e9e1.1494702964.git.naveen.n.rao@linux.vnet.ibm.com> <20170515222000.5ea978e6@grimm.local.home> <20170516140109.GC19390@naverao1-tp.localdomain> <20170516174423.GF19390@naverao1-tp.localdomain> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 May 2017 23:14:23 +0530 "Naveen N. Rao" wrote: > On 2017/05/16 07:31PM, Naveen N. Rao wrote: > > On 2017/05/15 10:20PM, Steven Rostedt wrote: > > > On Sun, 14 May 2017 01:01:02 +0530 > > > "Naveen N. Rao" wrote: > > > > > > > [snip] > > > > > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > > > > index c4536c449021..3f2aed4ad1ed 100644 > > > > --- a/kernel/trace/trace.c > > > > +++ b/kernel/trace/trace.c > > > > @@ -7550,6 +7550,7 @@ static int instance_rmdir(const char *name) > > > > } > > > > > > > > tracing_set_nop(tr); > > > > + clear_ftrace_function_probes(tr); > > > > event_trace_del_tracer(tr); > > > > ftrace_clear_pids(tr); > > > > ftrace_destroy_function_files(tr); > > > > diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h > > > > index 291a1bca5748..98e0845f7235 100644 > > > > --- a/kernel/trace/trace.h > > > > +++ b/kernel/trace/trace.h > > > > @@ -980,6 +980,7 @@ register_ftrace_function_probe(char *glob, struct trace_array *tr, > > > > extern int > > > > unregister_ftrace_function_probe_func(char *glob, struct trace_array *tr, > > > > struct ftrace_probe_ops *ops); > > > > +extern void clear_ftrace_function_probes(struct trace_array *tr); > > > > > > This needs to have a stub function when CONFIG_DYNAMIC_FTRACE is not > > > defined. Otherwise we have: > > > > > > kernel/trace/trace.c:7553:2: error: implicit declaration of function 'clear_ftrace_function_probes' [-Werror=implicit-function-declaration] > > > clear_ftrace_function_probes(tr); > > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > The prototype in trace.h is actually guarded by: > #if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_DYNAMIC_FTRACE) > > So, I will guard the call to clear_ftrace_function_probes() in trace.c > with the same. > No, the proper thing to do is to make a stub function in the else part of the #if that the prototype was declared in. static inline void clear_ftrace_function_probes(struct trace_array *tr) { } Please, lets limit the #ifdef ugliness from the code. -- Steve