On 11/07/2023 15:05, Greg Kroah-Hartman wrote:
> On Tue, Jul 11, 2023 at 03:05:36PM +0800, quanyang.wang(a)windriver.com wrote:
>> From: Quanyang Wang <quanyang.wang(a)windriver.com>
>>
>> For PREEMPT_RT kernel, spinlock_t locks become sleepable. The functions
>> etm_dying_cpu and etm_starting_cpu which call spin_lock/unlock run in
>> an irq-disabled context, this will trigger the following calltrace:
>>
>> BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46
>> in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 25, name: migration/1
>> preempt_count: 1, expected: 0
>> RCU nest depth: 0, expected: 0
>> 1 lock held by migration/1/25:
>> #0: 82a7587c (&drvdata->spinlock){....}-{2:2}, at: etm_dying_cpu+0x28/0x54
>> Preemption disabled at:
>> [<801ec760>] cpu_stopper_thread+0x94/0x120
>> CPU: 1 PID: 25 Comm: migration/1 Not tainted 6.1.35-rt10-yocto-preempt-rt #30
>> Hardware name: Xilinx Zynq Platform
>> Stopper: multi_cpu_stop+0x0/0x174 <- __stop_cpus.constprop.0+0x48/0x88
>> unwind_backtrace from show_stack+0x18/0x1c
>> show_stack from dump_stack_lvl+0x58/0x70
>> dump_stack_lvl from __might_resched+0x14c/0x1c0
>> __might_resched from rt_spin_lock+0x4c/0x84
>> rt_spin_lock from etm_dying_cpu+0x28/0x54
>> etm_dying_cpu from cpuhp_invoke_callback+0x140/0x33c
>> cpuhp_invoke_callback from __cpuhp_invoke_callback_range+0xa4/0x104
>> __cpuhp_invoke_callback_range from take_cpu_down+0x7c/0xa8
>> take_cpu_down from multi_cpu_stop+0x15c/0x174
>> multi_cpu_stop from cpu_stopper_thread+0x9c/0x120
>> cpu_stopper_thread from smpboot_thread_fn+0x31c/0x360
>> smpboot_thread_fn from kthread+0x100/0x124
>> kthread from ret_from_fork+0x14/0x2c
>>
>> Convert struct etm_drvdata's spinlock to raw_spinlock to fix it.
>
> wait, why will a raw_spinlock fix this? Why not fix the root problem
> here, that of calling these locks inproperly in irq context?
>
> How is changing to a raw_spinlock going to fix the above splat?
>
> thanks,
>
> greg k-h
>
If it's just etm_starting_cpu() and etm_dying_cpu() as mentioned in the
commit message then can those spinlocks be removed?
Surely there can't be any concurrent access to the per-cpu data when the
hotplug callbacks are called?
James
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel(a)lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Em Tue, Jul 11, 2023 at 08:28:31AM +0000, Pandey, Radhey Shyam escreveu:
> > -----Original Message-----
> > From: James Clark <james.clark(a)arm.com>
> > Sent: Friday, July 7, 2023 9:16 PM
> > To: linux-perf-users(a)vger.kernel.org; Pandey, Radhey Shyam
> > <radhey.shyam.pandey(a)amd.com>
> > Cc: coresight(a)lists.linaro.org; James Clark <james.clark(a)arm.com>; Peter
> > Zijlstra <peterz(a)infradead.org>; Ingo Molnar <mingo(a)redhat.com>;
> > Arnaldo Carvalho de Melo <acme(a)kernel.org>; Mark Rutland
> > <mark.rutland(a)arm.com>; Alexander Shishkin
> > <alexander.shishkin(a)linux.intel.com>; Jiri Olsa <jolsa(a)kernel.org>;
> > Namhyung Kim <namhyung(a)kernel.org>; Ian Rogers <irogers(a)google.com>;
> > Adrian Hunter <adrian.hunter(a)intel.com>; Uwe Kleine-König <uwe@kleine-
> > koenig.org>; linux-kernel(a)vger.kernel.org
> > Subject: [PATCH] perf build: Fix library not found error when using CSLIBS
> >
> > -L only specifies the search path for libraries directly provided in the link line
> > with -l. Because -lopencsd isn't specified, it's only linked because it's a
> > dependency of -lopencsd_c_api. Dependencies like this are resolved using
> > the default system search paths or -rpath-link=... rather than -L. This means
> > that compilation only works if OpenCSD is installed to the system rather than
> > provided with the CSLIBS (-L) option.
> >
> > This could be fixed by adding -Wl,-rpath-link=$(CSLIBS) but that is less
> > conventional than just adding -lopencsd to the link line so that it uses -L. -
> > lopencsd seems to have been removed in commit ed17b1914978 ("perf
> > tools: Drop requirement for libstdc++.so for libopencsd check") because it
> > was thought that there was a chance compilation would work even if it didn't
> > exist, but I think that only applies to libstdc++ so there is no harm to add it
> > back. libopencsd.so and libopencsd_c_api.so would always exist together.
> >
> > Testing
> > =======
> >
> > The following scenarios now all work:
> >
> > * Cross build with OpenCSD installed
> > * Cross build using CSLIBS=...
> > * Native build with OpenCSD installed
> > * Native build using CSLIBS=...
> > * Static cross build with OpenCSD installed
> > * Static cross build with CSLIBS=...
> >
> > Reported-by: Radhey Shyam Pandey <radhey.shyam.pandey(a)amd.com>
> > Closes: https://lore.kernel.org/linux-arm-kernel/56905d7a-a91e-883a-b707-
> > 9d5f686ba5f1(a)arm.com/
> > Link: https://lore.kernel.org/all/36cc4dc6-bf4b-1093-1c0a-
> > 876e368af183(a)kleine-koenig.org/
> > Fixes: ed17b1914978 ("perf tools: Drop requirement for libstdc++.so for
> > libopencsd check")
> > Signed-off-by: James Clark <james.clark(a)arm.com>
> > ---
> > tools/perf/Makefile.config | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index
> > 0609c19caabd..c5db0de49868 100644
> > --- a/tools/perf/Makefile.config
> > +++ b/tools/perf/Makefile.config
> > @@ -155,9 +155,9 @@ FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto ifdef
> > CSINCLUDES
> > LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
> > endif
> > -OPENCSDLIBS := -lopencsd_c_api
> > +OPENCSDLIBS := -lopencsd_c_api -lopencsd
> > ifeq ($(findstring -static,${LDFLAGS}),-static)
> > - OPENCSDLIBS += -lopencsd -lstdc++
> > + OPENCSDLIBS += -lstdc++
> > endif
> > ifdef CSLIBS
> > LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
> > --
> > 2.34.1
>
> Tested-by: Radhey Shyam Pandey <radhey.shyam.pandey(a)amd.com>
> Cross compiled for aarch64 on x86_64.
>
> make ARCH=arm64 NO_LIBELF=1 NO_JVMTI=1 VF=1 CORESIGHT=1 -C tools/perf
>
> file <snip>/linux-xlnx/tools/perf/perf
> perf: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV),
> dynamically linked, interpreter /lib/ld-linux-aarch64.so.1,
> BuildID[sha1]=ef7c524338577b14e7c0f914d882dec4d26e93a2,
> for GNU/Linux 3.14.0, with debug_info, not stripped
Thanks for reporting and testing, applied to perf-tools. I see no
problems in my common case which is:
⬢[acme@toolbox perf-tools]$ alias m='make -k BUILD_BPF_SKEL=1 CORESIGHT=1 O=/tmp/build/perf-tools -C tools/perf install-bin && git status && perf test python ; perf record -o /dev/null sleep 0.01 ; perf stat --null sleep 0.01'
⬢[acme@toolbox perf-tools]$
⬢[acme@toolbox perf-tools]$ ldd ~/bin/perf | grep csd
libopencsd_c_api.so.1 => /lib64/libopencsd_c_api.so.1 (0x00007f9c012ea000)
libopencsd.so.1 => /lib64/libopencsd.so.1 (0x00007f9c00556000)
⬢[acme@toolbox perf-tools]$
- Arnaldo
This patch series is to add support for a streaming interface for
TMC ETR to allow for continuous log collection to secondary storage.
An interrupt based mechanism is used to stream out the data from the device.
QDSS_CS_QDSSCSR_ETRIRQCTRL register is used to set the IRQ byte counter
value. The value of this registers defines the number of bytes that when moved by
the ETR AXI interface. It will casues an interrupt which can be used by an
userspace program to know how much data is present in memory requiring copy to some
other location. A zero setting disables the interrupt.A one setting
means 8 bytes, two 16 bytes, etc. In other words, the value in this
register is the interrupt threshold times 8 bytes. ETR must be enabled
when use this interrupt function.
Sample:
echo 4096 > /sys/bus/coresight/devices/tmc_etr0/block_size
echo 1 > /sys/bus/coresight/devices/tmc_etr0/enable_sink
echo 1 > /sys/bus/coresight/devices/stm0/enabl_source
cat /dev/byte-cntr > /data/qdss_etr.bin &
The log collection will stop after disabling the ETR.
Commit link:
https://git.codelinaro.org/clo/linux-kernel/coresight/-/commits/coresight-b…
Mao Jinlong (3):
Coresight: Add driver to support for CSR
coresight-tmc: byte-cntr: Add support for streaming interface for ETR
dt-bindings: arm: Adds CoreSight CSR hardware definitions
.../testing/sysfs-bus-coresight-devices-tmc | 7 +
.../bindings/arm/qcom,coresight-csr.yaml | 62 ++++
drivers/hwtracing/coresight/Kconfig | 12 +
drivers/hwtracing/coresight/Makefile | 3 +-
.../hwtracing/coresight/coresight-byte-cntr.c | 304 ++++++++++++++++++
.../hwtracing/coresight/coresight-byte-cntr.h | 49 +++
drivers/hwtracing/coresight/coresight-csr.c | 168 ++++++++++
drivers/hwtracing/coresight/coresight-csr.h | 59 ++++
.../hwtracing/coresight/coresight-tmc-core.c | 66 ++++
.../hwtracing/coresight/coresight-tmc-etr.c | 8 +-
drivers/hwtracing/coresight/coresight-tmc.h | 12 +-
11 files changed, 745 insertions(+), 5 deletions(-)
create mode 100644 Documentation/devicetree/bindings/arm/qcom,coresight-csr.yaml
create mode 100644 drivers/hwtracing/coresight/coresight-byte-cntr.c
create mode 100644 drivers/hwtracing/coresight/coresight-byte-cntr.h
create mode 100644 drivers/hwtracing/coresight/coresight-csr.c
create mode 100644 drivers/hwtracing/coresight/coresight-csr.h
--
2.17.1
linux/bitfield.h can be included as long as linux/kernel.h is included
first, so change the order of the includes and drop the duplicate macro.
Signed-off-by: James Clark <james.clark(a)arm.com>
---
tools/perf/util/cs-etm.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 1419b40dfbe8..9729d006550d 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -6,10 +6,11 @@
* Author: Mathieu Poirier <mathieu.poirier(a)linaro.org>
*/
+#include <linux/kernel.h>
+#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/coresight-pmu.h>
#include <linux/err.h>
-#include <linux/kernel.h>
#include <linux/log2.h>
#include <linux/types.h>
#include <linux/zalloc.h>
@@ -281,17 +282,6 @@ static int cs_etm__metadata_set_trace_id(u8 trace_chan_id, u64 *cpu_metadata)
return 0;
}
-/*
- * FIELD_GET (linux/bitfield.h) not available outside kernel code,
- * and the header contains too many dependencies to just copy over,
- * so roll our own based on the original
- */
-#define __bf_shf(x) (__builtin_ffsll(x) - 1)
-#define FIELD_GET(_mask, _reg) \
- ({ \
- (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \
- })
-
/*
* Get a metadata for a specific cpu from an array.
*
--
2.34.1
On 10/07/2023 06:23, Randy Dunlap wrote:
> Correct spelling problems as identified by codespell.
> Correct one grammar error.
>
> Fixes: 7a25ec8e481e ("coresight: Adding ABI documentation")
> Fixes: 7253e4c95616 ("coresight: etm3x: breaking down sysFS status interface")
> Signed-off-by: Randy Dunlap <rdunlap(a)infradead.org>
> Cc: Suzuki K Poulose <suzuki.poulose(a)arm.com>
> Cc: Mike Leach <mike.leach(a)linaro.org>
> Cc: James Clark <james.clark(a)arm.com>
> Cc: Leo Yan <leo.yan(a)linaro.org>
> Cc: coresight(a)lists.linaro.org
> Cc: linux-arm-kernel(a)lists.infradead.org
> Cc: Mathieu Poirier <mathieu.poirier(a)linaro.org>
> Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
> ---
> Documentation/ABI/testing/sysfs-bus-coresight-devices-etm3x | 12 +++++-----
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
Thanks for the fixes.
Reviewed-by: James Clark <james.clark(a)arm.com>
> diff -- a/Documentation/ABI/testing/sysfs-bus-coresight-devices-etm3x b/Documentation/ABI/testing/sysfs-bus-coresight-devices-etm3x
> --- a/Documentation/ABI/testing/sysfs-bus-coresight-devices-etm3x
> +++ b/Documentation/ABI/testing/sysfs-bus-coresight-devices-etm3x
> @@ -20,9 +20,9 @@ Date: November 2014
> KernelVersion: 3.19
> Contact: Mathieu Poirier <mathieu.poirier(a)linaro.org>
> Description: (RW) Used in conjunction with @addr_idx. Specifies
> - characteristics about the address comparator being configure,
> + characteristics about the address comparator being configured,
> for example the access type, the kind of instruction to trace,
> - processor contect ID to trigger on, etc. Individual fields in
> + processor context ID to trigger on, etc. Individual fields in
> the access type register may vary on the version of the trace
> entity.
>
> @@ -31,7 +31,7 @@ Date: November 2014
> KernelVersion: 3.19
> Contact: Mathieu Poirier <mathieu.poirier(a)linaro.org>
> Description: (RW) Used in conjunction with @addr_idx. Specifies the range of
> - addresses to trigger on. Inclusion or exclusion is specificed
> + addresses to trigger on. Inclusion or exclusion is specified
> in the corresponding access type register.
>
> What: /sys/bus/coresight/devices/<memory_map>.[etm|ptm]/addr_single
> @@ -304,19 +304,19 @@ What: /sys/bus/coresight/devices/<memor
> Date: September 2015
> KernelVersion: 4.4
> Contact: Mathieu Poirier <mathieu.poirier(a)linaro.org>
> -Description: (RO) Print the content of the ETM Trace Start/Stop Conrol
> +Description: (RO) Print the content of the ETM Trace Start/Stop Control
> register (0x018). The value is read directly from the HW.
>
> What: /sys/bus/coresight/devices/<memory_map>.[etm|ptm]/mgmt/etmtecr1
> Date: September 2015
> KernelVersion: 4.4
> Contact: Mathieu Poirier <mathieu.poirier(a)linaro.org>
> -Description: (RO) Print the content of the ETM Enable Conrol #1
> +Description: (RO) Print the content of the ETM Enable Control #1
> register (0x024). The value is read directly from the HW.
>
> What: /sys/bus/coresight/devices/<memory_map>.[etm|ptm]/mgmt/etmtecr2
> Date: September 2015
> KernelVersion: 4.4
> Contact: Mathieu Poirier <mathieu.poirier(a)linaro.org>
> -Description: (RO) Print the content of the ETM Enable Conrol #2
> +Description: (RO) Print the content of the ETM Enable Control #2
> register (0x01c). The value is read directly from the HW.
linux/bitfield.h can be included as long as linux/kernel.h is included
first, so change the order of the includes and drop the duplicate macro.
Signed-off-by: James Clark <james.clark(a)arm.com>
---
tools/perf/util/cs-etm.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 1419b40dfbe8..9729d006550d 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -6,10 +6,11 @@
* Author: Mathieu Poirier <mathieu.poirier(a)linaro.org>
*/
+#include <linux/kernel.h>
+#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/coresight-pmu.h>
#include <linux/err.h>
-#include <linux/kernel.h>
#include <linux/log2.h>
#include <linux/types.h>
#include <linux/zalloc.h>
@@ -281,17 +282,6 @@ static int cs_etm__metadata_set_trace_id(u8 trace_chan_id, u64 *cpu_metadata)
return 0;
}
-/*
- * FIELD_GET (linux/bitfield.h) not available outside kernel code,
- * and the header contains too many dependencies to just copy over,
- * so roll our own based on the original
- */
-#define __bf_shf(x) (__builtin_ffsll(x) - 1)
-#define FIELD_GET(_mask, _reg) \
- ({ \
- (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \
- })
-
/*
* Get a metadata for a specific cpu from an array.
*
--
2.34.1
On 06/07/2023 13:47, Pandey, Radhey Shyam wrote:
>> -----Original Message-----
>> From: Pandey, Radhey Shyam
>> Sent: Thursday, July 6, 2023 5:40 PM
>> To: James Clark <james.clark(a)arm.com>
>> Cc: coresight(a)lists.linaro.org; linux-arm-kernel(a)lists.infradead.org; Suzuki K
>> Poulose <suzuki.poulose(a)arm.com>; mathieu.poirier(a)linaro.org;
>> mike.leach(a)linaro.org; leo.yan(a)linaro.org;
>> alexander.shishkin(a)linux.intel.com; Sarangi, Anirudha
>> <anirudha.sarangi(a)amd.com>
>> Subject: RE: Linux coresight arm64 : Incorrect data in cstrace.bin
>>
>>> -----Original Message-----
>>> From: James Clark <james.clark(a)arm.com>
>>> Sent: Wednesday, July 5, 2023 5:44 PM
>>> To: Pandey, Radhey Shyam <radhey.shyam.pandey(a)amd.com>
>>> Cc: coresight(a)lists.linaro.org; linux-arm-kernel(a)lists.infradead.org;
>>> Suzuki K Poulose <suzuki.poulose(a)arm.com>; mathieu.poirier(a)linaro.org;
>>> mike.leach(a)linaro.org; leo.yan(a)linaro.org;
>>> alexander.shishkin(a)linux.intel.com; Sarangi, Anirudha
>>> <anirudha.sarangi(a)amd.com>
>>> Subject: Re: Linux coresight arm64 : Incorrect data in cstrace.bin
>>>
>>>
>>>
>>> On 05/07/2023 12:48, Pandey, Radhey Shyam wrote:
>>>>> -----Original Message-----
>>>>> From: James Clark <james.clark(a)arm.com>
>>>>> Sent: Wednesday, July 5, 2023 4:29 PM
>>>>> To: Pandey, Radhey Shyam <radhey.shyam.pandey(a)amd.com>
>>>>> Cc: coresight(a)lists.linaro.org;
>>>>> linux-arm-kernel(a)lists.infradead.org;
>>>>> Suzuki K Poulose <suzuki.poulose(a)arm.com>;
>>>>> mathieu.poirier(a)linaro.org; mike.leach(a)linaro.org;
>>>>> leo.yan(a)linaro.org; alexander.shishkin(a)linux.intel.com
>>>>> Subject: Re: Linux coresight arm64 : Incorrect data in cstrace.bin
>>>>>
>>>>>
>>>>>
>>>>> On 05/07/2023 10:56, Pandey, Radhey Shyam wrote:
>>>>>>> -----Original Message-----
>>>>>>> From: Suzuki K Poulose <suzuki.poulose(a)arm.com>
>>>>>>> Sent: Wednesday, July 5, 2023 1:57 PM
>>>>>>> To: Pandey, Radhey Shyam <radhey.shyam.pandey(a)amd.com>;
>>>>>>> mathieu.poirier(a)linaro.org; mike.leach(a)linaro.org;
>>>>>>> leo.yan(a)linaro.org; alexander.shishkin(a)linux.intel.com
>>>>>>> Cc: coresight(a)lists.linaro.org;
>>>>>>> linux-arm-kernel(a)lists.infradead.org
>>>>>>> Subject: Re: Linux coresight arm64 : Incorrect data in
>>>>>>> cstrace.bin
>>>>>>>
>>>>>>> Hi Radhe Shyam
>>>>>>>
>>>>>>> On 05/07/2023 05:38, Pandey, Radhey Shyam wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I am using linux 6.1 kernel coresight framework to capture ETM
>> trace.
>>>>>>>> Enabled coresight driver and added coresight component device
>>>>>>>> node in DTS. With that, we could probe all coresight components.
>>>>>>>>
>>>>>>>> But when we do capture using sysfs and then read the trace.bin
>>>>>>>> using ptm2human we see invalid trace data. Trace content
>>>>>>>> changes on each capture. Any pointers to help narrow down the
>> issue?
>>>>>>>>
>>>>>>>> Tried: sysfs capture and perf (with OpenCSD enabled)
>>>>>>>>
>>>>>>>> Development board: VCK190 :
>>>>>>>> https://docs.xilinx.com/r/en-US/ug1366-vck190-eval-bd
>>>>>>>> https://www.xilinx.com/support/documents/architecture-
>>>>>>> manuals/am011-ve
>>>>>>>> rsal-acap-trm.pdf
>>>>>>>>
>>>>>>>> xilinx-vck190-20231:/home/petalinux# dmesg | grep -i amba
>>>>>>>> [ 0.301054] Serial: AMBA PL011 UART driver
>>>>>>>> [ 0.306226] amba f0c20000.funnel: Fixing up cyclic dependency
>> with
>>>>>>> f0d70000.etm
>>>>>>>> [ 0.313624] amba f0c20000.funnel: Fixing up cyclic dependency
>> with
>>>>>>> f0d30000.etm
>>>>>>>> [ 0.321110] amba f0c30000.etf: Fixing up cyclic dependency with
>>>>>>> f0c20000.funnel
>>>>>>>> [ 1.470247] Serial: AMBA driver
>>>>>>>> xilinx-vck190-20231:/home/petalinux# dmesg | grep -i coresight
>>>>>>>> [ 1.865006] cs_system_cfg: CoreSight Configuration manager
>>> initialised
>>>>>>>> [ 1.876858] coresight etm0: CPU0: etm v4.0 initialized
>>>>>>>> [ 1.885666] coresight etm1: CPU1: etm v4.0 initialized
>>>>>>>> [ 1.894435] coresight-cpu-debug f0d00000.debug1: Coresight
>> debug-
>>>>> CPU0
>>>>>>> initialized
>>>>>>>> [ 1.902072] coresight-cpu-debug f0d40000.debug1: Coresight
>> debug-
>>>>> CPU1
>>>>>>> initialized
>>>>>>>>
>>>>>>>> xilinx-vck190-20231:/home/petalinux# ls
>> /sys/bus/coresight/devices/
>>>>>>>> etm0 etm1 funnel0 tmc_etf0
>>>>>>>>
>>>>>>>> cd /sys/bus/coresight/devices/ echo 1 > tmc_etf0/enable_sink
>>>>>>>> echo 1 > etm0/enable_source echo 0 > etm0/enable_source echo 0 >
>>>>>>>> tmc_etf0/enable_sink cd /root/ dd if=/dev/tmc_etf0
>>>>>>>> of=cstrace_28Jun.bin
>>>>>>>>
>>>>>>>> ./ptm2human/ptm2human -e -i cstrace.bin -d
>>>>>>>
>>>>>>> Please note that ptm2human is for PTM trace decoding and
>>>>>>> ETMv4 uses a different format and thus is not compatible.
>>>>>>>
>>>>>>>>
>>>>>>>> I also tried OpenCSD integration with PERF.
>>>>>>>
>>>>>>> Have you made sure the perf is "linked" to the opencsd ?
>>>>>>
>>>>>> Earlier I statically linked but after adding CORESIGHT=1.
>>>>>>
>>>>>>
>>>>>> linux-xlnx$ make ARCH=arm64 NO_LIBELF=1 NO_JVMTI=1 VF=1
>>>>> CORESIGHT=1 -C
>>>>>> tools/perf/
>>>>>> make: Entering directory 'linux-xlnx/tools/perf'
>>>>>> BUILD: Doing 'make -j24' parallel build
>>>>>>
>>>>>> Makefile.config:520: *** Error: No libopencsd library found or the
>>>>>> version
>>>>> is not up-to-date.
>>>>>> Please install recent libopencsd to build with CORESIGHT=1. Stop.
>>>>>>
>>>>>>
>>>>>> echo $CSINCLUDES
>>>>>> /scratch/development/coresight/my-opencsd/decoder/include
>>>>>> radheys@xhdradheys41:/scratch/development/linux-xlnx$ ls
>>>>>> /scratch/development/coresight/my-opencsd/decoder/include
>>>>>> common i_dec interfaces mem_acc opencsd opencsd.h
>>>>>> pkt_printers
>>>>>>
>>>>>> echo $CSLIBS
>>>>>> /scratch/development/coresight/my-opencsd/decoder/lib/builddir
>>>>>> radheys@xhdradheys41:/scratch/development/linux-xlnx$ ls
>>>>> /scratch/development/coresight/my-opencsd/decoder/lib/builddir
>>>>>> libopencsd.a libopencsd_c_api.so libopencsd_c_api.so.1.4.0
>>>>> libopencsd.so.1
>>>>>> libopencsd_c_api.a libopencsd_c_api.so.1 libopencsd.so
>>>>> libopencsd.so.1.4.0
>>>>>>
>>>>>> Anything I am missing to fix this opencsd lib not found?
>>>>>
>>>>> There is a minimum version of 1.1.1 but it looks like you are using
>>>>> higher than that so that part should be fine.
>>>>>
>>>>> Personally I "make install" OpenCSD to the system path. I had a
>>>>> play around with $CSLIBS it and maybe there is also some stickyness
>>>>> to the feature detection so a make clean might help to make sure
>>>>> the errors you are seeing are real.
>>>>>
>>>>> Lastly you can print the output of why the feature test compilation
>>>>> failed which might help. I see some linking issues in there if I
>>>>> delete my system installed version of OpenCSD, so there might be a
>>>>> bug with just using CSINCLUDES and CSLIBS:
>>>>>
>>>>> $ cat tools/build/feature/test-libopencsd.make.output
>>>>>
>>>>> /usr/bin/ld: warning: libopencsd.so.1, needed by opencsd-
>>>>> local/decoder/lib/builddir//libopencsd_c_api.so, not found (try
>>>>> using -rpath or -rpath-link)
>>>>> /usr/bin/ld: opencsd-local/decoder/lib/builddir//libopencsd_c_api.so:
>>>>> undefined reference to `vtable for StmTrcPacket'
>>>>> /usr/bin/ld: opencsd-local/decoder/lib/builddir//libopencsd_c_api.so:
>>>>> undefined reference to `DecodeTree::getDecoderStats(unsigned char,
>>>>> _ocsd_decode_stats**)'
>>>>> /usr/bin/ld: opencsd-local/decoder/lib/builddir//libopencsd_c_api.so:
>>>>> undefined reference to
>>>>> `DecodeTree::addRawFramePrinter(RawFramePrinter**, unsigned int)'
>>>>>
>>>>> Can you try the make install and see if that works? If that works
>>>>> but the other way doesn't I can try looking into why its not and make a
>> fix.
>>>>
>>>> I tried make install but still it errors out. Looking at make.output
>>>> I am seeing multiple undefined references.
>>>>
>>>> NOTE I have to still set CSINCLUDES and CSLIBS as we are
>>>> cross-compiling Perf on a x86 host machine.
>>>
>>> This should still work if you make install them to the arch specific
>>> folder for example /usr/lib/aarch64-linux-gnu/. If do 'apt install
>> libopencsd-dev:arm64'
>>> I would get the arm ones in there.
>>>
>>> Then if I cross build like this I get openCSD linked:
>>>
>>> make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C tools/perf
>>> CORESIGHT=1
>>>
>>> So for now you should be able to work around the issue in this way.
>>
>> I tried copying opencsd libraries to /usr/lib/aarch64-linux-gnu but still I see
>> undefined reference. Is it because I am using cross-compiler from server
>> (toolchain path set to $PATH variable)?
>>
>> /proj/<snip>/Vitis/2023.2/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-
>> gnu-gcc
>> I assume CSLIBS and CSINCLUDES should be sufficient to cross compile perf
>> with coresight support?
>
> FYI, I tried with static linking and could proceed to perf compilation.
>
Static compilation works because the link line is slightly different (it
includes -lopencsd rather than just -lopencsd_c_api:
ifeq ($(findstring -static,${LDFLAGS}),-static)
OPENCSDLIBS += -lopencsd -lstdc++
I think that this is related to the issue and there have been some
recent changes around here. So yes I'll look into the fix for the non
static and $CSLIBS mode.
> make LDFLAGS=-static NO_LIBELF=1 NO_JVMTI=1 VF=1 CORESIGHT=1 -C tools/perf/
> <snip>
> ... libbfd-liberty-z: [ OFF ]
> ... libopencsd: [ on ]
> ... libunwind-x86: [ OFF ]
>
> But it ended with compilation failure. Seems like OpenCSD version mismatch.
> I will try to downgrade opencsd library and see if it fixes.
>
> util/cs-etm-decoder/cs-etm-decoder.c: In function 'cs_etm_decoder__gen_trace_elem_printer':
> util/cs-etm-decoder/cs-etm-decoder.c:567:9: error: enumeration value
> 'OCSD_GEN_TRC_ELEM_INSTRUMENTATION' not handled in switch [-Werror=switch-enum]
> 567 | switch (elem->elem_type) {
>
This should be fixed here [1]. Are you building the latest version of
Perf? Downgrading OpenCSD would work to fix this, but so would building
the latest version of Perf.
It's also possible that you are pointing to an old OpenCSD header but
new libraries. The OpenCSD version number is pulled out of
/usr/include/opencsd/ocsd_if_version.h so it's possible to get out of
sync with the .so file.
>>
>>>
>>>>
>>>> cat tools/build/feature/test-libopencsd.make.output <snip library
>>>> paths>
>>>>
>>>> aarch64-xilinx-linux-ld.real: warning: libopencsd.so.1, needed by
>>>> libopencsd_c_api.so, not found (try using -rpath or -rpath-link)
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `vtable for StmTrcPacket'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `DecodeTree::getDecoderStats(unsigned char, _ocsd_decode_stats**)'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `DecodeTree::addRawFramePrinter(RawFramePrinter**, unsigned int)'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `DecodeTree::logMappedRanges()'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `OcsdLibDcdRegister::deregisterAllDecoders()'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `PtmTrcPacket::toString(std::__cxx11::basic_string<char,
>>> std::char_traits<char>, std::allocator<char> >&) const'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `DecodeTree::s_error_logger'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `DecodeTree::addBinFileRegionMemAcc(_ocsd_file_mem_region const*,
>> int,
>>> _ocsd_mem_space_acc_t, std::__cxx11::basic_string<char,
>>> std::char_traits<char>, std::allocator<char> > const&)'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `EtmV4ITrcPacket::~EtmV4ITrcPacket()'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `OcsdLibDcdRegister::getDecoderRegister()'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `typeinfo for TraceComponent'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `EtmV3TrcPacket::~EtmV3TrcPacket()'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `OcsdTraceElement::toString(std::__cxx11::basic_string<char,
>>> std::char_traits<char>, std::allocator<char> >&) const'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `DecodeTree::addGenElemPrinter(TrcGenericElementPrinter**)'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `DecodeTree::DestroyDecodeTree(DecodeTree*)'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `ocsdError::getErrorString[abi:cxx11](ocsdError const&)'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `DecodeTree::setGenTraceElemOutI(ITrcGenElemIn*)'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `ocsdError::ocsdError(ocsdError const*)'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `ocsdError::ocsdError(_ocsd_err_severity_t, _ocsd_err_t, unsigned int,
>>> unsigned char, std::__cxx11::basic_string<char,
>>> std::char_traits<char>, std::allocator<char> > const&)'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `EtmV4ITrcPacket::toString(std::__cxx11::basic_string<char,
>>> std::char_traits<char>, std::allocator<char> >&) const'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `DecodeTree::createDecoder(std::__cxx11::basic_string<char,
>>> std::char_traits<char>, std::allocator<char> > const&, int, CSConfig const*)'
>>>> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined
>>>> reference to
>>> `StmTrcPacket::StmTrcPacket()'
>>>>
>>>
>>> Yes this looks like what I see as well. There is probably some issue
>>> with CSLIBS not being propagated to all parts of the build. I would
>>> recommend using the system library path for now and I will look into a fix
>> next week.
>>> Unless you are happy to look into it and send a fix that would be great too.
>>>
>>> James
>>>
>>>> Thanks,
>>>> Radhey
>>>>
>>>>>
>>>>> Thanks
>>>>> James
>>>>
-L only specifies the search path for libraries directly provided in the
link line with -l. Because -lopencsd isn't specified, it's only linked
because it's a dependency of -lopencsd_c_api. Dependencies like this are
resolved using the default system search paths or -rpath-link=... rather
than -L. This means that compilation only works if OpenCSD is installed
to the system rather than provided with the CSLIBS (-L) option.
This could be fixed by adding -Wl,-rpath-link=$(CSLIBS) but that is less
conventional than just adding -lopencsd to the link line so that it uses
-L. -lopencsd seems to have been removed in commit ed17b1914978 ("perf
tools: Drop requirement for libstdc++.so for libopencsd check") because
it was thought that there was a chance compilation would work even if it
didn't exist, but I think that only applies to libstdc++ so there is no
harm to add it back. libopencsd.so and libopencsd_c_api.so would always
exist together.
Testing
=======
The following scenarios now all work:
* Cross build with OpenCSD installed
* Cross build using CSLIBS=...
* Native build with OpenCSD installed
* Native build using CSLIBS=...
* Static cross build with OpenCSD installed
* Static cross build with CSLIBS=...
Reported-by: Radhey Shyam Pandey <radhey.shyam.pandey(a)amd.com>
Closes: https://lore.kernel.org/linux-arm-kernel/56905d7a-a91e-883a-b707-9d5f686ba5…
Link: https://lore.kernel.org/all/36cc4dc6-bf4b-1093-1c0a-876e368af183@kleine-koe…
Fixes: ed17b1914978 ("perf tools: Drop requirement for libstdc++.so for libopencsd check")
Signed-off-by: James Clark <james.clark(a)arm.com>
---
tools/perf/Makefile.config | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 0609c19caabd..c5db0de49868 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -155,9 +155,9 @@ FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto
ifdef CSINCLUDES
LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
endif
-OPENCSDLIBS := -lopencsd_c_api
+OPENCSDLIBS := -lopencsd_c_api -lopencsd
ifeq ($(findstring -static,${LDFLAGS}),-static)
- OPENCSDLIBS += -lopencsd -lstdc++
+ OPENCSDLIBS += -lstdc++
endif
ifdef CSLIBS
LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
--
2.34.1
On 05/07/2023 12:48, Pandey, Radhey Shyam wrote:
>> -----Original Message-----
>> From: James Clark <james.clark(a)arm.com>
>> Sent: Wednesday, July 5, 2023 4:29 PM
>> To: Pandey, Radhey Shyam <radhey.shyam.pandey(a)amd.com>
>> Cc: coresight(a)lists.linaro.org; linux-arm-kernel(a)lists.infradead.org; Suzuki K
>> Poulose <suzuki.poulose(a)arm.com>; mathieu.poirier(a)linaro.org;
>> mike.leach(a)linaro.org; leo.yan(a)linaro.org;
>> alexander.shishkin(a)linux.intel.com
>> Subject: Re: Linux coresight arm64 : Incorrect data in cstrace.bin
>>
>>
>>
>> On 05/07/2023 10:56, Pandey, Radhey Shyam wrote:
>>>> -----Original Message-----
>>>> From: Suzuki K Poulose <suzuki.poulose(a)arm.com>
>>>> Sent: Wednesday, July 5, 2023 1:57 PM
>>>> To: Pandey, Radhey Shyam <radhey.shyam.pandey(a)amd.com>;
>>>> mathieu.poirier(a)linaro.org; mike.leach(a)linaro.org;
>>>> leo.yan(a)linaro.org; alexander.shishkin(a)linux.intel.com
>>>> Cc: coresight(a)lists.linaro.org; linux-arm-kernel(a)lists.infradead.org
>>>> Subject: Re: Linux coresight arm64 : Incorrect data in cstrace.bin
>>>>
>>>> Hi Radhe Shyam
>>>>
>>>> On 05/07/2023 05:38, Pandey, Radhey Shyam wrote:
>>>>> Hi,
>>>>>
>>>>> I am using linux 6.1 kernel coresight framework to capture ETM trace.
>>>>> Enabled coresight driver and added coresight component device node
>>>>> in DTS. With that, we could probe all coresight components.
>>>>>
>>>>> But when we do capture using sysfs and then read the trace.bin using
>>>>> ptm2human we see invalid trace data. Trace content changes on each
>>>>> capture. Any pointers to help narrow down the issue?
>>>>>
>>>>> Tried: sysfs capture and perf (with OpenCSD enabled)
>>>>>
>>>>> Development board: VCK190 :
>>>>> https://docs.xilinx.com/r/en-US/ug1366-vck190-eval-bd
>>>>> https://www.xilinx.com/support/documents/architecture-
>>>> manuals/am011-ve
>>>>> rsal-acap-trm.pdf
>>>>>
>>>>> xilinx-vck190-20231:/home/petalinux# dmesg | grep -i amba
>>>>> [ 0.301054] Serial: AMBA PL011 UART driver
>>>>> [ 0.306226] amba f0c20000.funnel: Fixing up cyclic dependency with
>>>> f0d70000.etm
>>>>> [ 0.313624] amba f0c20000.funnel: Fixing up cyclic dependency with
>>>> f0d30000.etm
>>>>> [ 0.321110] amba f0c30000.etf: Fixing up cyclic dependency with
>>>> f0c20000.funnel
>>>>> [ 1.470247] Serial: AMBA driver
>>>>> xilinx-vck190-20231:/home/petalinux# dmesg | grep -i coresight
>>>>> [ 1.865006] cs_system_cfg: CoreSight Configuration manager initialised
>>>>> [ 1.876858] coresight etm0: CPU0: etm v4.0 initialized
>>>>> [ 1.885666] coresight etm1: CPU1: etm v4.0 initialized
>>>>> [ 1.894435] coresight-cpu-debug f0d00000.debug1: Coresight debug-
>> CPU0
>>>> initialized
>>>>> [ 1.902072] coresight-cpu-debug f0d40000.debug1: Coresight debug-
>> CPU1
>>>> initialized
>>>>>
>>>>> xilinx-vck190-20231:/home/petalinux# ls /sys/bus/coresight/devices/
>>>>> etm0 etm1 funnel0 tmc_etf0
>>>>>
>>>>> cd /sys/bus/coresight/devices/
>>>>> echo 1 > tmc_etf0/enable_sink
>>>>> echo 1 > etm0/enable_source
>>>>> echo 0 > etm0/enable_source
>>>>> echo 0 > tmc_etf0/enable_sink
>>>>> cd /root/ dd if=/dev/tmc_etf0 of=cstrace_28Jun.bin
>>>>>
>>>>> ./ptm2human/ptm2human -e -i cstrace.bin -d
>>>>
>>>> Please note that ptm2human is for PTM trace decoding and
>>>> ETMv4 uses a different format and thus is not compatible.
>>>>
>>>>>
>>>>> I also tried OpenCSD integration with PERF.
>>>>
>>>> Have you made sure the perf is "linked" to the opencsd ?
>>>
>>> Earlier I statically linked but after adding CORESIGHT=1.
>>>
>>>
>>> linux-xlnx$ make ARCH=arm64 NO_LIBELF=1 NO_JVMTI=1 VF=1
>> CORESIGHT=1 -C
>>> tools/perf/
>>> make: Entering directory 'linux-xlnx/tools/perf'
>>> BUILD: Doing 'make -j24' parallel build
>>>
>>> Makefile.config:520: *** Error: No libopencsd library found or the version
>> is not up-to-date.
>>> Please install recent libopencsd to build with CORESIGHT=1. Stop.
>>>
>>>
>>> echo $CSINCLUDES
>>> /scratch/development/coresight/my-opencsd/decoder/include
>>> radheys@xhdradheys41:/scratch/development/linux-xlnx$ ls
>>> /scratch/development/coresight/my-opencsd/decoder/include
>>> common i_dec interfaces mem_acc opencsd opencsd.h pkt_printers
>>>
>>> echo $CSLIBS
>>> /scratch/development/coresight/my-opencsd/decoder/lib/builddir
>>> radheys@xhdradheys41:/scratch/development/linux-xlnx$ ls
>> /scratch/development/coresight/my-opencsd/decoder/lib/builddir
>>> libopencsd.a libopencsd_c_api.so libopencsd_c_api.so.1.4.0
>> libopencsd.so.1
>>> libopencsd_c_api.a libopencsd_c_api.so.1 libopencsd.so
>> libopencsd.so.1.4.0
>>>
>>> Anything I am missing to fix this opencsd lib not found?
>>
>> There is a minimum version of 1.1.1 but it looks like you are using higher
>> than that so that part should be fine.
>>
>> Personally I "make install" OpenCSD to the system path. I had a play around
>> with $CSLIBS it and maybe there is also some stickyness to the feature
>> detection so a make clean might help to make sure the errors you are seeing
>> are real.
>>
>> Lastly you can print the output of why the feature test compilation failed
>> which might help. I see some linking issues in there if I delete my system
>> installed version of OpenCSD, so there might be a bug with just using
>> CSINCLUDES and CSLIBS:
>>
>> $ cat tools/build/feature/test-libopencsd.make.output
>>
>> /usr/bin/ld: warning: libopencsd.so.1, needed by opencsd-
>> local/decoder/lib/builddir//libopencsd_c_api.so, not found (try using -rpath
>> or -rpath-link)
>> /usr/bin/ld: opencsd-local/decoder/lib/builddir//libopencsd_c_api.so:
>> undefined reference to `vtable for StmTrcPacket'
>> /usr/bin/ld: opencsd-local/decoder/lib/builddir//libopencsd_c_api.so:
>> undefined reference to `DecodeTree::getDecoderStats(unsigned char,
>> _ocsd_decode_stats**)'
>> /usr/bin/ld: opencsd-local/decoder/lib/builddir//libopencsd_c_api.so:
>> undefined reference to
>> `DecodeTree::addRawFramePrinter(RawFramePrinter**, unsigned int)'
>>
>> Can you try the make install and see if that works? If that works but the other
>> way doesn't I can try looking into why its not and make a fix.
>
> I tried make install but still it errors out. Looking at make.output
> I am seeing multiple undefined references.
>
> NOTE I have to still set CSINCLUDES and CSLIBS as we are cross-compiling
> Perf on a x86 host machine.
This should still work if you make install them to the arch specific
folder for example /usr/lib/aarch64-linux-gnu/. If do 'apt install
libopencsd-dev:arm64' I would get the arm ones in there.
Then if I cross build like this I get openCSD linked:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C tools/perf CORESIGHT=1
So for now you should be able to work around the issue in this way.
>
> cat tools/build/feature/test-libopencsd.make.output <snip library paths>
>
> aarch64-xilinx-linux-ld.real: warning: libopencsd.so.1, needed by libopencsd_c_api.so, not found (try using -rpath or -rpath-link)
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `vtable for StmTrcPacket'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `DecodeTree::getDecoderStats(unsigned char, _ocsd_decode_stats**)'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `DecodeTree::addRawFramePrinter(RawFramePrinter**, unsigned int)'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `DecodeTree::logMappedRanges()'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `OcsdLibDcdRegister::deregisterAllDecoders()'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `PtmTrcPacket::toString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `DecodeTree::s_error_logger'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `DecodeTree::addBinFileRegionMemAcc(_ocsd_file_mem_region const*, int, _ocsd_mem_space_acc_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `EtmV4ITrcPacket::~EtmV4ITrcPacket()'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `OcsdLibDcdRegister::getDecoderRegister()'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `typeinfo for TraceComponent'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `EtmV3TrcPacket::~EtmV3TrcPacket()'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `OcsdTraceElement::toString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `DecodeTree::addGenElemPrinter(TrcGenericElementPrinter**)'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `DecodeTree::DestroyDecodeTree(DecodeTree*)'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `ocsdError::getErrorString[abi:cxx11](ocsdError const&)'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `DecodeTree::setGenTraceElemOutI(ITrcGenElemIn*)'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `ocsdError::ocsdError(ocsdError const*)'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `ocsdError::ocsdError(_ocsd_err_severity_t, _ocsd_err_t, unsigned int, unsigned char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `EtmV4ITrcPacket::toString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `DecodeTree::createDecoder(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, CSConfig const*)'
> aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined reference to `StmTrcPacket::StmTrcPacket()'
>
Yes this looks like what I see as well. There is probably some issue
with CSLIBS not being propagated to all parts of the build. I would
recommend using the system library path for now and I will look into a
fix next week. Unless you are happy to look into it and send a fix that
would be great too.
James
> Thanks,
> Radhey
>
>>
>> Thanks
>> James
>