diff mbox series

[39/54] tracing: Make tracing_set_clock() non-static

Message ID TY1PR01MB1692911C0F89D7F417EB69B596090@TY1PR01MB1692.jpnprd01.prod.outlook.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Motai.Hirotaka@aj.MitsubishiElectric.co.jp Aug. 29, 2018, 12:17 p.m. UTC
Allow tracing code outside of trace.c to access tracing_set_clock().

Some applications may require a particular clock in order to function
properly, such as latency calculations.

Also, add an accessor returning the current clock string.

Link: http://lkml.kernel.org/r/6d1c53e9ee2163f54e1849f5376573f54f0e6009.1516069914.git.tom.zanussi@linux.intel.com

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
(cherry picked from commit d71bd34d78bb78b9e6f8a0be3952d5fa470a260a)
Signed-off-by: Hirotaka MOTAI <Motai.Hirotaka@aj.MitsubishiElectric.co.jp>
---
 kernel/trace/trace.c | 2 +-
 kernel/trace/trace.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index e6394615..25244e4e 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6217,17 +6217,17 @@  static int tracing_clock_show(struct seq_file *m, void *v)
 			"%s%s%s%s", i ? " " : "",
 			i == tr->clock_id ? "[" : "", trace_clocks[i].name,
 			i == tr->clock_id ? "]" : "");
 	seq_putc(m, '\n');
 
 	return 0;
 }
 
-static int tracing_set_clock(struct trace_array *tr, const char *clockstr)
+int tracing_set_clock(struct trace_array *tr, const char *clockstr)
 {
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(trace_clocks); i++) {
 		if (strcmp(trace_clocks[i].name, clockstr) == 0)
 			break;
 	}
 	if (i == ARRAY_SIZE(trace_clocks))
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 5975d5f5..0b8af849 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -284,16 +284,17 @@  enum {
 extern struct list_head ftrace_trace_arrays;
 
 extern struct mutex trace_types_lock;
 
 extern int trace_array_get(struct trace_array *tr);
 extern void trace_array_put(struct trace_array *tr);
 
 extern int tracing_set_time_stamp_abs(struct trace_array *tr, bool abs);
+extern int tracing_set_clock(struct trace_array *tr, const char *clockstr);
 
 extern bool trace_clock_in_ns(struct trace_array *tr);
 
 /*
  * The global tracer (top) should be the first trace array added,
  * but we check the flag anyway.
  */
 static inline struct trace_array *top_trace_array(void)