[PATCH 1/4] ftrace - expose tracing_thresh and global_trace

Tim Bird
2009-12-09T22:40:55Z

Make tracing_thresh and global_trace available for
function_duration tracer.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
---
kernel/trace/trace.c | 7 ++++---
kernel/trace/trace.h | 5 ++++-
2 files changed, 8 insertions(+), 4 deletions(-)

--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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);
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -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,