* [PATCH 1/3] [PATCH 1/3] tracing: fix transposed numbers of lock_depth and preempt_count
2009-10-08 1:17 [PATCH 0/3] [GIT PULL][for 2.6.32] tracing: some important fixes Steven Rostedt
@ 2009-10-08 1:17 ` Steven Rostedt
2009-10-08 1:17 ` [PATCH 2/3] [PATCH 2/3] tracing: correct module boundaries for ftrace_release Steven Rostedt
2009-10-08 1:17 ` [PATCH 3/3] [PATCH 3/3] ftrace: check for failure for all conversions Steven Rostedt
2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2009-10-08 1:17 UTC (permalink / raw)
To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker
[-- Attachment #1: 0001-tracing-fix-transposed-numbers-of-lock_depth-and-pre.patch --]
[-- Type: text/plain, Size: 1145 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
The lock_depth and preempt_count numbers in the latency format is
transposed.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace_output.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index cda766f..ed17565 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -486,16 +486,18 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
hardirq ? 'h' : softirq ? 's' : '.'))
return 0;
- if (entry->lock_depth < 0)
- ret = trace_seq_putc(s, '.');
+ if (entry->preempt_count)
+ ret = trace_seq_printf(s, "%x", entry->preempt_count);
else
- ret = trace_seq_printf(s, "%d", entry->lock_depth);
+ ret = trace_seq_putc(s, '.');
+
if (!ret)
return 0;
- if (entry->preempt_count)
- return trace_seq_printf(s, "%x", entry->preempt_count);
- return trace_seq_putc(s, '.');
+ if (entry->lock_depth < 0)
+ return trace_seq_putc(s, '.');
+
+ return trace_seq_printf(s, "%d", entry->lock_depth);
}
static int
--
1.6.3.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/3] [PATCH 2/3] tracing: correct module boundaries for ftrace_release
2009-10-08 1:17 [PATCH 0/3] [GIT PULL][for 2.6.32] tracing: some important fixes Steven Rostedt
2009-10-08 1:17 ` [PATCH 1/3] [PATCH 1/3] tracing: fix transposed numbers of lock_depth and preempt_count Steven Rostedt
@ 2009-10-08 1:17 ` Steven Rostedt
2009-10-08 1:17 ` [PATCH 3/3] [PATCH 3/3] ftrace: check for failure for all conversions Steven Rostedt
2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2009-10-08 1:17 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Jiri Olsa, stable
[-- Attachment #1: 0002-tracing-correct-module-boundaries-for-ftrace_release.patch --]
[-- Type: text/plain, Size: 2368 bytes --]
From: jolsa@redhat.com <jolsa@redhat.com>
When the module is about the unload we release its call records.
The ftrace_release function was given wrong values representing
the module core boundaries, thus not releasing its call records.
Plus making ftrace_release function module specific.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
LKML-Reference: <1254934835-363-3-git-send-email-jolsa@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/ftrace.h | 2 +-
kernel/trace/ftrace.c | 12 ++++--------
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index cd3d2ab..0b4f97d 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -241,7 +241,7 @@ extern void ftrace_enable_daemon(void);
# define ftrace_set_filter(buf, len, reset) do { } while (0)
# define ftrace_disable_daemon() do { } while (0)
# define ftrace_enable_daemon() do { } while (0)
-static inline void ftrace_release(void *start, unsigned long size) { }
+static inline void ftrace_release_mod(struct module *mod) {}
static inline int register_ftrace_command(struct ftrace_func_command *cmd)
{
return -EINVAL;
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 46592fe..c701476 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2658,19 +2658,17 @@ static int ftrace_convert_nops(struct module *mod,
}
#ifdef CONFIG_MODULES
-void ftrace_release(void *start, void *end)
+void ftrace_release_mod(struct module *mod)
{
struct dyn_ftrace *rec;
struct ftrace_page *pg;
- unsigned long s = (unsigned long)start;
- unsigned long e = (unsigned long)end;
- if (ftrace_disabled || !start || start == end)
+ if (ftrace_disabled)
return;
mutex_lock(&ftrace_lock);
do_for_each_ftrace_rec(pg, rec) {
- if ((rec->ip >= s) && (rec->ip < e)) {
+ if (within_module_core(rec->ip, mod)) {
/*
* rec->ip is changed in ftrace_free_rec()
* It should not between s and e if record was freed.
@@ -2702,9 +2700,7 @@ static int ftrace_module_notify(struct notifier_block *self,
mod->num_ftrace_callsites);
break;
case MODULE_STATE_GOING:
- ftrace_release(mod->ftrace_callsites,
- mod->ftrace_callsites +
- mod->num_ftrace_callsites);
+ ftrace_release_mod(mod);
break;
}
--
1.6.3.3
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 3/3] [PATCH 3/3] ftrace: check for failure for all conversions
2009-10-08 1:17 [PATCH 0/3] [GIT PULL][for 2.6.32] tracing: some important fixes Steven Rostedt
2009-10-08 1:17 ` [PATCH 1/3] [PATCH 1/3] tracing: fix transposed numbers of lock_depth and preempt_count Steven Rostedt
2009-10-08 1:17 ` [PATCH 2/3] [PATCH 2/3] tracing: correct module boundaries for ftrace_release Steven Rostedt
@ 2009-10-08 1:17 ` Steven Rostedt
2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2009-10-08 1:17 UTC (permalink / raw)
To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, stable
[-- Attachment #1: 0003-ftrace-check-for-failure-for-all-conversions.patch --]
[-- Type: text/plain, Size: 1073 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Due to legacy code from back when the dynamic tracer used a daemon,
only core kernel code was checking for failures. This is no longer
the case. We must check for failures any time we perform text modifications.
Cc: stable@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/ftrace.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index c701476..f136fe5 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1074,14 +1074,9 @@ static void ftrace_replace_code(int enable)
failed = __ftrace_replace_code(rec, enable);
if (failed) {
rec->flags |= FTRACE_FL_FAILED;
- if ((system_state == SYSTEM_BOOTING) ||
- !core_kernel_text(rec->ip)) {
- ftrace_free_rec(rec);
- } else {
- ftrace_bug(failed, rec->ip);
- /* Stop processing */
- return;
- }
+ ftrace_bug(failed, rec->ip);
+ /* Stop processing */
+ return;
}
} while_for_each_ftrace_rec();
}
--
1.6.3.3
^ permalink raw reply [flat|nested] 4+ messages in thread