All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Arnaldo Carvalho de Melo <acme@redhat.com>, Ingo Molnar <mingo@elte.hu>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Pekka Enberg <penberg@kernel.org>,
	linux-kernel@vger.kernel.org, yrl.pp-manager.tt@hitachi.com,
	Masami Hiramatsu <masami.hiramatsu@gmail.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Subject: [PATCH -tip v2 4/9] [BUGFIX] perf probe: Fix to walk all inline instances
Date: Thu, 11 Aug 2011 20:02:47 +0900	[thread overview]
Message-ID: <20110811110247.19900.93702.stgit@fedora15> (raw)
In-Reply-To: <20110811110220.19900.54963.stgit@fedora15>

Fix line-range collector to walk all instances of inlined
function, because some execution paths can be optimized out
depends 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.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@gmail.com>
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@ghostprotocols.net>
---

 tools/perf/util/probe-finder.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 573c723..d6d5768 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -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 */


  parent reply	other threads:[~2011-08-11 11:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 11:02 [PATCH -tip v2 0/9]perf probe bugfixes Masami Hiramatsu
2011-08-11 11:02 ` [PATCH -tip v2 1/9] [BUGFIX] perf-probe: Fix a memory leak for scopes array Masami Hiramatsu
2011-08-14 15:39   ` [tip:perf/core] perf probe: " tip-bot for Masami Hiramatsu
2011-08-11 11:02 ` [PATCH -tip v2 2/9] [BUGFIX] perf probe: Fix line walker to check CU correctly Masami Hiramatsu
2011-08-14 15:40   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:02 ` [PATCH -tip v2 3/9] [BUGFIX] perf probe: Fix to search nested inlined functions in CU Masami Hiramatsu
2011-08-14 15:41   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:02 ` Masami Hiramatsu [this message]
2011-08-14 15:42   ` [tip:perf/core] perf probe: Fix to walk all inline instances tip-bot for Masami Hiramatsu
2011-08-11 11:02 ` [PATCH -tip v2 5/9] [BUGFIX] perf probe: Warn when more than one line are given Masami Hiramatsu
2011-08-14 15:44   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:02 ` [PATCH -tip v2 6/9] [BUGFIX] perf probe: Fix to search local variables in appropriate scope Masami Hiramatsu
2011-08-14 15:45   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:03 ` [PATCH -tip v2 7/9] [BUGFIX] perf probe: Avoid searching variables in intermediate scopes Masami Hiramatsu
2011-08-14 15:47   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:03 ` [PATCH -tip v2 8/9] [BUGFIX] perf probe: Search concrete out-of-line instances Masami Hiramatsu
2011-08-14 15:48   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:03 ` [PATCH -tip v2 9/9] [BUGFIX] perf probe: Filter out redundant inline-instances Masami Hiramatsu
2011-08-14 15:50   ` [tip:perf/core] " tip-bot for Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110811110247.19900.93702.stgit@fedora15 \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu@gmail.com \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=penberg@kernel.org \
    --cc=peterz@infradead.org \
    --cc=yrl.pp-manager.tt@hitachi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.