Skip to contentSkip to conversation

trace_functions_graph: Remove __trace_graph_function

PATCH New Dmitry Safonov 2 participants 4 messages Oct 30, 2015 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace_functions_graph: Remove __trace_graph_function

__trace_graph_funciton is used in only one location, and is static. As it's small function there is no need to keep it separated out.

---
 kernel/trace/trace_functions_graph.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
kernel/trace/trace_functions_graph.c +1 -10
index ca98445782acaa..db434d2a9d6243 100644
@@ -360,8 +360,7 @@ static int trace_graph_thresh_entry(struct ftrace_graph_ent *trace)
 		return trace_graph_entry(trace);
 }
 
-static void
-__trace_graph_function(struct trace_array *tr,
+void trace_graph_function(struct trace_array *tr,
 		unsigned long ip, unsigned long flags, int pc)
 {
 	u64 time = trace_clock_local();
@@ -380,14 +379,6 @@ __trace_graph_function(struct trace_array *tr,
 	__trace_graph_return(tr, &ret, flags, pc);
 }
 
-void
-trace_graph_function(struct trace_array *tr,
-		unsigned long ip, unsigned long parent_ip,
-		unsigned long flags, int pc)
-{
-	__trace_graph_function(tr, ip, flags, pc);
-}
-
 void __trace_graph_return(struct trace_array *tr,
 				struct ftrace_graph_ret *trace,
 				unsigned long flags,
Signature · 1 line
2.6.1
#1 lore raw

PATCH 1/1 trace_functions_graph: Remove __trace_graph_function

__trace_graph_funciton is used in only one location, and is static. As it's small function there is no need to keep it separated out.

---
 kernel/trace/trace_functions_graph.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
kernel/trace/trace_functions_graph.c +3 -11
index ca98445782acaa..dc45caefe4b1ac 100644
@@ -360,9 +360,9 @@ static int trace_graph_thresh_entry(struct ftrace_graph_ent *trace)
 		return trace_graph_entry(trace);
 }
 
-static void
-__trace_graph_function(struct trace_array *tr,
-		unsigned long ip, unsigned long flags, int pc)
+void trace_graph_function(struct trace_array *tr,
+		unsigned long ip, unsigned long parent_ip,
+		unsigned long flags, int pc)
 {
 	u64 time = trace_clock_local();
 	struct ftrace_graph_ent ent = {
@@ -380,14 +380,6 @@ __trace_graph_function(struct trace_array *tr,
 	__trace_graph_return(tr, &ret, flags, pc);
 }
 
-void
-trace_graph_function(struct trace_array *tr,
-		unsigned long ip, unsigned long parent_ip,
-		unsigned long flags, int pc)
-{
-	__trace_graph_function(tr, ip, flags, pc);
-}
-
 void __trace_graph_return(struct trace_array *tr,
 				struct ftrace_graph_ret *trace,
 				unsigned long flags,
Signature · 1 line
2.6.1
#2 lore raw

I was to dumb to check, if it compiles - please, use the second one.

#3 lore raw
In reply to Dmitry Safonov
reproduce:

Hi Dmitry,

[auto build test ERROR on v4.3-rc7 -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Safonov/trace_functions_graph-Remove-__trace_graph_function/20151031-030819
config: x86_64-randconfig-x014-10300134 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> kernel/trace/trace_functions_graph.c:363:6: error: conflicting types for 'trace_graph_function'

void trace_graph_function(struct trace_array *tr,
^
In file included from kernel/trace/trace_functions_graph.c:14:0:
kernel/trace/trace.h:578:6: note: previous declaration of 'trace_graph_function' was here
void trace_graph_function(struct trace_array *tr,
^

vim +/trace_graph_function +363 kernel/trace/trace_functions_graph.c

357 if (tracing_thresh)
358 return 1;
359 else
360 return trace_graph_entry(trace);
361 }
362

 > 363	void trace_graph_function(struct trace_array *tr,

364 unsigned long ip, unsigned long flags, int pc)
365 {
366 u64 time = trace_clock_local();

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation