Hi all,
I am currently facing a problem about manually flushing traces.
The traced user application runs on a Linux distribution with an FPGA Board based on a Zynq-7000 SoC.
I am setting up coresight components for tracing only the user application PID and his address space, and I exclude tracing kernel.
All traces are exported to a monitor present in the FPGA. The flow of the traces:
————————————— ——————— —————————
| | | | | |
| ARM Cortex A9 (Core 0) | ==> | TPIU | ==> | FPGA Monitor |
| / PTM | | | | |
————————————— ——————— —————————
When there is a syscall on the user application, I have the traces below:
…
16274 (a waypoint update packet)
ffff0008 (the exception branch address)
16278
..
The relative addresses/assembly instructions extracted from the ELF file are :
16270: e89c0078 ldm ip, {r3, r4, r5, r6}
16274: ef000000 svc 0x00000000
16278: e8bd00f0 pop {r4, r5, r6, r7}
During the execution of the syscall (on the Kernel side), the kernel needs to receive a response from the FPGA Monitor and wait actively for it.
This response depends on calculations relative to all PTM traces before the syscall (SVC instruction at 16274).
That’s why I need to flush all traces during the syscall, I tried to flush traces by setting the FOnMan_W of the Formatter and Flush Control Register (FFCR) into coresight-tpiu.c but that’s not working.
Do you have an idea of how correctly flushing all traces to the FPGA Monitor on the kernel?
Best regards,
Mounir
Set consists of minor fixes discovered during other development work.
Fixes are stand-alone and not directly part of new work.
Mike Leach (3):
coresight: Fix comment in main header file.
coresight: etmv4: Counter values not saved on disable.
coresight: etmv4: Fix resource selector constant.
drivers/hwtracing/coresight/coresight-etm4x.c | 6 ++++++
drivers/hwtracing/coresight/coresight-etm4x.h | 4 ++--
include/linux/coresight.h | 3 ++-
3 files changed, 10 insertions(+), 3 deletions(-)
--
2.17.1
Adjust the handling of the session sink selection to allow no sink to
be selected on the command line. This then forwards the sink selection to
the CoreSight infrastructure which will attempt to select a sink based
on the default sink select priorities.
Signed-off-by: Mike Leach <mike.leach(a)linaro.org>
Tested-by: Leo Yan <leo.yan(a)linaro.org>
---
tools/perf/arch/arm/util/cs-etm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index cea5e33d61d2..cad7bf783413 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -243,10 +243,10 @@ static int cs_etm_set_sink_attr(struct perf_pmu *pmu,
}
/*
- * No sink was provided on the command line - for _now_ treat
- * this as an error.
+ * No sink was provided on the command line - allow the CoreSight
+ * system to look for a default
*/
- return ret;
+ return 0;
}
static int cs_etm_recording_options(struct auxtrace_record *itr,
--
2.17.1
Fixes reported issues #24 and #25 from github.
Removes globals from instruction decode lib to improve usability in
multi threaded environment.
--
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK
This patchset introduces initial concepts in CoreSight complex configuration
support - the device "feature", which is a method of programming the device
to perform a specific function.
A built-in feature is provided - the ETM strobing function, which programs the
ETM to switch trace on and off in a specific mark / space ratio to effectively
sample the program being traced. This feature is essential for the Auto-FDO
flow using CoreSight trace.
Features are declared as a data table, a set of register, resource and parameter
requirements. A feature can then be loaded into a device, when the requirements
are validated. Once loaded a feature can be enabled for a specific trace run.
A feature appears in the sysfs file for the device, as a directory of form
'name.feat', with parameters 'enable', 'description' and any input parameters
that may be used to control the operation.
For example the ETM strobing feature provided has parameters of 'window' and
'period' to control the sampling mark / space ratio. The representation in
sysfs for the ETMv4 is therefore:-
etmX/strobing.feat/
/enable
/window
/period
Future developments will introduce resource management, and allow for the
runtime loading of additional features, and the setting of features across
an entire CoreSight system.
Mike Leach (3):
coresight: etmv4: Fix resource selector constant.
coresight: etmv4: Counter values not saved on disable.
coresight: etmv4: Adds initial complex config with ETM4 strobe
feature.
drivers/hwtracing/coresight/Makefile | 7 +-
.../hwtracing/coresight/coresight-config.c | 380 ++++++++++++++++++
.../hwtracing/coresight/coresight-config.h | 156 +++++++
.../hwtracing/coresight/coresight-etm4x-cfg.c | 325 +++++++++++++++
.../hwtracing/coresight/coresight-etm4x-cfg.h | 29 ++
.../coresight/coresight-etm4x-sysfs.c | 3 +
drivers/hwtracing/coresight/coresight-etm4x.c | 24 +-
drivers/hwtracing/coresight/coresight-etm4x.h | 4 +-
drivers/hwtracing/coresight/coresight.c | 1 +
include/linux/coresight.h | 2 +
10 files changed, 925 insertions(+), 6 deletions(-)
create mode 100644 drivers/hwtracing/coresight/coresight-config.c
create mode 100644 drivers/hwtracing/coresight/coresight-config.h
create mode 100644 drivers/hwtracing/coresight/coresight-etm4x-cfg.c
create mode 100644 drivers/hwtracing/coresight/coresight-etm4x-cfg.h
--
2.17.1