From patchwork Fri Apr 22 17:14:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 66481 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp839841qge; Fri, 22 Apr 2016 10:16:34 -0700 (PDT) X-Received: by 10.98.87.11 with SMTP id l11mr4244543pfb.95.1461345394111; Fri, 22 Apr 2016 10:16:34 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 190si7790147pfd.96.2016.04.22.10.16.33; Fri, 22 Apr 2016 10:16:34 -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 S932480AbcDVROn (ORCPT + 29 others); Fri, 22 Apr 2016 13:14:43 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:33226 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932445AbcDVROj (ORCPT ); Fri, 22 Apr 2016 13:14:39 -0400 Received: by mail-io0-f181.google.com with SMTP id f89so100831674ioi.0 for ; Fri, 22 Apr 2016 10:14:39 -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=UezPf367NXa2Od4jV4YsreqzH5IR+Ry6/8EBlNHev5Q=; b=TJVFGlmcHdHloHbHkDK6SGDBFfFp8DWOQKJcfJHkYIiBgZXkKDrBcbmBxHYXrO7NLy t+Cve3sfNwtaw+HbVB1xXCYGmCM6DKtn3H3zq3lk+NJj8rkCYitdXkt96vUCEcCPtLMf C5KNR968NrLO+yJGLm1w4GZw+G3gJz6YhmHF8= 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=UezPf367NXa2Od4jV4YsreqzH5IR+Ry6/8EBlNHev5Q=; b=iWZ9aOwCZOL2yjzpOMUSppG02ggkd0Li9tWjbyWLP+vHRYTnslra9IioNHsuPWDMw6 rRyzRWW8Xu5fSd9mbvUnfdzZIlcB4FITlhr+GbFKlUr6GA65JD3lHf3TiPfWYkud5kZE +KQc1V4hyeq4dXQLoIWvfTgYeL7n0pZvZ80t5oN7WtrZaV94EX/IDdUl+6eHKXFjZRi3 IQA5qfahRbotRwnsgWEz1n0/uT8IkGZci3yOD8CX9VLGSKqLgaGUiZGOYHkvwCsq7sdu vRSuoRWpCm539n/8oNLbqNKtLXKh27iF0B+24fiveiHVWUri6Tiabl7rMr/diJ8cBFVx SlFA== X-Gm-Message-State: AOPr4FX1L0dxD1tiluLQznWyl1EVz4Ue5zEtf5Szn4vzRNwcOizMBrD3mhr8bR7AVSDfZje+ X-Received: by 10.107.138.33 with SMTP id m33mr2570126iod.181.1461345278703; Fri, 22 Apr 2016 10:14:38 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id vg8sm1975886igb.15.2016.04.22.10.14.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Apr 2016 10:14:37 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org, Suzuki.Poulose@arm.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH V3 12/18] coresight: tmc: dump system memory content only when needed Date: Fri, 22 Apr 2016 11:14:09 -0600 Message-Id: <1461345255-11758-13-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1461345255-11758-1-git-send-email-mathieu.poirier@linaro.org> References: <1461345255-11758-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 d090a9745c73..25fad93b68d4 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 8bbbf3ab1387..4b000f4003a2 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);