Re: [PATCH v2 11/11] Uprobes traceevents patch.

From: Srikar Dronamraju
Date: Wed May 12 2010 - 10:34:19 EST


> >
> > +config UPROBE_EVENT
> > + depends on UPROBES
> > + bool "Enable uprobes-based dynamic events"
> > + select TRACING
> > + default y
> > + help
> > + This allows the user to add tracing events (similar to tracepoints)
> > + on the fly via the traceevents interface.
>
>
>
> That doesn't explain much what it does. Please explain its goal of
> creating a trace event on top of a userspace dynamic probe.
>

Okay.

>
>
> > +#define MAX_TRACE_ARGS 128
> > +#define MAX_ARGSTR_LEN 63
> > +#define MAX_EVENT_NAME_LEN 64
>
>
> This can be shared with kprobes in a new kernel/trace/dyn_probes.h
> or something.
>

Okay.

> > + ret = register_uprobe_event(tp);
> > + if (ret) {
> > + pr_warning("Faild to register probe event(%d)\n", ret);
>
>
> "Failed"

Okay.

>
>
> > + group = UPROBE_EVENT_SYSTEM;
> > +
> > + if (is_delete) {
> > + if (!event) {
> > + pr_info("Delete command needs an event name.\n");
> > + return -EINVAL;
> > + }
> > + tp = find_probe_event(event, group);
> > + if (!tp) {
> > + pr_info("Event %s/%s doesn't exist.\n", group, event);
> > + return -ENOENT;
> > + }
> > + /* delete an event */
> > + unregister_trace_uprobe(tp);
>
>
>
> Doesn't seem to be under uprobe_lock.

Agree, the unregister_trace_uprobe() has to be called after locking
uprobe_lock.

>
>
>
> > +/* Make a debugfs interface for controling probe points */
> > +static __init int init_uprobe_trace(void)
> > +{
> > + struct dentry *d_tracer;
> > + struct dentry *entry;
> > +
> > + d_tracer = tracing_init_dentry();
> > + if (!d_tracer)
> > + return 0;
> > +
> > + entry = debugfs_create_file("uprobe_events", 0644, d_tracer,
> > + NULL, &uprobe_events_ops);
> > +
> > + /* Event list interface */
> > + if (!entry)
> > + pr_warning("Could not create debugfs "
> > + "'uprobe_events' entry\n");
>
>
>
> You can use trace_create_file I think.

Okay, will check that.

>
>

--
Thanks and Regards
Srikar
--
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/