Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1445792
| From | Mathieu Poirier <mathieu.poirier@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 07/10] coresight: etm4x: configuring include/exclude function |
| Date | 2016-07-18 22:00 +0200 |
| Message-ID | <rWmRQ-26O-23@gated-at.bofh.it> (permalink) |
| References | <rWmRP-26O-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The include/exclude function of a tracer is applicable to address
range and start/stop filters. To avoid duplication and reuse code
moving the include/exclude configuration to a function of its own.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
drivers/hwtracing/coresight/coresight-etm4x.c | 35 +++++++++++++++++++--------
1 file changed, 25 insertions(+), 10 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index 4a4d2ef35ad6..9eba6d8f4633 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -213,13 +213,6 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata,
/* Always start from the default config */
etm4_set_default(config);
- /*
- * By default the tracers are configured to trace the whole address
- * range. Narrow the field only if requested by user space.
- */
- if (config->mode)
- etm4_config_trace_mode(config);
-
/* Go from generic option to ETMv4 specifics */
if (attr->config & BIT(ETM_OPT_CYCACC))
config->cfg |= ETMv4_MODE_CYCACC;
@@ -584,14 +577,28 @@ static void etm4_set_default_config(struct etmv4_config *config)
config->vinst_ctrl |= BIT(0);
}
-static void etm4_set_comparator_filter(struct etmv4_config *config,
- u64 start, u64 stop, int comparator)
+static u64 etm4_get_access_type(struct etmv4_config *config)
{
u64 access_type = 0;
- /* EXLEVEL_NS, bits[12:15], always stay away from hypervisor mode. */
+ /*
+ * EXLEVEL_NS, bits[15:12]
+ * The Exception levels are:
+ * Bit[12] Exception level 0 - Application
+ * Bit[13] Exception level 1 - OS
+ * Bit[14] Exception level 2 - Hypervisor
+ * Bit[15] Never implemented
+ *
+ * Always stay away from hypervisor mode.
+ */
access_type = ETM_EXLEVEL_NS_HYP;
+ if (config->mode & ETM_MODE_EXCL_KERN)
+ access_type |= ETM_EXLEVEL_NS_OS;
+
+ if (config->mode & ETM_MODE_EXCL_USER)
+ access_type |= ETM_EXLEVEL_NS_APP;
+
/*
* EXLEVEL_S, bits[11:8], don't trace anything happening
* in secure state.
@@ -600,6 +607,14 @@ static void etm4_set_comparator_filter(struct etmv4_config *config,
ETM_EXLEVEL_S_OS |
ETM_EXLEVEL_S_HYP);
+ return access_type;
+}
+
+static void etm4_set_comparator_filter(struct etmv4_config *config,
+ u64 start, u64 stop, int comparator)
+{
+ u64 access_type = etm4_get_access_type(config);
+
/* First half of default address comparator */
config->addr_val[comparator] = start;
config->addr_acc[comparator] = access_type;
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/10] coresight: implementing address filtering Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
[PATCH 09/10] coresight: etm4x: adding configurable start/stop filtering Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
[PATCH 06/10] coresight: etm4x: adding range filter configuration function Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
[PATCH 04/10] coresight: etm4x: split default and filter configuration Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
[PATCH 10/10] coresight: documenting range and start/stop filtering Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
[PATCH 02/10] coresight: remove duplicated enumeration Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
[PATCH 07/10] coresight: etm4x: configuring include/exclude function Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
[PATCH 01/10] coresight: etm-perf: pass struct perf_event to source::enable/disable() Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
Re: [PATCH 01/10] coresight: etm-perf: pass struct perf_event to source::enable/disable() Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-07-20 17:40 +0200
Re: [PATCH 01/10] coresight: etm-perf: pass struct perf_event to source::enable/disable() Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-21 17:30 +0200
[PATCH 03/10] coresight: etm-perf: configuring filters from perf core Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
Re: [PATCH 03/10] coresight: etm-perf: configuring filters from perf core Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-07-20 18:10 +0200
Re: [PATCH 03/10] coresight: etm-perf: configuring filters from perf core Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-21 17:20 +0200
Re: [PATCH 03/10] coresight: etm-perf: configuring filters from perf core Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-21 19:20 +0200
[PATCH 05/10] coresight: etm4x: cleaning up default filter configuration Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
[PATCH 08/10] coresight: etm4x: adding configurable address range filtering Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-18 22:00 +0200
csiph-web