Skip to contentSkip to conversation

tracing: make exported ftrace_set_clr_event non-static

PATCH In review Denis Efremov 2 participants 2 messages Jul 4, 2019 – Jul 7, 2019 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracing: make exported ftrace_set_clr_event non-static

The function ftrace_set_clr_event is declared static and marked EXPORT_SYMBOL_GPL(), which is at best an odd combination. Because the function was decided to be a part of API, this commit removes the static attribute and adds the declaration to the header.

Fixes f45d1225adb04 ("tracing: Kernel access to Ftrace instances")
---
 include/linux/trace_events.h | 1 +
 kernel/trace/trace_events.c  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
include/linux/trace_events.h +1 -0
index 8a62731673f7..84bc84f00e8f 100644
@@ -539,6 +539,7 @@ extern int trace_event_get_offsets(struct trace_event_call *call);
 
 #define is_signed_type(type)	(((type)(-1)) < (type)1)
 
+int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set);
 int trace_set_clr_event(const char *system, const char *event, int set);
 
 /*
kernel/trace/trace_events.c +1 -1
index 0ce3db67f556..b6b46184f6bf 100644
@@ -795,7 +795,7 @@ static int __ftrace_set_clr_event(struct trace_array *tr, const char *match,
 	return ret;
 }
 
-static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set)
+int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set)
 {
 	char *event = NULL, *sub = NULL, *match;
 	int ret;
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw

Patch looks good to me.

Thanks,
Joe

Quoted 38 lines · Denis Efremov

The function ftrace_set_clr_event is declared static and marked EXPORT_SYMBOL_GPL(), which is at best an odd combination. Because the function was decided to be a part of API, this commit removes the static attribute and adds the declaration to the header.

Fixes f45d1225adb04 ("tracing: Kernel access to Ftrace instances")
---
 include/linux/trace_events.h | 1 +
 kernel/trace/trace_events.c  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
include/linux/trace_events.h +1 -0
index 8a62731673f7..84bc84f00e8f 100644
@@ -539,6 +539,7 @@ extern int trace_event_get_offsets(struct trace_event_call *call);
 
 #define is_signed_type(type)	(((type)(-1)) < (type)1)
 
+int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set);
 int trace_set_clr_event(const char *system, const char *event, int set);
 
 /*
kernel/trace/trace_events.c +1 -1
index 0ce3db67f556..b6b46184f6bf 100644
@@ -795,7 +795,7 @@ static int __ftrace_set_clr_event(struct trace_array *tr, const char *match,
 	return ret;
 }
 
-static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set)
+int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set)
 {
 	char *event = NULL, *sub = NULL, *match;
 	int ret;