From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com,
Mathieu Poirier <mathieu.poirier@linaro.org>
Subject: [PATCH 05/10] coresight: etm4x: cleaning up default filter configuration
Date: Mon, 18 Jul 2016 13:51:26 -0600 [thread overview]
Message-ID: <1468871491-10997-6-git-send-email-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <1468871491-10997-1-git-send-email-mathieu.poirier@linaro.org>
The default filter configuration was hard to read and included
some redundancy. This patch attempts to stream line configuration
and improve readability.
No change of functionality is included.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
drivers/hwtracing/coresight/coresight-etm4x.c | 53 ++++++++++++++-------------
1 file changed, 27 insertions(+), 26 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index 9978cf7a5600..e348c18086f5 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -586,39 +586,34 @@ static void etm4_set_default_config(struct etmv4_config *config)
static void etm4_set_default_filter(struct etmv4_config *config)
{
- /*
- * TRCVICTLR::SSSTATUS == 1, the start-stop logic is
- * in the started state
- */
- config->vinst_ctrl |= BIT(9);
+ u64 start, stop, access_type = 0;
/*
* Configure address range comparator '0' to encompass all
* possible addresses.
*/
+ start = 0x0;
+ stop = ~0x0;
- /* First half of default address comparator: start at address 0 */
- config->addr_val[ETM_DEFAULT_ADDR_COMP] = 0x0;
- /* trace instruction addresses */
- config->addr_acc[ETM_DEFAULT_ADDR_COMP] &= ~(BIT(0) | BIT(1));
- /* EXLEVEL_NS, bits[12:15], only trace application and kernel space */
- config->addr_acc[ETM_DEFAULT_ADDR_COMP] |= ETM_EXLEVEL_NS_HYP;
- /* EXLEVEL_S, bits[11:8], don't trace anything in secure state */
- config->addr_acc[ETM_DEFAULT_ADDR_COMP] |= (ETM_EXLEVEL_S_APP |
- ETM_EXLEVEL_S_OS |
- ETM_EXLEVEL_S_HYP);
- config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE;
+ /* EXLEVEL_NS, bits[12:15], always stay away from hypervisor mode. */
+ access_type = ETM_EXLEVEL_NS_HYP;
/*
- * Second half of default address comparator: go all
- * the way to the top.
- */
- config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = ~0x0;
- /* trace instruction addresses */
- config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] &= ~(BIT(0) | BIT(1));
- /* Address comparator type must be equal for both halves */
- config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] =
- config->addr_acc[ETM_DEFAULT_ADDR_COMP];
+ * EXLEVEL_S, bits[11:8], don't trace anything happening
+ * in secure state.
+ */
+ access_type |= (ETM_EXLEVEL_S_APP |
+ ETM_EXLEVEL_S_OS |
+ ETM_EXLEVEL_S_HYP);
+
+ /* First half of default address comparator */
+ config->addr_val[ETM_DEFAULT_ADDR_COMP] = start;
+ config->addr_acc[ETM_DEFAULT_ADDR_COMP] = access_type;
+ config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE;
+
+ /* Second half of default address comparator */
+ config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = stop;
+ config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] = access_type;
config->addr_type[ETM_DEFAULT_ADDR_COMP + 1] = ETM_ADDR_TYPE_RANGE;
/*
@@ -627,7 +622,13 @@ static void etm4_set_default_filter(struct etmv4_config *config)
*/
config->viiectlr = BIT(0);
- /* no start-stop filtering for ViewInst */
+ /*
+ * TRCVICTLR::SSSTATUS == 1, the start-stop logic is
+ * in the started state
+ */
+ config->vinst_ctrl |= BIT(9);
+
+ /* No start-stop filtering for ViewInst */
config->vissctlr = 0x0;
}
--
2.7.4
next prev parent reply other threads:[~2016-07-18 19:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 19:51 [PATCH 00/10] coresight: implementing address filtering Mathieu Poirier
2016-07-18 19:51 ` [PATCH 01/10] coresight: etm-perf: pass struct perf_event to source::enable/disable() Mathieu Poirier
2016-07-20 15:34 ` Suzuki K Poulose
2016-07-21 15:23 ` Mathieu Poirier
2016-07-18 19:51 ` [PATCH 02/10] coresight: remove duplicated enumeration Mathieu Poirier
2016-07-18 19:51 ` [PATCH 03/10] coresight: etm-perf: configuring filters from perf core Mathieu Poirier
2016-07-20 16:07 ` Suzuki K Poulose
2016-07-21 15:15 ` Mathieu Poirier
2016-07-21 17:12 ` Mathieu Poirier
2016-07-18 19:51 ` [PATCH 04/10] coresight: etm4x: split default and filter configuration Mathieu Poirier
2016-07-18 19:51 ` Mathieu Poirier [this message]
2016-07-18 19:51 ` [PATCH 06/10] coresight: etm4x: adding range filter configuration function Mathieu Poirier
2016-07-18 19:51 ` [PATCH 07/10] coresight: etm4x: configuring include/exclude function Mathieu Poirier
2016-07-18 19:51 ` [PATCH 08/10] coresight: etm4x: adding configurable address range filtering Mathieu Poirier
2016-07-18 19:51 ` [PATCH 09/10] coresight: etm4x: adding configurable start/stop filtering Mathieu Poirier
2016-07-18 19:51 ` [PATCH 10/10] coresight: documenting range and " Mathieu Poirier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1468871491-10997-6-git-send-email-mathieu.poirier@linaro.org \
--to=mathieu.poirier@linaro.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®