On 19 December 2016 at 07:45, Yehuda Yitschak <yehuday(a)marvell.com> wrote:
> Hi Mathieu
>
>
>
> After some more debug I was able to resolve the trace issue I had on
> Linux-4.9-rc1
>
> If you remember I only got trace for CPU2 out of 4 CPUs which was really
> strange
>
>
>
> Turns out the issue comes from some quirk in our busses
>
> Our internal fabric is not able to write 64bit data to registers, only to
> memory
>
> So the address comparators in the ETM got corrupted values and there wasn’t
> any match on address for most CPUs.
>
> For some cryptic reason only CPU2 got somewhat reasonable comparator value
> (still not the intended, but a working one) and so it could generate trace
>
>
>
> Now I am able to generate proper trace consistently.
>
Very good.
>
>
> I was wondering how can I add latency or timing information to the trace
>
> I noticed the cs_etm event can accept an option of “cycacc” and “timestamp“
>
> How can I view this information later ?
>
> Should I use perf script –f ?
That information, when configured on the cmd line, will end up in the
perf.data file. From there it will be decoded and rendered by the
openCSD library.
Mike, can you comment on the format of the information that will be
found in the packet? Perhaps you have an example somewhere of traces
generated by the "cycacc" and "timestamp" option?
You will definitely need to create your own scripts as nothing we have
done so far uses those configuration parameters.
Thanks,
Mathieu
>
>
>
> Thanks a lot
>
>
>
> -------------------
>
> Yehuda Yitschak
>
> Marvell Semiconductor Ltd.
>
>
Hi Mike,
I just did some refactoring to reduced thge churn and duplication.
Can you check if this work for you ? I could not give it much testing.
Regards,
Sudeep
--->8
Juno r1/r2 boards have different CoreSight infrastructure outside the
CPU clusters. This patchset adds the additional coreSight components to
separate .dtsi files to support these differences.
v1->v2:
- moved the addition of the STM component into a separate patch
v2->v3:
- moved the back the common coreSight components back into
juno-base.dtsi
Mike Leach (2):
arm64: dts: juno: fix CoreSight support for Juno r1/r2 variants
arm64: dts: juno: add missing CoreSight STM component
Sudeep Holla (1):
arm64: dts: juno: refactor CoreSight support on Juno r0
arch/arm64/boot/dts/arm/juno-base.dtsi | 31 ++++++---
arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi | 102 ++++++++++++++++++++++++++++++
arch/arm64/boot/dts/arm/juno-r1.dts | 13 ++++
arch/arm64/boot/dts/arm/juno-r2.dts | 13 ++++
arch/arm64/boot/dts/arm/juno.dts | 24 +++++++
5 files changed, 175 insertions(+), 8 deletions(-)
create mode 100644 arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi
--
2.7.4
On 17/01/17 12:15, Sudeep Holla wrote:
> From: Mike Leach <mike.leach(a)linaro.org>
>
> The CoreSight support added for Juno is valid for only Juno r0.
> The Juno r1 and r2 variants have additional components and alternative
> connection routes between trace source and sinks.
>
> This patch builds on top of the existing r0 support and extends it to
> Juno r1/r2 variants.
>
> Reviewed-by: Mathieu Poirier <mathieu.poirier(a)linaro.org>
> Signed-off-by: Mike Leach <mike.leach(a)linaro.org>
> [sudeep.holla(a)arm.com: minor changelog update and major reorganisation of
> the common coresight components back into juno-base.dtsi to avoid
> duplication, also renamed funnel node names]
> Signed-off-by: Sudeep Holla <sudeep.holla(a)arm.com>
> ---
> arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi | 100 ++++++++++++++++++++++++++++++
> arch/arm64/boot/dts/arm/juno-r1.dts | 9 +++
> arch/arm64/boot/dts/arm/juno-r2.dts | 9 +++
> 3 files changed, 118 insertions(+)
> create mode 100644 arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi
>
> diff --git a/arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi b/arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi
> new file mode 100644
> index 000000000000..563463ed28c7
> --- /dev/null
> +++ b/arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi
> @@ -0,0 +1,100 @@
> +/ {
> + funnel@20130000 { /* cssys2 */
Typo, that should be csys1. Rest looks good to me.
Reviewed-by: Suzuki K Poulose <suzuki.poulose(a)arm.com>
In order to support cross compile the OpenCSD for arm/arm64, this patch
added two environment variables, 'CROSS_COMPILE' and 'ARCH' which can
be set by users before compiling the code.
Like documented in Kernel Makefile, CROSS_COMPILE specifies the prefix
used for all executables used during compilation. CROSS_COMPILE can be
set on the command line, as is ARCH.
For example, if you want to build the libraryies for Aarch64, you can set
"ARCH=arm64", the the compiled libs will be located at
lib/linux-arm64/<rel\dbg>.`
Signed-off-by: Chunyan Zhang <zhang.chunyan(a)linaro.org>
---
decoder/build/linux/makefile | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/decoder/build/linux/makefile b/decoder/build/linux/makefile
index 3b6a623..dc1f32b 100644
--- a/decoder/build/linux/makefile
+++ b/decoder/build/linux/makefile
@@ -47,7 +47,11 @@ export LIB_CAPI_NAME
# determine base architecture, heavily borrowed from the Linux kernel v4.4's
# tools/perf/config/Makefile.arch
+# For example, to compile for arm64 on a X86 PC, you can issue the command:
+# "export ARCH=arm64"
+ifndef ARCH
ARCH := $(shell uname -m 2>/dev/null || echo not)
+endif
# source root directories
export OCSD_LIB_ROOT=$(OCSD_ROOT)/lib
@@ -58,10 +62,10 @@ export OCSD_SOURCE=$(OCSD_ROOT)/source
export OCSD_TESTS=$(OCSD_ROOT)/tests
# tools
-export MASTER_CC=gcc
-export MASTER_CPP=g++
-export MASTER_LINKER=g++
-export MASTER_LIB=ar
+export MASTER_CC=$(CROSS_COMPILE)gcc
+export MASTER_CPP=$(CROSS_COMPILE)g++
+export MASTER_LINKER=$(CROSS_COMPILE)g++
+export MASTER_LIB=$(CROSS_COMPILE)ar
# compile flags
MASTER_CC_FLAGS := -c -Wall -DLINUX
@@ -87,6 +91,10 @@ ifeq ($(ARCH),x86)
else ifeq ($(ARCH),x86_64)
MFLAG:="-m64"
BIT_VARIANT=64
+else ifeq ($(ARCH),arm)
+ BIT_VARIANT=-arm
+else ifeq ($(ARCH),arm64)
+ BIT_VARIANT=-arm64
endif
MASTER_CC_FLAGS += $(MFLAG)
--
2.7.4
The patch adds documentation to HOWTO.md on how to use CoreSight ETM to perform
Feedback Directed Optimization.
Sebastian Pop (1):
HOWTO: add example of how to extract coverage files for autoFDO
HOWTO.md | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
--
2.6.3
---------- Forwarded message ----------
From: Mike Leach <mike.leach(a)linaro.org>
Date: 2 January 2017 at 22:55
Subject: [PATCH] coresight: etm4x: Fix enabling of cycle accurate tracing
in perf.
To: mathieu.poirier(a)linaro.org
Cc: linux-arm-kernel(a)lists.infradead.org, coresignt(a)lists.linaro.org, Mike
Leach <mike.leach(a)linaro.org>
Using perf record 'cyclacc' option in cs_etm event was not setting up cycle
accurate trace correctly.
Corrects bit set in TRCCONFIGR to enable cycle accurate trace.
Programs TRCCCCTLR with a valid threshold value as required by ETMv4 spec.
Signed-off-by: Mike Leach <mike.leach(a)linaro.org>
---
drivers/hwtracing/coresight/coresight-etm4x.c | 7 +++++--
drivers/hwtracing/coresight/coresight-etm4x.h | 1 +
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c
b/drivers/hwtracing/coresight/coresight-etm4x.c
index 4db8d6a..07be032 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -216,8 +216,11 @@ static int etm4_parse_event_config(struct
etmv4_drvdata *drvdata,
goto out;
/* Go from generic option to ETMv4 specifics */
- if (attr->config & BIT(ETM_OPT_CYCACC))
- config->cfg |= ETMv4_MODE_CYCACC;
+ if (attr->config & BIT(ETM_OPT_CYCACC)) {
+ config->cfg |= BIT(4);
+ /* TRM: Must program this for cycacc to work */
+ config->ccctlr = ETM_CYC_THRESHOLD_DEFAULT;
+ }
if (attr->config & BIT(ETM_OPT_TS))
config->cfg |= ETMv4_MODE_TIMESTAMP;
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h
b/drivers/hwtracing/coresight/coresight-etm4x.h
index ba8d3f8..8a62c6c 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.h
+++ b/drivers/hwtracing/coresight/coresight-etm4x.h
@@ -146,6 +146,7 @@
#define ETM_ARCH_V4 0x40
#define ETMv4_SYNC_MASK 0x1F
#define ETM_CYC_THRESHOLD_MASK 0xFFF
+#define ETM_CYC_THRESHOLD_DEFAULT 256
#define ETMv4_EVENT_MASK 0xFF
#define ETM_CNTR_MAX_VAL 0xFFFF
#define ETM_TRACEID_MASK 0x3f
--
2.7.4
--
Mike Leach
Principal Engineer, ARM Ltd.
Blackburn Design Centre. UK