Commit 52a11f35 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Ingo Molnar

trace_kprobes: Don't output zero offset

"symbol_name+0" is not so friendly.
It makes the output longer.
Signed-off-by: default avatarLai Jiangshan <>
Acked-by: default avatarMasami Hiramatsu <>
Cc: Steven Rostedt <>
Cc: Frederic Weisbecker <>
LKML-Reference: <>
Signed-off-by: default avatarIngo Molnar <>
parent 3d9b2e1d
......@@ -243,7 +243,11 @@ static int probe_arg_string(char *buf, size_t n, struct fetch_func *ff)
ret = snprintf(buf, n, "@0x%p", ff->data);
else if (ff->func == fetch_symbol) {
struct symbol_cache *sc = ff->data;
ret = snprintf(buf, n, "@%s%+ld", sc->symbol, sc->offset);
if (sc->offset)
ret = snprintf(buf, n, "@%s%+ld", sc->symbol,
ret = snprintf(buf, n, "@%s", sc->symbol);
} else if (ff->func == fetch_retvalue)
ret = snprintf(buf, n, "$retval");
else if (ff->func == fetch_stack_address)
......@@ -762,10 +766,12 @@ static int probes_seq_show(struct seq_file *m, void *v)
seq_printf(m, "%c", probe_is_return(tp) ? 'r' : 'p');
seq_printf(m, ":%s/%s", tp->call.system, tp->;
if (tp->symbol)
if (!tp->symbol)
seq_printf(m, " 0x%p", tp->;
else if (tp->
seq_printf(m, " %s+%u", probe_symbol(tp), tp->;
seq_printf(m, " 0x%p", tp->;
seq_printf(m, " %s", probe_symbol(tp));
for (i = 0; i < tp->nr_args; i++) {
ret = probe_arg_string(buf, MAX_ARGSTR_LEN, &tp->args[i].fetch);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment