Commit 04ddd04b authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Arnaldo Carvalho de Melo

perf probe: Fix return probe support

Fix a bug to support %return probe syntax again. Previous commit 4235b045 has a
bug which disables the %return syntax on perf probe.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20100827113852.22882.87447.stgit@ltc236.sdl.hitachi.co.jp>
Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 61a52736
...@@ -1539,6 +1539,7 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev, ...@@ -1539,6 +1539,7 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev,
goto error; goto error;
} }
tev->point.offset = pev->point.offset; tev->point.offset = pev->point.offset;
tev->point.retprobe = pev->point.retprobe;
tev->nargs = pev->nargs; tev->nargs = pev->nargs;
if (tev->nargs) { if (tev->nargs) {
tev->args = zalloc(sizeof(struct probe_trace_arg) tev->args = zalloc(sizeof(struct probe_trace_arg)
......
...@@ -783,6 +783,16 @@ static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf) ...@@ -783,6 +783,16 @@ static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf)
/* This function has no name. */ /* This function has no name. */
tev->point.offset = (unsigned long)pf->addr; tev->point.offset = (unsigned long)pf->addr;
/* Return probe must be on the head of a subprogram */
if (pf->pev->point.retprobe) {
if (tev->point.offset != 0) {
pr_warning("Return probe must be on the head of"
" a real function\n");
return -EINVAL;
}
tev->point.retprobe = true;
}
pr_debug("Probe point found: %s+%lu\n", tev->point.symbol, pr_debug("Probe point found: %s+%lu\n", tev->point.symbol,
tev->point.offset); tev->point.offset);
......
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