Re: [PATCHv10 2.6.35-rc6-tip 11/14] perf: perf interface for uprobes

From: Masami Hiramatsu
Date: Thu Jul 29 2010 - 08:02:00 EST


Hi Srikar,

Srikar Dronamraju wrote:
> Enhances perf probe to accept pid and user vaddr.
> Provides very basic support for uprobes.
[...]
> @@ -162,6 +190,14 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
> bool need_dwarf = perf_probe_event_need_dwarf(pev);
> int fd, ntevs;
>
> + if (pev->upid) {
> + if (need_dwarf) {
> + pr_warning("Debuginfo-analysis is not supported.\n");

This should be "Debuginfo-analysis is not supported with -p/--pid option.\n"

> + return -ENOSYS;
> + }
> + return convert_name_to_addr(pev);
> + }
> +



And I found a small bug.

# ./perf probe -vf -p 3199 "setenv %ax"
probe-definition(0): setenv %ax
symbol:setenv file:(null) line:0 offset:0 return:0 lazy:(null)
parsing arg: %ax into %ax
1 arguments
Opening /debug/tracing/uprobe_events write=1
Add new event:
Writing event: p:probe_3199/setenv 3199:0x47e680
%ax
Failed to write event: Invalid argument
Error: Failed to add events. (-1)

# ./perf probe -l
probe_3199:setenv (on 3199:0x000000000047e680)

When writing an event, there is a "\n" right after probe point (3199:0x47e680\n)

> @@ -1066,10 +1213,22 @@ char *synthesize_probe_trace_command(struct probe_trace_event *tev)
> if (buf == NULL)
> return NULL;
>
> - len = e_snprintf(buf, MAX_CMDLEN, "%c:%s/%s %s+%lu",
> - tp->retprobe ? 'r' : 'p',
> - tev->group, tev->event,
> - tp->symbol, tp->offset);
> + if (tev->upid)
> + len = e_snprintf(buf, MAX_CMDLEN, "%c:%s/%s %d:%s\n",

Here is a "\n".


Thank you,

--
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@xxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/