Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1455769

Re: [PATCH] perf uprobe: Skip prologue if program compiled without optimization

From Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] perf uprobe: Skip prologue if program compiled without optimization
Date 2016-08-03 14:10 +0200
Message-ID <s239M-2mN-41@gated-at.bofh.it> (permalink)
References <s1heN-40C-7@gated-at.bofh.it> <s1JkJ-5Nl-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] perf uprobe: Skip prologue if program compiled without optimization Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-01 11:00 +0200
  Re: [PATCH] perf uprobe: Skip prologue if program compiled without  optimization Masami Hiramatsu <mhiramat@kernel.org> - 2016-08-02 17:00 +0200
    Re: [PATCH] perf uprobe: Skip prologue if program compiled without  optimization Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-03 14:10 +0200

csiph-web