aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace_kprobe.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 96e1944229be..72d0c65c8676 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -243,7 +243,11 @@ static int probe_arg_string(char *buf, size_t n, struct fetch_func *ff)
243 ret = snprintf(buf, n, "@0x%p", ff->data); 243 ret = snprintf(buf, n, "@0x%p", ff->data);
244 else if (ff->func == fetch_symbol) { 244 else if (ff->func == fetch_symbol) {
245 struct symbol_cache *sc = ff->data; 245 struct symbol_cache *sc = ff->data;
246 ret = snprintf(buf, n, "@%s%+ld", sc->symbol, sc->offset); 246 if (sc->offset)
247 ret = snprintf(buf, n, "@%s%+ld", sc->symbol,
248 sc->offset);
249 else
250 ret = snprintf(buf, n, "@%s", sc->symbol);
247 } else if (ff->func == fetch_retvalue) 251 } else if (ff->func == fetch_retvalue)
248 ret = snprintf(buf, n, "$retval"); 252 ret = snprintf(buf, n, "$retval");
249 else if (ff->func == fetch_stack_address) 253 else if (ff->func == fetch_stack_address)
@@ -762,10 +766,12 @@ static int probes_seq_show(struct seq_file *m, void *v)
762 seq_printf(m, "%c", probe_is_return(tp) ? 'r' : 'p'); 766 seq_printf(m, "%c", probe_is_return(tp) ? 'r' : 'p');
763 seq_printf(m, ":%s/%s", tp->call.system, tp->call.name); 767 seq_printf(m, ":%s/%s", tp->call.system, tp->call.name);
764 768
765 if (tp->symbol) 769 if (!tp->symbol)
770 seq_printf(m, " 0x%p", tp->rp.kp.addr);
771 else if (tp->rp.kp.offset)
766 seq_printf(m, " %s+%u", probe_symbol(tp), tp->rp.kp.offset); 772 seq_printf(m, " %s+%u", probe_symbol(tp), tp->rp.kp.offset);
767 else 773 else
768 seq_printf(m, " 0x%p", tp->rp.kp.addr); 774 seq_printf(m, " %s", probe_symbol(tp));
769 775
770 for (i = 0; i < tp->nr_args; i++) { 776 for (i = 0; i < tp->nr_args; i++) {
771 ret = probe_arg_string(buf, MAX_ARGSTR_LEN, &tp->args[i].fetch); 777 ret = probe_arg_string(buf, MAX_ARGSTR_LEN, &tp->args[i].fetch);