Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753132AbdGNG4g (ORCPT ); Fri, 14 Jul 2017 02:56:36 -0400 Received: from mga04.intel.com ([192.55.52.120]:4240 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbdGNG4f (ORCPT ); Fri, 14 Jul 2017 02:56:35 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,357,1496127600"; d="asc'?scan'208";a="878804116" From: Felipe Balbi To: Pratyush Anand , Alexander Shishkin , Steven Rostedt , Ingo Molnar Cc: Linux USB , linux-kernel@vger.kernel.org, Chunyan Zhang Subject: Re: [PATCH] usb: gadget: functions: add ftrace export over USB In-Reply-To: <16a6940d-d071-cd2d-5911-dad427a13cb0@redhat.com> References: <20170609061327.17899-1-felipe.balbi@linux.intel.com> <16a6940d-d071-cd2d-5911-dad427a13cb0@redhat.com> Date: Fri, 14 Jul 2017 09:56:12 +0300 Message-ID: <87d1935wxf.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2144 Lines: 67 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Pratyush Anand writes: > Hi Felipe, > > On Friday 09 June 2017 11:43 AM, Felipe Balbi wrote: >> +static void notrace ftrace_write(struct trace_export *ftrace, const voi= d *buf, >> + unsigned int len) >> +{ >> + struct usb_ftrace *trace =3D ftrace_to_trace(ftrace); >> + struct usb_request *req =3D next_request(&trace->list); >> + >> + if (!req) >> + return; >> + >> + if (!trace->in->enabled) >> + return; >> + >> + req->buf =3D kmemdup(buf, len, GFP_ATOMIC); > > Probably we can avoid the copy of trace data. not with current setup. I have no control over data's lifetime. If I did, then this would be zero-copy. > We can make write() call of "struct trace_export" as posted. Can have a=20 that would require further patching in trace core which is not part of $subject. Also, if we turn this into asynchronous calls, we could run out of trace buffer before the first chunk of data is transferred over to the other side. > write_complete() callback function implemented in struct trace_export,wh= ich=20 > can be called from your ftrace_complete(). well, you're welcome to propose a patch :-) =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlloawwACgkQzL64meEa mQZ9xQ//ZYo4Dh14FXkKZzcNHDFRupBwVzfSlsw1ybTn8ZWqh41wa25N5x7qhSC2 /iSkYL50y4G9/tl+sUoqpQsRZDx0A6UV+LcyE3YSy+ywiSt7nFU4y3MZXEEgrgkQ oIH68/YeTONgXMsIGEWTLGRLgmbvSjtcuDZGaI6T95WOMVvwtfOUgG079JPw5+C+ P4/H6r4rr9oVUv65rvK9HihmQQan/PtSmTv90W0JsjQ1RKZ3Z4fTsJp3fr4CEhDW Bn0lK78wuZDpzU4O6P0krdaWlPaIYJOKoSn/mfdIeeaO1HkvCWBxRSk9qaBQmQ15 H7B2I59uKruUGR8icHrVPi+hBIGy8V3wYdiRYbvurmp8RP6hhyg7HIY/aVrgKL1P LFSRT4BhTtfUlyYS5iJDW8kFyK0kcMU/irvkj82QBSrpkmOfqrL85k1OZXo29Gh5 KRYFqut/73mesakIqyHAgXy40+EIz7SuYdYiK7LP+yqBhN/ks0QK0Ckvgb8JRiA5 MObowpK2Mju6hwtdNY8fufUQSLVciB5z9S3NAHxUimm+5ZH6zKHe7asFr8Zo6FPf M0PZemLzaddUMt803GKWwCQ81lG7vEaRRspgy2S63FFCgjNMkhBtdrkcZTTAHJtd 2L0jjKy7SRlaVAPkShh3fP7hUyFv0+0DbchHqOlKz2q8PGYh0Zs= =U6Rj -----END PGP SIGNATURE----- --=-=-=--