lkml.org 
[lkml]   [2016]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] perf uprobe: Skip prologue if program compiled without optimization
From
Date
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


\
 
 \ /
  Last update: 2016-08-03 14:41    [W:0.118 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site