From patchwork Thu Aug 25 21:19:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 9300061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 701BD60757 for ; Thu, 25 Aug 2016 21:39:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DE5B293B3 for ; Thu, 25 Aug 2016 21:39:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 521C9293EB; Thu, 25 Aug 2016 21:39:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A82F1293E6 for ; Thu, 25 Aug 2016 21:39:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bd2LP-0005rK-CQ; Thu, 25 Aug 2016 21:37:51 +0000 Received: from mail-it0-x235.google.com ([2607:f8b0:4001:c0b::235]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bd24c-0006it-Cc for linux-arm-kernel@lists.infradead.org; Thu, 25 Aug 2016 21:20:32 +0000 Received: by mail-it0-x235.google.com with SMTP id e63so297108188ith.1 for ; Thu, 25 Aug 2016 14:20:10 -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=Sz2mw5zKkwyVkZrJBDlvkW+WWoBeAo+1m00sGoVrcOg=; b=QmqrJ/YLOxOboMC/654eD259fDboDcgWJk+3CKQnslYfgfC5W2JSsRlhqr6oXHP69v VkyXu2xnByfCMtXoW4n15KTqgqBEWUnnOT+s3Vo8VskZ7HyTuboyGb/61cLD2Np7cJYi AUTS36Ju8DxByWl+WOupUgPUXFJgsfFPc/LVM= 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=Sz2mw5zKkwyVkZrJBDlvkW+WWoBeAo+1m00sGoVrcOg=; b=bjNrBVCPjx/BmzNMt/c7+KiBLJLG9b7n+71L1s8X8/R0KDKuCpWAOnBYWMsrS+7hI1 G0k9d1NgOxekcoWqG7aT5B23lu81j1s4PV96EGFvpNxwCQKDtD9/QI+4QySJdwuDyZJ0 lRSdzeBwLHX6pQ5VOgYs6ay1qjpvQiMedUuiXelCbGQERRuzYFaY5GfSaugzwaBdTr84 5CVKXjkUPyGiM7JCJkhCNjxmuhOLRty5v1R/KCQh0KsHwsFg6dgzBAVZUpim3f8/OaR5 guRFLMHlf+eYifPYaK++FrGJer2KdyCJvBM28UM2ms0m7667K/8re7v++PHoQINJxspL vgPQ== X-Gm-Message-State: AEkoouuObQQxcyHBTMtJIZK2t9Pt690Mlm2uP2KldNYCcn6xpFzDeMgagljpNWed8Uj9NW96 X-Received: by 10.36.129.213 with SMTP id q204mr7994870itd.38.1472160009794; Thu, 25 Aug 2016 14:20:09 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id o5sm14506120ith.20.2016.08.25.14.20.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Aug 2016 14:20:09 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 23/28] coresight: etm4x: split default and filter configuration Date: Thu, 25 Aug 2016 15:19:13 -0600 Message-Id: <1472159958-5981-24-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472159958-5981-1-git-send-email-mathieu.poirier@linaro.org> References: <1472159958-5981-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160825_142030_685116_9EADACA9 X-CRM114-Status: GOOD ( 12.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index b9e26d4f6b84..f890d1de39e3 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -562,21 +562,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; @@ -592,7 +579,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 @@ -638,6 +628,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;