tracing: various fixes
Subsystems (4)
Steven Rostedt
maintainerIngo,
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(-)
Steven Rostedt
maintainerPATCH 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
@@ -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
Steven Rostedt
maintainerPATCH 2/3 tracing: Prevent build warning: ftrace_graph_buf defined but not used
In reply to Steven RostedtFrom: 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
@@ -2274,7 +2274,6 @@ void ftrace_set_notrace(unsigned char *buf, int len, int reset)#define FTRACE_FILTER_SIZE COMMAND_LINE_SIZEstatic 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
Steven Rostedt
maintainerPATCH 3/3 tracing: Only print objcopy version warning once from recordmcount
In reply to Steven RostedtFrom: 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
@@ -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
@@ -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
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-1Lai Jiangshan (1):
tracing: Prevent build warning: 'ftrace_graph_buf' defined but not usedSteven Rostedt (2):
ring-buffer: Move access tocommit_pageup 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