From: Masami Hiramatsu <mhiramat@redhat.com>
To: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Paul Mackerras <paulus@samba.org>,
Jason Baron <jbaron@redhat.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] tracing/kprobe: cleanup unused return value of function
Date: Mon, 18 Jan 2010 11:16:58 -0500 [thread overview]
Message-ID: <4B54897A.9000901@redhat.com> (raw)
In-Reply-To: <4B54662B.4050109@cn.fujitsu.com>
Xiao Guangrong wrote:
> Those function's return value is meaningless
Right, now these functions are called from dispatchers,
and return values are wasted.
>
> Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Thanks!
> ---
> kernel/trace/trace_kprobe.c | 28 ++++++++++++++--------------
> 1 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index 6d478c1..5869819 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -942,7 +942,7 @@ static const struct file_operations kprobe_profile_ops = {
> };
>
> /* Kprobe handler */
> -static __kprobes int kprobe_trace_func(struct kprobe *kp, struct pt_regs *regs)
> +static __kprobes void kprobe_trace_func(struct kprobe *kp, struct pt_regs *regs)
> {
> struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp);
> struct kprobe_trace_entry *entry;
> @@ -962,7 +962,7 @@ static __kprobes int kprobe_trace_func(struct kprobe *kp, struct pt_regs *regs)
> event = trace_current_buffer_lock_reserve(&buffer, call->id, size,
> irq_flags, pc);
> if (!event)
> - return 0;
> + return ;
>
> entry = ring_buffer_event_data(event);
> entry->nargs = tp->nr_args;
> @@ -972,11 +972,11 @@ static __kprobes int kprobe_trace_func(struct kprobe *kp, struct pt_regs *regs)
>
> if (!filter_current_check_discard(buffer, call, entry, event))
> trace_nowake_buffer_unlock_commit(buffer, event, irq_flags, pc);
> - return 0;
> + return ;
> }
>
> /* Kretprobe handler */
> -static __kprobes int kretprobe_trace_func(struct kretprobe_instance *ri,
> +static __kprobes void kretprobe_trace_func(struct kretprobe_instance *ri,
> struct pt_regs *regs)
> {
> struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp);
> @@ -995,7 +995,7 @@ static __kprobes int kretprobe_trace_func(struct kretprobe_instance *ri,
> event = trace_current_buffer_lock_reserve(&buffer, call->id, size,
> irq_flags, pc);
> if (!event)
> - return 0;
> + return ;
>
> entry = ring_buffer_event_data(event);
> entry->nargs = tp->nr_args;
> @@ -1007,7 +1007,7 @@ static __kprobes int kretprobe_trace_func(struct kretprobe_instance *ri,
> if (!filter_current_check_discard(buffer, call, entry, event))
> trace_nowake_buffer_unlock_commit(buffer, event, irq_flags, pc);
>
> - return 0;
> + return ;
> }
>
> /* Event entry printers */
> @@ -1217,7 +1217,7 @@ static int set_print_fmt(struct trace_probe *tp)
> #ifdef CONFIG_PERF_EVENTS
>
> /* Kprobe profile handler */
> -static __kprobes int kprobe_profile_func(struct kprobe *kp,
> +static __kprobes void kprobe_profile_func(struct kprobe *kp,
> struct pt_regs *regs)
> {
> struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp);
> @@ -1232,11 +1232,11 @@ static __kprobes int kprobe_profile_func(struct kprobe *kp,
> size -= sizeof(u32);
> if (WARN_ONCE(size > FTRACE_MAX_PROFILE_SIZE,
> "profile buffer not large enough"))
> - return 0;
> + return ;
>
> entry = ftrace_profile_buf_begin(size, call->id, &rctx, &irq_flags);
> if (!entry)
> - return 0;
> + return ;
>
> entry->nargs = tp->nr_args;
> entry->ip = (unsigned long)kp->addr;
> @@ -1245,11 +1245,11 @@ static __kprobes int kprobe_profile_func(struct kprobe *kp,
>
> ftrace_profile_buf_end(entry, size, rctx, entry->ip, 1, irq_flags);
>
> - return 0;
> + return ;
> }
>
> /* Kretprobe profile handler */
> -static __kprobes int kretprobe_profile_func(struct kretprobe_instance *ri,
> +static __kprobes void kretprobe_profile_func(struct kretprobe_instance *ri,
> struct pt_regs *regs)
> {
> struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp);
> @@ -1264,11 +1264,11 @@ static __kprobes int kretprobe_profile_func(struct kretprobe_instance *ri,
> size -= sizeof(u32);
> if (WARN_ONCE(size > FTRACE_MAX_PROFILE_SIZE,
> "profile buffer not large enough"))
> - return 0;
> + return ;
>
> entry = ftrace_profile_buf_begin(size, call->id, &rctx, &irq_flags);
> if (!entry)
> - return 0;
> + return ;
>
> entry->nargs = tp->nr_args;
> entry->func = (unsigned long)tp->rp.kp.addr;
> @@ -1278,7 +1278,7 @@ static __kprobes int kretprobe_profile_func(struct kretprobe_instance *ri,
>
> ftrace_profile_buf_end(entry, size, rctx, entry->ret_ip, 1, irq_flags);
>
> - return 0;
> + return ;
> }
>
> static int probe_profile_enable(struct ftrace_event_call *call)
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com
next prev parent reply other threads:[~2010-01-18 16:17 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-18 13:42 [PATCH 1/3] perf_event: fix race in perf_swevent_get_recursion_context() Xiao Guangrong
2010-01-18 13:44 ` [PATCH 2/3] perf_event: cleanup for event profile buffer operation Xiao Guangrong
2010-01-18 13:46 ` [PATCH 3/3] tracing/kprobe: cleanup unused return value of function Xiao Guangrong
2010-01-18 16:16 ` Masami Hiramatsu [this message]
2010-01-19 8:37 ` [PATCH 1/3 v2] perf_event: fix race in perf_swevent_get_recursion_context() Xiao Guangrong
2010-01-19 8:46 ` Peter Zijlstra
2010-01-19 9:06 ` Xiao Guangrong
2010-01-19 8:39 ` [PATCH 2/3 v2] perf_event: cleanup for event profile buffer operation Xiao Guangrong
2010-01-19 8:41 ` [PATCH 3/3 v2] tracing/kprobe: cleanup unused return value of function Xiao Guangrong
2010-01-18 16:21 ` [PATCH 2/3] perf_event: cleanup for event profile buffer operation Masami Hiramatsu
2010-01-18 17:20 ` Frederic Weisbecker
2010-01-18 17:48 ` Masami Hiramatsu
2010-01-18 18:02 ` Frederic Weisbecker
2010-01-19 1:26 ` Xiao Guangrong
2010-01-19 9:00 ` Frederic Weisbecker
2010-01-19 14:26 ` Masami Hiramatsu
2010-01-18 17:11 ` Frederic Weisbecker
2010-01-18 13:55 ` [PATCH 1/3] perf_event: fix race in perf_swevent_get_recursion_context() Peter Zijlstra
2010-01-19 7:36 ` Xiao Guangrong
2010-01-19 8:41 ` Peter Zijlstra
2010-01-18 16:41 ` Frederic Weisbecker
2010-01-19 1:19 ` Xiao Guangrong
2010-01-19 8:46 ` Peter Zijlstra
2010-01-19 8:58 ` Frederic Weisbecker
2010-01-19 9:09 ` Xiao Guangrong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B54897A.9000901@redhat.com \
--to=mhiramat@redhat.com \
--cc=fweisbec@gmail.com \
--cc=jbaron@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=xiaoguangrong@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.