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 X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B64BC43381 for ; Tue, 26 Mar 2019 15:27:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23F652075E for ; Tue, 26 Mar 2019 15:27:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="naLjef0v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23F652075E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xcnHFtvfTZik58IgRLVj1IHD4VZsATIb2jdkKwBHADk=; b=naLjef0vg3DMk8i9X5HZID0jM TFdpDjmNg6MzXPVBq48WQodsEjHQENASIHD3dre/aKa/02AggOWS1aRliHTeRDFoVz8vmbYojhqoG Qz6ZGtl64j3h6ASMtZ+9DfEmvATo/zhQ9qfbFpXzqfyoIhbSWcEoVX+leTv5Drhy7dXTjTtPFZwde v8zdghn56ecSsRIeOKIpvJzBmRvzXM1ph5K23qHB14ZNP+7J/rg1db2TCVG1orpifJs6Lu4dtXCXV CQ6lxt0XIQl6sKuI3PPPF5/JZgcVO5Y8lWquqeeuHR8e4JiG9yDlZh32a2o+sOrf7j1xsLhOcHPCr J+s/aLIVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8nya-0006Ep-Te; Tue, 26 Mar 2019 15:26:56 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8nyY-0006EK-FN for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2019 15:26:55 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A62FC80D; Tue, 26 Mar 2019 08:26:51 -0700 (PDT) Received: from [10.37.12.89] (unknown [10.37.12.89]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E7FE33F614; Tue, 26 Mar 2019 08:26:49 -0700 (PDT) Subject: Re: [PATCH v2 11/16] coresight: tmc-etr: Refactor function tmc_etr_setup_perf_buf() To: mathieu.poirier@linaro.org, linux-arm-kernel@lists.infradead.org References: <20190325215632.17013-1-mathieu.poirier@linaro.org> <20190325215632.17013-12-mathieu.poirier@linaro.org> From: Suzuki K Poulose Message-ID: <216da3b1-217d-4b89-b027-854f49e3b824@arm.com> Date: Tue, 26 Mar 2019 15:29:03 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20190325215632.17013-12-mathieu.poirier@linaro.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190326_082654_514205_4B4B088E X-CRM114-Status: GOOD ( 21.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexander.shishkin@linux.intel.com, peterz@infradead.org, coresight@lists.linaro.org, Mike.Leach@arm.com, leo.yan@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 03/25/2019 09:56 PM, Mathieu Poirier wrote: > Refactoring function tmc_etr_setup_perf_buf() so that it only deals > with the high level etr_perf_buffer, and leaving the allocation of the > backend buffer (i.e etr_buf) to another function. > > That way the backend buffer allocation function can decide if it wants > to reuse an existing buffer (CPU-wide trace scenarios) or simply create > a new one. > > Signed-off-by: Mathieu Poirier Looks good to me, except for one minor nit: > --- > .../hwtracing/coresight/coresight-tmc-etr.c | 46 +++++++++++++------ > 1 file changed, 31 insertions(+), 15 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c > index 6e2c2aa130d5..79fee9341446 100644 > --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c > +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c > @@ -1159,25 +1159,13 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev) > return ret; > } > > -/* > - * tmc_etr_setup_perf_buf: Allocate ETR buffer for use by perf. > - * The size of the hardware buffer is dependent on the size configured > - * via sysfs and the perf ring buffer size. We prefer to allocate the > - * largest possible size, scaling down the size by half until it > - * reaches a minimum limit (1M), beyond which we give up. > - */ > -static struct etr_perf_buffer * > -tmc_etr_setup_perf_buf(struct tmc_drvdata *drvdata, int node, int nr_pages, > - void **pages, bool snapshot) > +static struct etr_buf * > +tmc_etr_get_etr_buf(struct tmc_drvdata *drvdata, int node, > + int nr_pages, void **pages) nit: The name tmc_etr_get_etr_buf() sounds too generic and has nothing to do with the perf. It would be good to make it explicit that it is for perf session. May be, tmc_etr_perf_get_etr_buf() ? or may be even, simply get_perf_etr_buf(). Otherwise, Reviewed-by: Suzuki K Poulose _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel