Re: [PATCH v2 11/11] Uprobes traceevents patch.
From: Frederic Weisbecker
Date: Wed May 12 2010 - 11:15:31 EST
On Wed, Mar 31, 2010 at 09:23:11PM +0530, Srikar Dronamraju wrote:
> +static void uprobe_trace_func(struct uprobe *up, struct pt_regs *regs)
> +{
> + struct trace_uprobe *tp = container_of(up, struct trace_uprobe, up);
> + struct uprobe_trace_entry *entry;
> + struct ring_buffer_event *event;
> + struct ring_buffer *buffer;
> + int size, i, pc;
> + unsigned long irq_flags;
> + struct ftrace_event_call *call = &tp->call;
> +
> + tp->nhit++;
> +
> + local_save_flags(irq_flags);
> + pc = preempt_count();
> +
> + size = SIZEOF_UPROBE_TRACE_ENTRY(tp->nr_args);
> +
> + event = trace_current_buffer_lock_reserve(&buffer, call->id, size,
> + irq_flags, pc);
> + if (!event)
> + return;
> +
> + entry = ring_buffer_event_data(event);
> + entry->nargs = tp->nr_args;
> + entry->ip = (unsigned long)up->vaddr;
> + for (i = 0; i < tp->nr_args; i++)
> + entry->args[i] = call_fetch(&tp->args[i].fetch, regs);
> +
> + if (!filter_current_check_discard(buffer, call, entry, event))
> + trace_nowake_buffer_unlock_commit(buffer, event, irq_flags, pc);
You can use the non-nowake version I think. nowake is for events that might
occur when we hold the rq lock, hence when it's too dangerous to wake up.
It doesn't seem to be the case since we came here after a trap in userspace.
--
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/