[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5204B419.1030907@hitachi.com>
Date: Fri, 09 Aug 2013 18:19:21 +0900
From: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Namhyung Kim <namhyung.kim@....com>,
Hyeoncheol Lee <cheol.lee@....com>,
LKML <linux-kernel@...r.kernel.org>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
Oleg Nesterov <oleg@...hat.com>,
"zhangwei(Jovi)" <jovi.zhangwei@...wei.com>,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: Re: [PATCH 05/13] tracing/kprobes: Staticize stack and memory fetch
functions
(2013/08/09 17:45), Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@....com>
>
> Those fetch functions need to be implemented differently for kprobes
> and uprobes. Since the deref fetch functions don't call those
> directly anymore, we can make them static and implement them
> separately.
Right ;)
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
> Cc: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
> Cc: Oleg Nesterov <oleg@...hat.com>
> Cc: zhangwei(Jovi) <jovi.zhangwei@...wei.com>
> Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
> kernel/trace/trace_kprobe.c | 8 ++++----
> kernel/trace/trace_probe.h | 8 --------
> 2 files changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index d17622a1c098..d2af84b2d346 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -753,7 +753,7 @@ static const struct file_operations kprobe_profile_ops = {
> * kprobes-specific fetch functions
> */
> #define DEFINE_FETCH_stack(type) \
> -__kprobes void FETCH_FUNC_NAME(stack, type)(struct pt_regs *regs, \
> +static __kprobes void FETCH_FUNC_NAME(stack, type)(struct pt_regs *regs,\
> void *offset, void *dest) \
> { \
> *(type *)dest = (type)regs_get_kernel_stack_nth(regs, \
> @@ -765,7 +765,7 @@ DEFINE_BASIC_FETCH_FUNCS(stack)
> #define fetch_stack_string_size NULL
>
> #define DEFINE_FETCH_memory(type) \
> -__kprobes void FETCH_FUNC_NAME(memory, type)(struct pt_regs *regs, \
> +static __kprobes void FETCH_FUNC_NAME(memory, type)(struct pt_regs *regs,\
> void *addr, void *dest) \
> { \
> type retval; \
> @@ -779,7 +779,7 @@ DEFINE_BASIC_FETCH_FUNCS(memory)
> * Fetch a null-terminated string. Caller MUST set *(u32 *)dest with max
> * length and relative data location.
> */
> -__kprobes void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs,
> +static __kprobes void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs,
> void *addr, void *dest)
> {
> long ret;
> @@ -816,7 +816,7 @@ __kprobes void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs,
> }
>
> /* Return the length of string -- including null terminal byte */
> -__kprobes void FETCH_FUNC_NAME(memory, string_size)(struct pt_regs *regs,
> +static __kprobes void FETCH_FUNC_NAME(memory, string_size)(struct pt_regs *regs,
> void *addr, void *dest)
> {
> mm_segment_t old_fs;
> diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
> index 8c62746e5419..9ac7bdf607cc 100644
> --- a/kernel/trace/trace_probe.h
> +++ b/kernel/trace/trace_probe.h
> @@ -177,18 +177,10 @@ DECLARE_BASIC_FETCH_FUNCS(reg);
> #define fetch_reg_string NULL
> #define fetch_reg_string_size NULL
>
> -DECLARE_BASIC_FETCH_FUNCS(stack);
> -#define fetch_stack_string NULL
> -#define fetch_stack_string_size NULL
> -
> DECLARE_BASIC_FETCH_FUNCS(retval);
> #define fetch_retval_string NULL
> #define fetch_retval_string_size NULL
>
> -DECLARE_BASIC_FETCH_FUNCS(memory);
> -DECLARE_FETCH_FUNC(memory, string);
> -DECLARE_FETCH_FUNC(memory, string_size);
> -
> DECLARE_BASIC_FETCH_FUNCS(symbol);
> DECLARE_FETCH_FUNC(symbol, string);
> DECLARE_FETCH_FUNC(symbol, string_size);
>
--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists