Skip to contentSkip to conversation

tracing: doc: cleanup typo and unused code

PATCH In review Masami Hiramatsu 3 participants 6 messages Jul 26, 2018

Subsystems (3)
lore
Share & tools
lore

Masami Hiramatsu

author maintainer
#0 lore raw

cover tracing: doc: cleanup typo and unused code

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) <[email protected]>

author maintainer
#1 lore raw

PATCH 1/3 doc: tracing: Fix a typo of trace_stat

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

---

 0 files changed
Documentation/trace/ftrace.rst +2 -2
index a20d34955333..7ea16a0ceffc 100644
@@ -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.
 
kernel/trace/Kconfig +1 -1
index dcc0166d1997..a47f77d27673 100644
@@ -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.

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Acked-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] doc: tracing: Fix a typo of trace_stat

Jon,

Can you take this patch?

I'll take the other two.

Thanks!

-- Steve

Quoted 30 lines · On Thu, 26 Jul 2018 21:43:36 +0900 Masami Hiramatsu <[email protected]> wrote:

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

---

 0 files changed
Documentation/trace/ftrace.rst +2 -2
index a20d34955333..7ea16a0ceffc 100644
@@ -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.
 
kernel/trace/Kconfig +0 -0
index dcc0166d1997..a47f77d27673 100644

kernel/trace/Kconfig config FUNCTION_PROFILER · line 527

Quoted 8 lines
kernel/trace/Kconfig +1 -1
@@ -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.

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#4 lore raw

PATCH 2/3 tracing: Remove orphaned function using_ftrace_ops_list_func().

In reply to Masami Hiramatsu

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.

---

 0 files changed
kernel/trace/ftrace.c +0 -5
index caf9cbf35816..b8b3324ca1c8 100644
@@ -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)
 {
kernel/trace/trace.h +0 -1
index f8f86231ad90..a5d27d7943e7 100644
@@ -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);
author maintainer
#5 lore raw

PATCH 3/3 tracing: Remove orphaned function ftrace_nr_registered_ops()

In reply to Masami Hiramatsu

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.

---

 0 files changed
include/linux/ftrace.h +0 -6
index ebb77674be90..63af5eb0ff46 100644
@@ -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);
kernel/trace/ftrace.c +0 -24
index b8b3324ca1c8..0d380a98a880 100644
@@ -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)
 {