From patchwork Mon Jul 18 19:51:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 72248 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp290784qga; Mon, 18 Jul 2016 12:51:57 -0700 (PDT) X-Received: by 10.66.86.103 with SMTP id o7mr59154200paz.5.1468871513223; Mon, 18 Jul 2016 12:51:53 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si5016786pfi.276.2016.07.18.12.51.52; Mon, 18 Jul 2016 12:51:53 -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 S1752391AbcGRTvs (ORCPT + 29 others); Mon, 18 Jul 2016 15:51:48 -0400 Received: from mail-io0-f175.google.com ([209.85.223.175]:35071 "EHLO mail-io0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752164AbcGRTvj (ORCPT ); Mon, 18 Jul 2016 15:51:39 -0400 Received: by mail-io0-f175.google.com with SMTP id m101so363985ioi.2 for ; Mon, 18 Jul 2016 12:51: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=GxCjcaIvjIgD6rxFu73h61ikJdNRmYuKn/NkoY/PUHA=; b=jLvgOGxg8INYs6JKXnXlrm6cuW2DfE0MseDvMZYNBLvuwQZJZZacwElgdHUrpGgi/d iI5nEl9EmN+yJp47Q6/IQiGmIQ3ty40fQujL4ssdwXLusIG/V1K0iQ/sae+Eu3cUrkL2 ji2Xd/kUR5yWX6pZWvyE8sQQ1bNBSQhTZ7Hlg= 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=GxCjcaIvjIgD6rxFu73h61ikJdNRmYuKn/NkoY/PUHA=; b=A4UZ72omm6A7TPouG15Qr/8bZtKY24jOkRN4sjtc1GckfovWWxkfBpu5QKnSYH0M0B nP8WFTxCUptKZ3paKLgBMMx+MxByJyxumiowijBdUQimTYS+9EyGOekF6OZ+4bnOj9+Y +sOHj7n5oYcxCrc9BV8ucjyYdGoglJQgaK3iPfEnpZQL6GPuBNCNct8iJ85/ANPYRyQO CTo3bdzsOv2TRP+aWfNUhacXcT5aGTlnLu0lznVbmGBbJlWGCfGChQ0cc9+m9Ra946p3 0pYsYWNjwvtIwhnW0mQ6QZ0TNmPdePwWN8xlqfZp0ndbHYqJ+yvznWoToVIaqNQc2jUU N5aw== X-Gm-Message-State: ALyK8tKDR3HwtNLw4BaMiy5VhSud6wCLLl7OVh40W5KbzgNnNTyynYGlhm1cvrs+V3eMfMLj X-Received: by 10.107.201.135 with SMTP id z129mr40565754iof.114.1468871498353; Mon, 18 Jul 2016 12:51:38 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r128sm5270676ita.6.2016.07.18.12.51.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jul 2016 12:51:37 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, Mathieu Poirier Subject: [PATCH 04/10] coresight: etm4x: split default and filter configuration Date: Mon, 18 Jul 2016 13:51:25 -0600 Message-Id: <1468871491-10997-5-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468871491-10997-1-git-send-email-mathieu.poirier@linaro.org> References: <1468871491-10997-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 Splitting the steps involved in the configuration of a tracer. The first part is generic and can be reused for both sysFS and Perf methods. The second part pertains to the configuration of filters themselves where the source of the information used to configure the filters will vary depending on the access methods. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.c | 36 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 1fe1f0e86daf..9978cf7a5600 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -565,21 +565,8 @@ static void etm4_init_arch_data(void *info) CS_LOCK(drvdata->base); } -static void etm4_set_default(struct etmv4_config *config) +static void etm4_set_default_config(struct etmv4_config *config) { - if (WARN_ON_ONCE(!config)) - return; - - /* - * Make default initialisation trace everything - * - * Select the "always true" resource selector on the - * "Enablign Event" line and configure address range comparator - * '0' to trace all the possible address range. From there - * configure the "include/exclude" engine to include address - * range comparator '0'. - */ - /* disable all events tracing */ config->eventctrl0 = 0x0; config->eventctrl1 = 0x0; @@ -595,7 +582,10 @@ static void etm4_set_default(struct etmv4_config *config) /* TRCVICTLR::EVENT = 0x01, select the always on logic */ config->vinst_ctrl |= BIT(0); +} +static void etm4_set_default_filter(struct etmv4_config *config) +{ /* * TRCVICTLR::SSSTATUS == 1, the start-stop logic is * in the started state @@ -641,6 +631,24 @@ static void etm4_set_default(struct etmv4_config *config) config->vissctlr = 0x0; } +static void etm4_set_default(struct etmv4_config *config) +{ + if (WARN_ON_ONCE(!config)) + return; + + /* + * Make default initialisation trace everything + * + * Select the "always true" resource selector on the + * "Enablign Event" line and configure address range comparator + * '0' to trace all the possible address range. From there + * configure the "include/exclude" engine to include address + * range comparator '0'. + */ + etm4_set_default_config(config); + etm4_set_default_filter(config); +} + void etm4_config_trace_mode(struct etmv4_config *config) { u32 addr_acc, mode;