Re: [PATCH v3 10/10] perf: perf interface for uprobes.

From: Srikar Dronamraju
Date: Sun May 09 2010 - 07:18:57 EST


> >>
> >
> > Either zfree_3329 or having a new event group for each process is
> > possible.
>
> I think adding new groups make controlling those event easier.
> (e.g. deleting all probes on exited process)
>

Okay..

>
> >> [...]
> >>> @@ -383,7 +450,11 @@ int synthesize_trace_kprobe_event(struct probe_point *pp)
> >>> pp->probes[0] = buf = zalloc(MAX_CMDLEN);
> >>> if (!buf)
> >>> die("Failed to allocate memory by zalloc.");
> >>> - ret = e_snprintf(buf, MAX_CMDLEN, "%s+%d", pp->function, pp->offset);
> >>> + if (pp->offset)
> >>> + ret = e_snprintf(buf, MAX_CMDLEN, "%s+%d", pp->function,
> >>> + pp->offset);
> >>> + else
> >>> + ret = e_snprintf(buf, MAX_CMDLEN, "%s", pp->function);
> >>> if (ret <= 0)
> >>> goto error;
> >>> len = ret;
> >>
> >> Isn't it a cleanup ?
> >
> > Can you please elaborate?
>
> symbol+offset is always allowed even if offset == 0,
> so I think this change isn't needed. I guessed it is just for cleanup.
>

kprobes has an advantage that it can make sense of kernel symbols.
However uprobes doesnt have the advantage. It cannot make any sense of
user space symbols. Hence unlike kprobes, uprobes doesnt have
symbol_name and offset fields. To overcome this the perf probe for
uprobes resolves the symbol_name, offset and pass the plain vaddr to
uprobes.

--
Thanks and Regards
Srikar Dronamraju


--
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/