linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] tracing: doc: cleanup typo and unused code
@ 2018-07-26 12:43 Masami Hiramatsu
  2018-07-26 12:43 ` [PATCH 1/3] doc: tracing: Fix a typo of trace_stat Masami Hiramatsu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2018-07-26 12:43 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Ingo Molnar, Masami Hiramatsu, linux-kernel

Hi,

Here are tracing related patches to fix a typo in document and
remove unused functions which I found when improving ftracetest.

Note that those are not bug, just cleanup the source code,
so I don't forward it to stable-ML.

Thank you,

---

Masami Hiramatsu (3):
      doc: tracing: Fix a typo of trace_stat
      tracing: Remove orphaned function using_ftrace_ops_list_func().
      tracing: Remove orphaned function ftrace_nr_registered_ops()


 0 files changed

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] doc: tracing: Fix a typo of trace_stat
  2018-07-26 12:43 [PATCH 0/3] tracing: doc: cleanup typo and unused code Masami Hiramatsu
@ 2018-07-26 12:43 ` Masami Hiramatsu
  2018-07-26 14:51   ` Steven Rostedt
  2018-07-26 12:44 ` [PATCH 2/3] tracing: Remove orphaned function using_ftrace_ops_list_func() Masami Hiramatsu
  2018-07-26 12:44 ` [PATCH 3/3] tracing: Remove orphaned function ftrace_nr_registered_ops() Masami Hiramatsu
  2 siblings, 1 reply; 6+ messages in thread
From: Masami Hiramatsu @ 2018-07-26 12:43 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Ingo Molnar, Masami Hiramatsu, linux-kernel, Jonathan Corbet, linux-doc

The name of the directory for per-cpu function statistics
is trace_stat, not trace_stats.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
---
 0 files changed

diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
index a20d34955333..7ea16a0ceffc 100644
--- a/Documentation/trace/ftrace.rst
+++ b/Documentation/trace/ftrace.rst
@@ -329,9 +329,9 @@ of ftrace. Here is a list of some of the key files:
 	track of the time spent in those functions. The histogram
 	content can be displayed in the files:
 
-	trace_stats/function<cpu> ( function0, function1, etc).
+	trace_stat/function<cpu> ( function0, function1, etc).
 
-  trace_stats:
+  trace_stat:
 
 	A directory that holds different tracing stats.
 
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index dcc0166d1997..a47f77d27673 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -521,7 +521,7 @@ config FUNCTION_PROFILER
 	  in debugfs called function_profile_enabled which defaults to zero.
 	  When a 1 is echoed into this file profiling begins, and when a
 	  zero is entered, profiling stops. A "functions" file is created in
-	  the trace_stats directory; this file shows the list of functions that
+	  the trace_stat directory; this file shows the list of functions that
 	  have been hit and their counters.
 
 	  If in doubt, say N.


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] tracing: Remove orphaned function using_ftrace_ops_list_func().
  2018-07-26 12:43 [PATCH 0/3] tracing: doc: cleanup typo and unused code Masami Hiramatsu
  2018-07-26 12:43 ` [PATCH 1/3] doc: tracing: Fix a typo of trace_stat Masami Hiramatsu
@ 2018-07-26 12:44 ` Masami Hiramatsu
  2018-07-26 12:44 ` [PATCH 3/3] tracing: Remove orphaned function ftrace_nr_registered_ops() Masami Hiramatsu
  2 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2018-07-26 12:44 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Ingo Molnar, Masami Hiramatsu, linux-kernel

Remove using_ftrace_ops_list_func() since it is no more
used.

using_ftrace_ops_list_func() has been introduced by commit
7eea4fce0246 ("tracing/stack_trace: Skip 4 instead of 3
when using ftrace_ops_list_func") as a helper function,
but its caller has been removed by commit 72ac426a5bb0
("tracing: Clean up stack tracing and fix fentry updates").
So it is not called anymore.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 0 files changed

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index caf9cbf35816..b8b3324ca1c8 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -313,11 +313,6 @@ static void update_ftrace_function(void)
 	ftrace_trace_function = func;
 }
 
-int using_ftrace_ops_list_func(void)
-{
-	return ftrace_trace_function == ftrace_ops_list_func;
-}
-
 static void add_ftrace_ops(struct ftrace_ops __rcu **list,
 			   struct ftrace_ops *ops)
 {
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index f8f86231ad90..a5d27d7943e7 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -937,7 +937,6 @@ void ftrace_destroy_function_files(struct trace_array *tr);
 void ftrace_init_global_array_ops(struct trace_array *tr);
 void ftrace_init_array_ops(struct trace_array *tr, ftrace_func_t func);
 void ftrace_reset_array_ops(struct trace_array *tr);
-int using_ftrace_ops_list_func(void);
 void ftrace_init_tracefs(struct trace_array *tr, struct dentry *d_tracer);
 void ftrace_init_tracefs_toplevel(struct trace_array *tr,
 				  struct dentry *d_tracer);


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] tracing: Remove orphaned function ftrace_nr_registered_ops()
  2018-07-26 12:43 [PATCH 0/3] tracing: doc: cleanup typo and unused code Masami Hiramatsu
  2018-07-26 12:43 ` [PATCH 1/3] doc: tracing: Fix a typo of trace_stat Masami Hiramatsu
  2018-07-26 12:44 ` [PATCH 2/3] tracing: Remove orphaned function using_ftrace_ops_list_func() Masami Hiramatsu
