diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-11-26 01:21:04 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-01-02 16:17:40 -0500 |
commit | 3fd996a29515df23b3f20c36d69788a3707254a9 (patch) | |
tree | 7b6b4484ec5da2e1a63993705d978f50ac16b3ac /kernel/trace/trace_kprobe.c | |
parent | 34fee3a104cea1c4b658e51836e4bcd99bd76c70 (diff) |
tracing/probes: Implement 'stack' fetch method for uprobes
Use separate method to fetch from stack. Move existing functions to
trace_kprobe.c and make them static. Also add new stack fetch
implementation for uprobes.
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'kernel/trace/trace_kprobe.c')
-rw-r--r-- | kernel/trace/trace_kprobe.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index fe3f00c381c0..389f9e4744c8 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
@@ -88,6 +88,21 @@ static int kprobe_dispatcher(struct kprobe *kp, struct pt_regs *regs); | |||
88 | static int kretprobe_dispatcher(struct kretprobe_instance *ri, | 88 | static int kretprobe_dispatcher(struct kretprobe_instance *ri, |
89 | struct pt_regs *regs); | 89 | struct pt_regs *regs); |
90 | 90 | ||
91 | /* | ||
92 | * Kprobes-specific fetch functions | ||
93 | */ | ||
94 | #define DEFINE_FETCH_stack(type) \ | ||
95 | static __kprobes void FETCH_FUNC_NAME(stack, type)(struct pt_regs *regs,\ | ||
96 | void *offset, void *dest) \ | ||
97 | { \ | ||
98 | *(type *)dest = (type)regs_get_kernel_stack_nth(regs, \ | ||
99 | (unsigned int)((unsigned long)offset)); \ | ||
100 | } | ||
101 | DEFINE_BASIC_FETCH_FUNCS(stack) | ||
102 | /* No string on the stack entry */ | ||
103 | #define fetch_stack_string NULL | ||
104 | #define fetch_stack_string_size NULL | ||
105 | |||
91 | /* Fetch type information table */ | 106 | /* Fetch type information table */ |
92 | const struct fetch_type kprobes_fetch_type_table[] = { | 107 | const struct fetch_type kprobes_fetch_type_table[] = { |
93 | /* Special types */ | 108 | /* Special types */ |