tracing/kprobes: Allow kprobe-events to record module symbol

Allow kprobe-events to record module symbols.

Since data symbols in a non-loaded module doesn't exist, it fails to
define such symbol as an argument of kprobe-event. But if the kprobe
event is defined on that module, we can defer to resolve the symbol
address.

Note that if given symbol is not found, the event is kept unavailable.
User can enable it but the event is not recorded.

Link: http://lkml.kernel.org/r/153547312336.26502.11432902826345374463.stgit@devbox

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
Masami Hiramatsu
2018-08-29 01:18:43 +09:00
committed by Steven Rostedt (VMware)
parent 59158ec4ae
commit a6682814f3
3 changed files with 68 additions and 10 deletions

View File

@@ -100,6 +100,7 @@ enum fetch_op {
// Stage 5 (loop) op
FETCH_OP_LP_ARRAY, /* Array: .param = loop count */
FETCH_OP_END,
FETCH_NOP_SYMBOL, /* Unresolved Symbol holder */
};
struct fetch_insn {
@@ -116,6 +117,7 @@ struct fetch_insn {
unsigned char rshift;
};
unsigned long immediate;
void *data;
};
};
@@ -276,7 +278,7 @@ extern int traceprobe_parse_probe_arg(char *arg, ssize_t *size,
extern int traceprobe_conflict_field_name(const char *name,
struct probe_arg *args, int narg);
extern void traceprobe_update_arg(struct probe_arg *arg);
extern int traceprobe_update_arg(struct probe_arg *arg);
extern void traceprobe_free_probe_arg(struct probe_arg *arg);
extern int traceprobe_split_symbol_offset(char *symbol, long *offset);