@ 2018-07-26 12:44 ` Masami Hiramatsu
  2 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2018-07-26 12:44 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Ingo Molnar, Masami Hiramatsu, linux-kernel

Remove ftrace_nr_registered_ops() because it is no more used.

ftrace_nr_registered_ops() has been introduced by commit
ea701f11da44 ("ftrace: Add selftest to test function trace
recursion protection"), but its caller has been removed by
commit 05cbbf643b8e ("tracing: Fix selftest function
recursion accounting"). So it is not called anymore.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 0 files changed

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index ebb77674be90..63af5eb0ff46 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -234,10 +234,6 @@ extern void ftrace_stub(unsigned long a0, unsigned long a1,
  */
 #define register_ftrace_function(ops) ({ 0; })
 #define unregister_ftrace_function(ops) ({ 0; })
-static inline int ftrace_nr_registered_ops(void)
-{
-	return 0;
-}
 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) { }
@@ -328,8 +324,6 @@ struct seq_file;
 
 extern int ftrace_text_reserved(const void *start, const void *end);
 
-extern int ftrace_nr_registered_ops(void);
-
 struct ftrace_ops *ftrace_ops_trampoline(unsigned long addr);
 
 bool is_ftrace_trampoline(unsigned long addr);
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index b8b3324ca1c8..0d380a98a880 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -157,30 +157,6 @@ static inline void ftrace_ops_init(struct ftrace_ops *ops)
 #endif
 }
 
-/**
- * ftrace_nr_registered_ops - return number of ops registered
- *
- * Returns the number of ftrace_ops registered and tracing functions
- */
-int ftrace_nr_registered_ops(void)
-{
-	struct ftrace_ops *ops;
-	int cnt = 0;
-
-	mutex_lock(&ftrace_lock);
-
-	for (ops = rcu_dereference_protected(ftrace_ops_list,
-					     lockdep_is_held(&ftrace_lock));
-	     ops != &ftrace_list_end;
-	     ops = rcu_dereference_protected(ops->next,
-					     lockdep_is_held(&ftrace_lock)))
-		cnt++;
-
-	mutex_unlock(&ftrace_lock);
-
-	return cnt;
-}
-
 static void ftrace_pid_func(unsigned long ip, unsigned long parent_ip,
 			    struct ftrace_ops *op, struct pt_regs *regs)
 {


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] doc: tracing: Fix a typo of trace_stat
  2018-07-26 12:43 ` [PATCH 1/3] doc: tracing: Fix a typo of trace_stat Masami Hiramatsu
@ 2018-07-26 14:51   ` Steven Rostedt
  2018-07-26 21:48     ` Jonathan Corbet
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2018-07-26 14:51 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: Ingo Molnar, linux-kernel, Jonathan Corbet, linux-doc


Jon,

Can you take this patch?

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

I'll take the other two.

Thanks!

-- Steve


On Thu, 26 Jul 2018 21:43:36 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> The name of the directory for per-cpu function statistics
> is trace_stat, not trace_stats.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: linux-doc@vger.kernel.org
> ---
>  0 files changed
> 
> diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
> index a20d34955333..7ea16a0ceffc 100644
> --- a/Documentation/trace/ftrace.rst
> +++ b/Documentation/trace/ftrace.rst
> @@ -329,9 +329,9 @@ of ftrace. Here is a list of some of the key files:
>  	track of the time spent in those functions. The histogram
>  	content can be displayed in the files:
>  
> -	trace_stats/function<cpu> ( function0, function1, etc).
> +	trace_stat/function<cpu> ( function0, function1, etc).
>  
> -  trace_stats:
> +  trace_stat:
>  
>  	A directory that holds different tracing stats.
>  
> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
> index dcc0166d1997..a47f77d27673 100644
> --- a/kernel/trace/Kconfig
> +++ b/kernel/trace/Kconfig
> @@ -521,7 +521,7 @@ config FUNCTION_PROFILER
>  	  in debugfs called function_profile_enabled which defaults to zero.
>  	  When a 1 is echoed into this file profiling begins, and when a
>  	  zero is entered, profiling stops. A "functions" file is created in
> -	  the trace_stats directory; this file shows the list of functions that
> +	  the trace_stat directory; this file shows the list of functions that
>  	  have been hit and their counters.
>  
>  	  If in doubt, say N.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] doc: tracing: Fix a typo of trace_stat
  2018-07-26 14:51   ` Steven Rostedt
@ 2018-07-26 21:48     ` Jonathan Corbet
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Corbet @ 2018-07-26 21:48 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Masami Hiramatsu, Ingo Molnar, linux-kernel, linux-doc

On Thu, 26 Jul 2018 10:51:52 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> Can you take this patch?
> 
> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Done, thanks.

jon

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-26 21:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26 12:43 [PATCH 0/3] tracing: doc: cleanup typo and unused code Masami Hiramatsu
2018-07-26 12:43 ` [PATCH 1/3] doc: tracing: Fix a typo of trace_stat Masami Hiramatsu
2018-07-26 14:51   ` Steven Rostedt
2018-07-26 21:48     ` Jonathan Corbet
2018-07-26 12:44 ` [PATCH 2/3] tracing: Remove orphaned function using_ftrace_ops_list_func() Masami Hiramatsu
2018-07-26 12:44 ` [PATCH 3/3] tracing: Remove orphaned function ftrace_nr_registered_ops() Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).