Skip to contentSkip to conversation

tracing: various fixes

GIT PULL New Steven Rostedt 2 participants 5 messages Nov 17, 2009

Subsystems (4)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

Ingo,

This is based on top of tip/tracing/core.

Please pull the latest tip/tracing/core-1 tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/core-1

Lai Jiangshan (1):
tracing: Prevent build warning: 'ftrace_graph_buf' defined but not used

Steven Rostedt (2):
ring-buffer: Move access to commit_page up into function used
tracing: Only print objcopy version warning once from recordmcount

----

 Makefile                   |    1 +
 kernel/trace/ftrace.c      |    2 +-
 kernel/trace/ring_buffer.c |    9 +++------
 scripts/recordmcount.pl    |   12 ++++++++++--
 4 files changed, 15 insertions(+), 9 deletions(-)
author maintainer
#1 lore raw

PATCH 1/3 ring-buffer: Move access to commit_page up into function used

From: Steven Rostedt <[email protected]>

With the change of the way we process commits. Where a commit only happens at the outer most level, and that we don't need to worry about a commit ending after the rb_start_commit() has been called, the code use to grab the commit page before the tail page to prevent a possible race. But this race no longer exists with the rb_start_commit() rb_end_commit() interface.

---
 kernel/trace/ring_buffer.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
kernel/trace/ring_buffer.c +3 -6
index 3ffa502..4b8293f 100644
@@ -1785,9 +1785,9 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer,
 static struct ring_buffer_event *
 rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer,
 	     unsigned long length, unsigned long tail,
-	     struct buffer_page *commit_page,
 	     struct buffer_page *tail_page, u64 *ts)
 {
+	struct buffer_page *commit_page = cpu_buffer->commit_page;
 	struct ring_buffer *buffer = cpu_buffer->buffer;
 	struct buffer_page *next_page;
 	int ret;
@@ -1890,13 +1890,10 @@ static struct ring_buffer_event *
 __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
 		  unsigned type, unsigned long length, u64 *ts)
 {
-	struct buffer_page *tail_page, *commit_page;
+	struct buffer_page *tail_page;
 	struct ring_buffer_event *event;
 	unsigned long tail, write;
 
-	commit_page = cpu_buffer->commit_page;
-	/* we just need to protect against interrupts */
-	barrier();
 	tail_page = cpu_buffer->tail_page;
 	write = local_add_return(length, &tail_page->write);
 
@@ -1907,7 +1904,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
 	/* See if we shot pass the end of this buffer page */
 	if (write > BUF_PAGE_SIZE)
 		return rb_move_tail(cpu_buffer, length, tail,
-				    commit_page, tail_page, ts);
+				    tail_page, ts);
 
 	/* We reserved something on the buffer */
 
Signature · 1 line
1.6.5
author maintainer
#2 lore raw

PATCH 2/3 tracing: Prevent build warning: ftrace_graph_buf defined but not used

In reply to Steven Rostedt

From: Lai Jiangshan <[email protected]>

Prevent build warning when CONFIG_FUNCTION_GRAPH_TRACER is not set.

LKML-Reference: <[email protected]>

---
 kernel/trace/ftrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/trace/ftrace.c +1 -1
index 1ed514f..7f9b51e 100644
@@ -2274,7 +2274,6 @@ void ftrace_set_notrace(unsigned char *buf, int len, int reset)
 #define FTRACE_FILTER_SIZE		COMMAND_LINE_SIZE
 static char ftrace_notrace_buf[FTRACE_FILTER_SIZE] __initdata;
 static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata;
-static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata;
 
 static int __init set_ftrace_notrace(char *str)
 {
@@ -2291,6 +2290,7 @@ static int __init set_ftrace_filter(char *str)
 __setup("ftrace_filter=", set_ftrace_filter);
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
+static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata;
 static int __init set_graph_function(char *str)
 {
 	strlcpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);
Signature · 1 line
1.6.5
author maintainer
#3 lore raw

PATCH 3/3 tracing: Only print objcopy version warning once from recordmcount

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

If the user has an older version of objcopy, that can not handle converting local symbols to global and vice versa, then some functions will not be part of the dynamic function tracer. The current code in recordmcount.pl will print a warning in this case. Unfortunately, there exists lots of files that may have this issue with older objcopys and this will cause a warning for every file compiled with this issue.

This patch solves this overwhelming output by creating a .tmp_quiet_recordmcount file on the first instance the warning is encountered. The warning will not print if this file exists.

The temp file is deleted at the beginning of the compile to ensure that the warning will happen once again on new compiles (because the issue is still present).

---
 Makefile                |    1 +
 scripts/recordmcount.pl |   12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
Makefile +1 -0
index 9425d1d..1c949ac 100644
@@ -379,6 +379,7 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exc
 PHONY += scripts_basic
 scripts_basic:
 	$(Q)$(MAKE) $(build)=scripts/basic
+	$(Q)rm -f .tmp_quiet_recordmcount
 
 # To avoid any implicit rule to kick in, define an empty command.
 scripts/basic/%: scripts_basic ;
scripts/recordmcount.pl +10 -2
index a4e2435..f0d1445 100755
@@ -162,6 +162,11 @@ my $alignment;		# The .align value to use for $mcount_section
 my $section_type;	# Section header plus possible alignment command
 my $can_use_local = 0; 	# If we can use local function references
 
+# Shut up recordmcount if user has older objcopy
+my $quiet_recordmcount = ".tmp_quiet_recordmcount";
+my $print_warning = 1;
+$print_warning = 0 if ( -f $quiet_recordmcount);
+
 ##
 # check_objcopy - whether objcopy supports --globalize-symbols
 #
@@ -179,10 +184,13 @@ sub check_objcopy
     }
     close (IN);
 
-    if (!$can_use_local) {
+    if (!$can_use_local && $print_warning) {
 	print STDERR "WARNING: could not find objcopy version or version " .
 	    "is less than 2.17.\n" .
-	    "\tLocal function references is disabled.\n";
+	    "\tLocal function references are disabled.\n";
+	open (QUIET, ">$quiet_recordmcount");
+	printf QUIET "Disables the warning from recordmcount.pl\n";
+	close QUIET;
     }
 }
 
Signature · 1 line
1.6.5
#4 lore raw
In reply to Steven Rostedt
Quoted 18 lines · Steven Rostedt

Ingo,

This is based on top of tip/tracing/core.

Please pull the latest tip/tracing/core-1 tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/core-1

Lai Jiangshan (1):
tracing: Prevent build warning: 'ftrace_graph_buf' defined but not used

Steven Rostedt (2):
ring-buffer: Move access to commit_page up into function used
tracing: Only print objcopy version warning once from recordmcount

Quoted 6 lines

----

 Makefile                   |    1 +
 kernel/trace/ftrace.c      |    2 +-
 kernel/trace/ring_buffer.c |    9 +++------
 scripts/recordmcount.pl    |   12 ++++++++++--
 4 files changed, 15 insertions(+), 9 deletions(-)

Pulled into tip:tracing/core, thanks Steve!

Ingo