All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Yisheng Xie <xieyisheng1@huawei.com>
Cc: <mingo@redhat.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH resend v2] ftrace: nuke clear_ftrace_function
Date: Wed, 9 May 2018 08:56:43 -0400	[thread overview]
Message-ID: <20180509085643.4001dc9c@gandalf.local.home> (raw)
In-Reply-To: <1525858436-10900-1-git-send-email-xieyisheng1@huawei.com>

On Wed, 9 May 2018 17:33:56 +0800
Yisheng Xie <xieyisheng1@huawei.com> wrote:

> clear_ftrace_function is not used outside of ftrace.c and is not help to
> use a function, so nuke it per Steve's suggestion.
> 
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
> ---
> v2:
>  - nuke clear_ftrace_function instead of use it - per Steve
> 
> v1:
>  - https://lkml.org/lkml/2018/1/29/944
> 
>  include/linux/ftrace.h |  2 --
>  kernel/trace/ftrace.c  | 13 +------------
>  2 files changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
> index 9c3c9a3..15518b5 100644
> --- a/include/linux/ftrace.h
> +++ b/include/linux/ftrace.h
> @@ -223,7 +223,6 @@ enum ftrace_tracing_type_t {
>   */
>  int register_ftrace_function(struct ftrace_ops *ops);
>  int unregister_ftrace_function(struct ftrace_ops *ops);
> -void clear_ftrace_function(void);
>  
>  extern void ftrace_stub(unsigned long a0, unsigned long a1,
>  			struct ftrace_ops *op, struct pt_regs *regs);
> @@ -239,7 +238,6 @@ static inline int ftrace_nr_registered_ops(void)
>  {
>  	return 0;
>  }
> -static inline void clear_ftrace_function(void) { }
>  static inline void ftrace_kill(void) { }
>  static inline void ftrace_free_init_mem(void) { }
>  static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { }
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 8d83bcf..d4984f4 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -192,17 +192,6 @@ static void ftrace_pid_func(unsigned long ip, unsigned long parent_ip,
>  	op->saved_func(ip, parent_ip, op, regs);
>  }
>  
> -/**
> - * clear_ftrace_function - reset the ftrace function
> - *
> - * This NULLs the ftrace function and in essence stops
> - * tracing.  There may be lag
> - */

I agree that the function should be removed, but the comment is still
relevant.

> -void clear_ftrace_function(void)
> -{
> -	ftrace_trace_function = ftrace_stub;
> -}
> -
>  static void ftrace_sync(struct work_struct *work)
>  {
>  	/*
> @@ -6689,7 +6678,7 @@ void ftrace_kill(void)
>  {
>  	ftrace_disabled = 1;
>  	ftrace_enabled = 0;
> -	clear_ftrace_function();

	/* This will stop tracing, but there may be a lag */

-- Steve

> +	ftrace_trace_function = ftrace_stub;
>  }
>  
>  /**

  reply	other threads:[~2018-05-09 12:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09  9:33 [PATCH resend v2] ftrace: nuke clear_ftrace_function Yisheng Xie
2018-05-09 12:56 ` Steven Rostedt [this message]
2018-05-10  0:17   ` [PATCH v3] " Yisheng Xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180509085643.4001dc9c@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=xieyisheng1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.