Re: [PATCH V2] fix a warning on kernel/trace/trace_branch.c and trace_hw_branches.c
From: Li Zefan
Date: Wed Oct 07 2009 - 04:55:47 EST
Zhenwen Xu wrote:
> 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
>
Hmm, did you really compile trace_hw_branch.c while testing
this patch?
This change is necessary too:
- trace_buffer_unlock_commit(tr, event, 0, 0);
+ trace_buffer_unlock_commit(tr->buffer, event, 0, 0);
And use a varaible "buffer = tr->buffer" should be better.
> Signed-off-by: Zhenwen Xu <helight.xu@xxxxxxxxx>
> ---
> kernel/trace/trace_branch.c | 2 +-
> kernel/trace/trace_hw_branches.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c
> index 7a7a9fd..216e2dd 100644
> --- a/kernel/trace/trace_branch.c
> +++ b/kernel/trace/trace_branch.c
> @@ -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;
> diff --git a/kernel/trace/trace_hw_branches.c b/kernel/trace/trace_hw_branches.c
> index 23b6385..1cc17ca 100644
> --- a/kernel/trace/trace_hw_branches.c
> +++ b/kernel/trace/trace_hw_branches.c
> @@ -180,7 +180,7 @@ 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,
> + event = trace_buffer_lock_reserve(tr->buffer, TRACE_HW_BRANCHES,
> sizeof(*entry), 0, 0);
> if (!event)
> goto out;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/