From patchwork Tue Apr 12 17:54:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 65647 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2059915qge; Tue, 12 Apr 2016 10:56:27 -0700 (PDT) X-Received: by 10.66.235.9 with SMTP id ui9mr6411715pac.135.1460483787311; Tue, 12 Apr 2016 10:56:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i62si11088098pfi.222.2016.04.12.10.56.26; Tue, 12 Apr 2016 10:56:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934220AbcDLR4K (ORCPT + 29 others); Tue, 12 Apr 2016 13:56:10 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33918 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934199AbcDLRzU (ORCPT ); Tue, 12 Apr 2016 13:55:20 -0400 Received: by mail-pa0-f51.google.com with SMTP id ot11so17477792pab.1 for ; Tue, 12 Apr 2016 10:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xtJMKxPs7x3AzD92swUSA3FLotyPDuHGH388JYlbUwU=; b=Tg5C6XtuKNr3S7FDSmfyT/ZCz8PeIB7l+rPndHUT9EIyWv/0Qr86tJh52B6ugkLmyQ osk0OMlfPJTI2Xg1/265zZF3IMvjXWO46/1Sltc4KfwPEh67FcxkdR5mia+eB1KIsJOK dyhGfxQ7q80gvyBSU8TcY+oGRxyT84l8g2OQM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xtJMKxPs7x3AzD92swUSA3FLotyPDuHGH388JYlbUwU=; b=C/wim2dZzQj4tfELgZcv/83z2DbNZ5OYIhi1fULaMvMglhVpI7HtwePpX8wxU+XHUq 1Gw2ftyisILv3n6TsDC8aPtR1OwyCnZOPD0L0ZGhlwskaTT4mfNWb6iP9vwxs5EoMQ8f hcRRz8E4gPf6B7QWTwc5DKn5p5aq1poILCzmwWzF69rMAjb4wDTT9lOLX4ZrYStKdAAP IjRYdOFAwQ31ZKvYQxmOV+HFoMlTszv5ra9rleKlLsutwFK5okExafdR3ldSDHoiq2QO wGEUnZDfexZ20XAVCslo4nRv2vJk5bj9gEkRPh84cb/n6A7MhclkKs15tv11YfI5q38q zJ8Q== X-Gm-Message-State: AOPr4FWIejuvN5fsjpS++sj37sLx7WKqzZAzd1oSWA3EtFoSPXmy4XJrbv4RlL1Cy8k23gDP X-Received: by 10.66.157.69 with SMTP id wk5mr6290320pab.40.1460483713190; Tue, 12 Apr 2016 10:55:13 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id p189sm24633204pfb.51.2016.04.12.10.55.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Apr 2016 10:55:12 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org, Suzuki.Poulose@arm.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH V2 10/15] coresight: tmc: dump system memory content only when needed Date: Tue, 12 Apr 2016 11:54:47 -0600 Message-Id: <1460483692-25061-11-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460483692-25061-1-git-send-email-mathieu.poirier@linaro.org> References: <1460483692-25061-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Calling tmc_etf/etr_dump_hw() is required only when operating from sysFS. When working from Perf, the system memory is harvested from the AUX trace API. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 7 ++++++- drivers/hwtracing/coresight/coresight-tmc-etr.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) -- 2.5.0 diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index 5908000e1ae0..9b4cdaed09f5 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -74,7 +74,12 @@ static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata) CS_UNLOCK(drvdata->base); tmc_flush_and_stop(drvdata); - tmc_etb_dump_hw(drvdata); + /* + * When operating in sysFS mode the content of the buffer needs to be + * read before the TMC is disabled. + */ + if (local_read(&drvdata->mode) == CS_MODE_SYSFS) + tmc_etb_dump_hw(drvdata); tmc_disable_hw(drvdata); CS_LOCK(drvdata->base); diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index 8e6fe267195a..de5cf0056802 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -76,7 +76,12 @@ static void tmc_etr_disable_hw(struct tmc_drvdata *drvdata) CS_UNLOCK(drvdata->base); tmc_flush_and_stop(drvdata); - tmc_etr_dump_hw(drvdata); + /* + * When operating in sysFS mode the content of the buffer needs to be + * read before the TMC is disabled. + */ + if (local_read(&drvdata->mode) == CS_MODE_SYSFS) + tmc_etr_dump_hw(drvdata); tmc_disable_hw(drvdata); CS_LOCK(drvdata->base);