Skip to contentSkip to conversation

ftrace - expose tracing_thresh and global_trace

PATCH In review Tim Bird 2 participants 2 messages Dec 9, 2009 – Dec 10, 2009 Tracing

lore
Share & tools
lore

Tim Bird

author
#0 lore raw

PATCH 1/4 ftrace - expose tracing_thresh and global_trace

Make tracing_thresh and global_trace available for function_duration tracer.

---
 kernel/trace/trace.c |    7 ++++---
 kernel/trace/trace.h |    5 ++++-
 2 files changed, 8 insertions(+), 4 deletions(-)
kernel/trace/trace.c +4 -3
@@ -165,7 +165,7 @@ unsigned long long ns2usecs(cycle_t nsec
  * pages for the buffer for that CPU. Each CPU has the same number
  * of pages allocated for its buffer.
  */
-static struct trace_array	global_trace;
+struct trace_array	global_trace;
 
 static DEFINE_PER_CPU(struct trace_array_cpu, global_trace_cpu);
 
@@ -503,9 +503,10 @@ static ssize_t trace_seq_to_buffer(struc
 static raw_spinlock_t ftrace_max_lock =
 	(raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
 
+unsigned long __read_mostly	tracing_thresh;
+
 #ifdef CONFIG_TRACER_MAX_TRACE
 unsigned long __read_mostly	tracing_max_latency;
-unsigned long __read_mostly	tracing_thresh;
 
 /*
  * Copy the new maximum trace into the separate maximum-trace
@@ -4177,9 +4178,9 @@ static __init int tracer_init_debugfs(vo
 	trace_create_file("tracing_max_latency", 0644, d_tracer,
 			&tracing_max_latency, &tracing_max_lat_fops);
 
+#endif
 	trace_create_file("tracing_thresh", 0644, d_tracer,
 			&tracing_thresh, &tracing_max_lat_fops);
-#endif
 
 	trace_create_file("README", 0444, d_tracer,
 			NULL, &tracing_readme_fops);
kernel/trace/trace.h +4 -1
@@ -157,6 +157,8 @@ struct trace_array {
 	struct trace_array_cpu	*data[NR_CPUS];
 };
 
+extern struct trace_array	global_trace;
+
 #define FTRACE_CMP_TYPE(var, type) \
 	__builtin_types_compatible_p(typeof(var), type *)
 
@@ -366,9 +368,10 @@ int is_tracing_stopped(void);
 
 extern unsigned long nsecs_to_usecs(unsigned long nsecs);
 
+extern unsigned long tracing_thresh;
+
 #ifdef CONFIG_TRACER_MAX_TRACE
 extern unsigned long tracing_max_latency;
-extern unsigned long tracing_thresh;
 
 void update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu);
 void update_max_tr_single(struct trace_array *tr,
maintainer
#1 lore raw
Quoted 2 lines · Tim Bird

Make tracing_thresh and global_trace available for function_duration tracer.

I'm OK with globalizing tracing_thresh, but NAK on the global_trace. See how function and function graph tracer handle this. It is still possible that in the future the global_trace may not exist.

-- Steve