On Mon, 1 Aug 2016 14:19:28 +0530[SNIP]
Ravi Bangoria <ravi.bangoria@xxxxxxxxxxxxxxxxxx> 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.
+Hmm, this is not enough, since perf-probe accepts registers and stacks.
+ /* 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;
At least you should check if all argument are !is_c_varname(), !PROBE_ARG_VARS and
!PROBE_ARG_PARAMS here, instead of checking nargs.
+Hmm, is <Function>:1 always available? I think we should just recommend to use only
+ 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",
the address.
(moreover, pf->addr may not the absolute address in uprobe event, we'd better say
"the address 0x%x")