lkml.org 
[lkml]   [2017]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] usb: gadget: functions: add ftrace export over USB
From
Date
Hi Felipe,

On Friday 09 June 2017 11:43 AM, Felipe Balbi wrote:
> +static void notrace ftrace_write(struct trace_export *ftrace, const void *buf,
> + unsigned int len)
> +{
> + struct usb_ftrace *trace = ftrace_to_trace(ftrace);
> + struct usb_request *req = next_request(&trace->list);
> +
> + if (!req)
> + return;
> +
> + if (!trace->in->enabled)
> + return;
> +
> + req->buf = kmemdup(buf, len, GFP_ATOMIC);

Probably we can avoid the copy of trace data.

We can make write() call of "struct trace_export" as posted. Can have a
write_complete() callback function implemented in struct trace_export,which
can be called from your ftrace_complete().

We need to execute __buffer_unlock_commit() only in write_complete() in case
of ftrace_export is enabled.


> + req->length = len;
> + req->context = trace;
> + req->complete = ftrace_complete;
> + list_move_tail(&req->list, &trace->pending);
> +
> + schedule_work(&trace->queue_work);
> +}
> +

--
Pratyush

\
 
 \ /
  Last update: 2017-07-14 07:32    [W:2.076 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site