lkml.org 
[lkml]   [2010]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 11/11] Uprobes traceevents patch.
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.



\
 
 \ /
  Last update: 2010-05-12 17:17    [W:0.139 / U:17.716 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site