All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	mingo@redhat.com, acme@kernel.org,
	alexander.shishkin@linux.intel.com, wangnan0@huawei.com,
	hemant@linux.vnet.ibm.com, naveen.n.rao@linux.vnet.ibm.com,
	Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: Re: [PATCH] perf uprobe: Skip prologue if program compiled without optimization
Date: Wed, 3 Aug 2016 14:32:00 +0530	[thread overview]
Message-ID: <57A1B308.7070606@linux.vnet.ibm.com> (raw)
In-Reply-To: <20160802235230.31bb9a50d88e4838926f5609@kernel.org>

Thanks Masami,

On Tuesday 02 August 2016 08:22 PM, Masami Hiramatsu wrote:
> On Mon,  1 Aug 2016 14:19:28 +0530
> Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> wrote:
>
>> Function prologue prepares stack and registers before executing function
>> logic. When target program is compiled without optimization, function
>> parameter information is only valid after prologue. When we probe entrypc
>> of the function, and try to record function parameter, it contains
>> garbage value.
>>
[SNIP]
>> +
>> +	/* Only FUNC and FUNC@SRC are eligible. */
>> +	if (!pp->function || pp->line || pp->retprobe || pp->lazy_line ||
>> +	    pp->offset || pp->abs_address)
>> +		return;
>> +
>> +	/* Not interested in func parameter? */
>> +	if (!pf->pev->nargs)
>> +		return;
> Hmm, this is not enough, since perf-probe accepts registers and stacks.
> At least you should check if all argument are !is_c_varname(), !PROBE_ARG_VARS and
> !PROBE_ARG_PARAMS here, instead of checking nargs.
>
>> +
>> +	pr_info("Target program is compiled without optimization. Skipping prologue.\n"
>> +		"Use %s:1 or absolute address 0x%lx to force probe on entry point.\n\n",
> Hmm, is <Function>:1 always available? I think we should just recommend to use only
> the address.
> (moreover, pf->addr may not the absolute address in uprobe event, we'd better say
>   "the address 0x%x")

Nice catch. :)

Sent v2. Please review it.

-Ravi

      reply	other threads:[~2016-08-03 12:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01  8:49 [PATCH] perf uprobe: Skip prologue if program compiled without optimization Ravi Bangoria
2016-08-02 14:52 ` Masami Hiramatsu
2016-08-03  9:02   ` Ravi Bangoria [this message]

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=57A1B308.7070606@linux.vnet.ibm.com \
    --to=ravi.bangoria@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=wangnan0@huawei.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.