[RFC PATCH 2/2 v2] ftrace: make work with new ring buffer

Previous thread: [RFC PATCH 0/2] Export lld busy state for request stacking drivers by Kiyoshi Ueda on Thursday, September 25, 2008 - 8:53 am. (3 messages)

Next thread: [RFC PATCH 0/2 v2] Unified trace buffer (take two) by Steven Rostedt on Thursday, September 25, 2008 - 8:58 am. (1 message)
From: Steven Rostedt
Date: Thursday, September 25, 2008 - 8:58 am

Note: This patch is a proof of concept, and breaks a lot of
 functionality of ftrace.

This patch simply makes ftrace work with the developmental ring buffer.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 kernel/trace/trace.c              |  776 ++++++++------------------------------
 kernel/trace/trace.h              |   22 -
 kernel/trace/trace_functions.c    |    2 
 kernel/trace/trace_irqsoff.c      |    6 
 kernel/trace/trace_mmiotrace.c    |   10 
 kernel/trace/trace_sched_switch.c |    2 
 kernel/trace/trace_sched_wakeup.c |    2 
 7 files changed, 195 insertions(+), 625 deletions(-)

Index: linux-compile.git/kernel/trace/trace.c
===================================================================
--- linux-compile.git.orig/kernel/trace/trace.c	2008-09-24 19:48:11.000000000 -0400
+++ linux-compile.git/kernel/trace/trace.c	2008-09-25 09:55:04.000000000 -0400
@@ -31,25 +31,24 @@
 #include <linux/writeback.h>
 
 #include <linux/stacktrace.h>
+#include <linux/ring_buffer.h>
 
 #include "trace.h"
 
+#define sdr_print(x, y...) printk("%s:%d " x "\n", __FUNCTION__, __LINE__, y)
+
+#define TRACE_BUFFER_FLAGS	(RB_FL_OVERWRITE)
+
 unsigned long __read_mostly	tracing_max_latency = (cycle_t)ULONG_MAX;
 unsigned long __read_mostly	tracing_thresh;
 
-static unsigned long __read_mostly	tracing_nr_buffers;
 static cpumask_t __read_mostly		tracing_buffer_mask;
 
 #define for_each_tracing_cpu(cpu)	\
 	for_each_cpu_mask(cpu, tracing_buffer_mask)
 
-static int trace_alloc_page(void);
-static int trace_free_page(void);
-
 static int tracing_disabled = 1;
 
-static unsigned long tracing_pages_allocated;
-
 long
 ns2usecs(cycle_t nsec)
 {
@@ -100,11 +99,11 @@ static int			tracer_enabled = 1;
 int				ftrace_function_enabled;
 
 /*
- * trace_nr_entries is the number of entries that is allocated
- * for a buffer. Note, the number of entries is always rounded
- * to ENTRIES_PER_PAGE.
+ * trace_buf_size is the size in bytes that is allocated
+ * for a buffer. ...
Previous thread: [RFC PATCH 0/2] Export lld busy state for request stacking drivers by Kiyoshi Ueda on Thursday, September 25, 2008 - 8:53 am. (3 messages)

Next thread: [RFC PATCH 0/2 v2] Unified trace buffer (take two) by Steven Rostedt on Thursday, September 25, 2008 - 8:58 am. (1 message)