diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-11-26 00:56:28 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-01-02 16:17:39 -0500 |
commit | 34fee3a104cea1c4b658e51836e4bcd99bd76c70 (patch) | |
tree | 4b73d864e468c395f6c9d484bef5a8f138a02b5e /kernel/trace/trace_kprobe.c | |
parent | b26c74e116ad8433da22a72f03d148f88aab36e5 (diff) |
tracing/probes: Split [ku]probes_fetch_type_table
Use separate fetch_type_table for kprobes and uprobes. It currently
shares all fetch methods but some of them will be implemented
differently later.
This is not to break build if [ku]probes is configured alone (like
!CONFIG_KPROBE_EVENT and CONFIG_UPROBE_EVENT). So I added '__weak'
to the table declaration so that it can be safely omitted when it
configured out.
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: 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 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index c9ffdafb9ada..fe3f00c381c0 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
@@ -88,6 +88,26 @@ 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 | /* Fetch type information table */ | ||
92 | const struct fetch_type kprobes_fetch_type_table[] = { | ||
93 | /* Special types */ | ||
94 | [FETCH_TYPE_STRING] = __ASSIGN_FETCH_TYPE("string", string, string, | ||
95 | sizeof(u32), 1, "__data_loc char[]"), | ||
96 | [FETCH_TYPE_STRSIZE] = __ASSIGN_FETCH_TYPE("string_size", u32, | ||
97 | string_size, sizeof(u32), 0, "u32"), | ||
98 | /* Basic types */ | ||
99 | ASSIGN_FETCH_TYPE(u8, u8, 0), | ||
100 | ASSIGN_FETCH_TYPE(u16, u16, 0), | ||
101 | ASSIGN_FETCH_TYPE(u32, u32, 0), | ||
102 | ASSIGN_FETCH_TYPE(u64, u64, 0), | ||
103 | ASSIGN_FETCH_TYPE(s8, u8, 1), | ||
104 | ASSIGN_FETCH_TYPE(s16, u16, 1), | ||
105 | ASSIGN_FETCH_TYPE(s32, u32, 1), | ||
106 | ASSIGN_FETCH_TYPE(s64, u64, 1), | ||
107 | |||
108 | ASSIGN_FETCH_TYPE_END | ||
109 | }; | ||
110 | |||
91 | /* | 111 | /* |
92 | * Allocate new trace_probe and initialize it (including kprobes). | 112 | * Allocate new trace_probe and initialize it (including kprobes). |
93 | */ | 113 | */ |