linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
	David Ahern <dsahern@gmail.com>,
	linux-kernel@vger.kernel.org,
	"Steven Rostedt (Red Hat)" <rostedt@goodmis.org>,
	Oleg Nesterov <oleg@redhat.com>, Ingo Molnar <mingo@redhat.com>,
	"David A. Long" <dave.long@linaro.org>,
	yrl.pp-manager.tt@hitachi.com
Subject: Re: [PATCH -tip v2 4/8] perf-probe: Use _stext based address instead of the symbol name
Date: Mon, 03 Feb 2014 17:32:30 +0900	[thread overview]
Message-ID: <52EF541E.8040802@hitachi.com> (raw)
In-Reply-To: <87d2j43aav.fsf@sejong.aot.lge.com>

(2014/02/03 16:49), Namhyung Kim wrote:
> On Wed, 29 Jan 2014 09:14:59 +0000, Masami Hiramatsu wrote:
>> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
>> index 4a9f43b..120954b 100644
>> --- a/tools/perf/util/probe-event.c
>> +++ b/tools/perf/util/probe-event.c
>> @@ -387,6 +387,44 @@ static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
>>  	return ret;
>>  }
>>  
>> +/* Post processing the probe events */
>> +static int post_process_probe_trace_events(struct probe_trace_event *tevs,
>> +					   int ntevs, const char *module,
>> +					   bool uprobe)
>> +{
>> +	struct symbol *sym;
>> +	struct map *map;
>> +	unsigned long stext = 0;
>> +	char *tmp;
>> +	int i;
>> +
>> +	if (uprobe)
>> +		return add_exec_to_probe_trace_events(tevs, ntevs, module);
>> +
>> +	/* Note that currently _stext based probe is not for drivers */
>> +	if (module)
>> +		return add_module_to_probe_trace_events(tevs, ntevs, module);
>> +
>> +	sym = __find_kernel_function_by_name("_stext", &map);
> 
> Couldn't we just use kmap->ref_reloc_sym instead of the hard-coded
> "_stext"?  You might want to check the Adrian's recent kaslr fixes (now
> in tip/perf/urgent).

Yeah, I just found Adrian's work and this series must be updated for that,
because symbol's address is now based on the real (relocated) address.
OK, I'll try to use a symbol in ref_reloc_sym. ;) Thank you for pointed it out!

Thanks!

-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



  reply	other threads:[~2014-02-03  8:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29  9:14 [PATCH -tip v2 0/8] perf-probe: Updates for handling local functions correctly Masami Hiramatsu
2014-01-29  9:14 ` [PATCH -tip v2 1/8] [BUGFIX] perf-probe: Fix to do exit call for symbol maps Masami Hiramatsu
2014-02-03  7:41   ` Namhyung Kim
2014-02-03  8:19     ` Masami Hiramatsu
2014-01-29  9:14 ` [PATCH -tip v2 2/8] perf-probe: Remove incorrect symbol check for --list Masami Hiramatsu
2014-01-29  9:14 ` [PATCH -tip v2 3/8] perf-probe: Show in what binaries/modules probes are set Masami Hiramatsu
2014-01-29  9:14 ` [PATCH -tip v2 4/8] perf-probe: Use _stext based address instead of the symbol name Masami Hiramatsu
2014-02-03  7:49   ` Namhyung Kim
2014-02-03  8:32     ` Masami Hiramatsu [this message]
2014-02-04  9:49       ` Masami Hiramatsu
2014-02-04 10:05         ` Masami Hiramatsu
2014-01-29  9:15 ` [PATCH -tip v2 5/8] perf-probe: Retry to find given address from offline dwarf Masami Hiramatsu
2014-01-29  9:15 ` [PATCH -tip v2 6/8] perf-probe: Show appropriate symbol for _stext based kprobes Masami Hiramatsu
2014-01-29  9:15 ` [PATCH -tip v2 7/8] perf-probe: Show source-level or symbol-level info for uprobes Masami Hiramatsu
2014-01-29  9:15 ` [PATCH -tip v2 8/8] perf-probe: Allow to add events on the local functions 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=52EF541E.8040802@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=acme@ghostprotocols.net \
    --cc=dave.long@linaro.org \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=oleg@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=srikar@linux.vnet.ibm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).