Skip to content

Commit

Permalink
perf probe: Fix to walk all inline instances
Browse files Browse the repository at this point in the history
Fix line-range collector to walk all instances of inlined function,
because some execution paths can be optimized out depending on the
function argument of instances.

E.g.)
inline_func (arg) {
	if (arg)
		do_something;
	else
		do_another;
}

func_A() {
	inline_func(1)
}

func_B() {
	inline_func(0)
}

In this case, func_A may have only do_something code and func_B may have
only do_another.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <masami.hiramatsu@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20110811110247.19900.93702.stgit@fedora15
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Masami Hiramatsu authored and Arnaldo Carvalho de Melo committed Aug 12, 2011
1 parent b0e9cb2 commit 36c0c58
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/perf/util/probe-finder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,13 @@ static int line_range_inline_cb(Dwarf_Die *in_die, void *data)
struct dwarf_callback_param *param = data;

param->retval = find_line_range_by_line(in_die, param->data);
return DWARF_CB_ABORT; /* No need to find other instances */

/*
* We have to check all instances of inlined function, because
* some execution paths can be optimized out depends on the
* function argument of instances
*/
return DWARF_CB_OK;
}

/* Search function from function name */
Expand Down

0 comments on commit 36c0c58

Please sign in to comment.