tracing: some more fixes
Steven Rostedt
maintainerIngo,
Please pull the latest tip/tracing/urgent2 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/urgent2
Steven Rostedt (1):
tracing: user local buffer variable for trace branch tracer
Zhenwen Xu (1):
tracing: fix warning on kernel/trace/trace_branch.c andtrace_hw_branches.c
----
kernel/trace/trace_branch.c | 8 +++++--- kernel/trace/trace_hw_branches.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-)
Steven Rostedt
maintainerPATCH 1/2 tracing: fix warning on kernel/trace/trace_branch.c andtrace_hw_branches.c
From: Zhenwen Xu <[email protected]>
fix warnings that caused the API change of trace_buffer_lock_reserve() change files: kernel/trace/trace_hw_branch.c
kernel/trace/trace_branch.c
LKML-Reference: <20091008012146.GA4170@helight>
--- kernel/trace/trace_branch.c | 2 +- kernel/trace/trace_hw_branches.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-)
kernel/trace/trace_branch.c +1 -1
@@ -54,7 +54,7 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) goto out; pc =preempt_count (); - event =trace_buffer_lock_reserve (tr,TRACE_BRANCH , + event =trace_buffer_lock_reserve (tr->buffer,TRACE_BRANCH ,sizeof (*entry), flags, pc);if (!event) goto out;
kernel/trace/trace_hw_branches.c +5 -3
@@ -165,6 +165,7 @@ void trace_hw_branch(u64 from, u64 to)struct ftrace_event_call *call = &event_hw_branch;struct trace_array *tr = hw_branch_trace;struct ring_buffer_event *event; +struct ring_buffer *buf;struct hw_branch_entry *entry;unsigned long irq1;int cpu;
@@ -180,7 +181,8 @@ void trace_hw_branch(u64 from, u64 to)if (atomic_inc_return (&tr->data[cpu]->disabled) !=1 ) goto out; - event =trace_buffer_lock_reserve (tr,TRACE_HW_BRANCHES , + buf = tr->buffer; + event =trace_buffer_lock_reserve (buf,TRACE_HW_BRANCHES ,sizeof (*entry),0 ,0 );if (!event) goto out;
@@ -189,8 +191,8 @@ void trace_hw_branch(u64 from, u64 to) entry->ent.type =TRACE_HW_BRANCHES ; entry->from = from; entry->to = to; -if (!filter_check_discard (call, entry, tr->buffer, event)) -trace_buffer_unlock_commit (tr, event,0 ,0 ); +if (!filter_check_discard (call, entry, buf, event)) +trace_buffer_unlock_commit (buf, event,0 ,0 ); out:atomic_dec (&tr->data[cpu]->disabled);
Signature · 1 line
1.6.3.3
Steven Rostedt
maintainerPATCH 2/2 tracing: user local buffer variable for trace branch tracer
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
Just using the tr->buffer for the API to trace_buffer_lock_reserve is not good enough. This is because the tr->buffer may change, and we do not want to commit with a different buffer that we reserved from.
This patch uses a local variable to hold the buffer that was used to reserve and commit with.
--- kernel/trace/trace_branch.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
kernel/trace/trace_branch.c +5 -3
@@ -34,6 +34,7 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect)struct trace_array *tr = branch_tracer;struct ring_buffer_event *event;struct trace_branch *entry; +struct ring_buffer *buffer;unsigned long flags;int cpu, pc;const char *p;
@@ -54,7 +55,8 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) goto out; pc =preempt_count (); - event =trace_buffer_lock_reserve (tr->buffer,TRACE_BRANCH , + buffer = tr->buffer; + event =trace_buffer_lock_reserve (buffer,TRACE_BRANCH ,sizeof (*entry), flags, pc);if (!event) goto out;
@@ -74,8 +76,8 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) entry->line = f->line; entry->correct = val == expect; -if (!filter_check_discard (call, entry, tr->buffer, event)) -ring_buffer_unlock_commit (tr->buffer, event); +if (!filter_check_discard (call, entry, buffer, event)) +ring_buffer_unlock_commit (buffer, event); out:atomic_dec (&tr->data[cpu]->disabled);
Signature · 1 line
1.6.3.3
Quoted 12 lines · Steven Rostedt
Ingo,
Please pull the latest tip/tracing/urgent2 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/urgent2Steven Rostedt (1):
tracing: user local buffer variable for trace branch tracer
Quoted 7 lines
Zhenwen Xu (1):
tracing: fix warning onkernel/trace/trace_branch.candtrace_hw_branches.c----
kernel/trace/trace_branch.c | 8 +++++--- kernel/trace/trace_hw_branches.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-)
Pulled, thanks a lot Steve!
Ingo