From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7645CA0ED3 for ; Mon, 11 Sep 2023 21:48:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350872AbjIKVl4 (ORCPT ); Mon, 11 Sep 2023 17:41:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238201AbjIKNsL (ORCPT ); Mon, 11 Sep 2023 09:48:11 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B782F5 for ; Mon, 11 Sep 2023 06:48:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72E6AC433C8; Mon, 11 Sep 2023 13:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694440084; bh=tZjNgp5w5X2nAKm6d529QBvoKD0IYwoOKckVncspda8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Fk3tZGaUA4P4Vstt5keBYL28ZnV9YoCwN0vbkzhDe6sxhs2VFf8Kru68p0zL5sLWU Yofxq1//B2niPI+iVtau5bxgYbRREsj9L7CdKZF47E4JPXdNr2yJY5TrTvQa6iAIff CffxISpW0jVYLfj6CZIbItyEbbB36V7q8D3BgnTE= Date: Mon, 11 Sep 2023 15:48:01 +0200 From: Greg Kroah-Hartman To: Linyu Yuan Cc: Thinh Nguyen , Peter Chen , Pawel Laszczak , Roger Quadros , Linus Walleij , Chunfeng Yun , Neal Liu , Cristian Birsan , Bin Liu , Kevin Cernekee , Justin Chen , Al Cooper , Li Yang , Vladimir Zapolskiy , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Philipp Zabel , Herve Codina , hierry Reding , Jonathan Hunter , Michal Simek , Rui Miguel Silva , Valentina Manea , Shuah Khan , Hongren Zheng , linux-usb@vger.kernel.org Subject: Re: [PATCH v2 00/11] usb: gadget: reduce usb gadget trace event buffer usage Message-ID: <2023091135-gave-phoniness-bf17@gregkh> References: <20230911112446.1791-1-quic_linyyuan@quicinc.com> <2023091141-outbound-turmoil-edda@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Mon, Sep 11, 2023 at 09:44:21PM +0800, Linyu Yuan wrote: > > On 9/11/2023 9:32 PM, Greg Kroah-Hartman wrote: > > On Mon, Sep 11, 2023 at 07:24:35PM +0800, Linyu Yuan wrote: > > > some trace event use an interger to to save a bit field info of gadget, > > > also some trace save endpoint name in string forat, it all can be > > > chagned to other way at trace event store phase. > > > > > > bit field can be replace with a union interger member which include > > > multiple bit fields. > > > > > > ep name stringe can be replace to a interger which contaion number > > > and dir info. > > Ok, but how much memory did you actually save here? Is the memory saved > > only if tracing is enbaled, or it is always? Is there a speed penality > > for these changes or is it the same? > > yes, it is save trace ring buffer only when tracing enabled, as save less > data, speed is higher. Are you sure? You now have to parse the data, so how is it faster? > it is help when enable trace for a long period. Help exactly how? What is saved exactly, and what about cpu usage? > for a single trace entry, take struct usb_gadget as example, at worst case, > it save (19 dword  - 1 dword) / 19dword = 94% buffer. > > for ep name, it only need 4 bytes/  (4bytes + 9bytes ) = 30%. And this buffer size reduction shows up where? Are you trading space for CPU time? Somehow you are ending up with the same information in userspace, so where are the tradeoffs? thanks, greg k-h