All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pandey, Radhey Shyam" <radhey.shyam.pandey@amd.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>,
	"mathieu.poirier@linaro.org" <mathieu.poirier@linaro.org>,
	"mike.leach@linaro.org" <mike.leach@linaro.org>,
	"leo.yan@linaro.org" <leo.yan@linaro.org>,
	"alexander.shishkin@linux.intel.com"
	<alexander.shishkin@linux.intel.com>
Cc: "coresight@lists.linaro.org" <coresight@lists.linaro.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: Linux coresight arm64 : Incorrect data in cstrace.bin
Date: Wed, 5 Jul 2023 10:48:02 +0000	[thread overview]
Message-ID: <MN0PR12MB5953526EE6610D35C1A162A6B72FA@MN0PR12MB5953.namprd12.prod.outlook.com> (raw)
In-Reply-To: <4cc16daa-a1bc-a9ea-960a-44de894c8b30@arm.com>

> -----Original Message-----
> From: Suzuki K Poulose <suzuki.poulose@arm.com>
> Sent: Wednesday, July 5, 2023 3:49 PM
> To: Pandey, Radhey Shyam <radhey.shyam.pandey@amd.com>;
> mathieu.poirier@linaro.org; mike.leach@linaro.org; leo.yan@linaro.org;
> alexander.shishkin@linux.intel.com
> Cc: coresight@lists.linaro.org; linux-arm-kernel@lists.infradead.org
> 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@arm.com>
> >> Sent: Wednesday, July 5, 2023 1:57 PM
> >> To: Pandey, Radhey Shyam <radhey.shyam.pandey@amd.com>;
> >> mathieu.poirier@linaro.org; mike.leach@linaro.org;
> >> leo.yan@linaro.org; alexander.shishkin@linux.intel.com
> >> Cc: coresight@lists.linaro.org; linux-arm-kernel@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?
> 
> Have you checked the libopencsd version ? It looks it must be able to pick up
> the path for lib/headers.

I cloned https://github.com/Linaro/OpenCSD and version is 1.4.0

Here I am cross-compiling OpenCSD and perf for ARCH64 platform.

I set CSLIBS and CSINCLUDES to point to cross-compiled OpenCSD libs/headers.
Then cross-compile kernel perf application.

export CSLIBS=/scratch/development/coresight/OpenCSD/decoder/lib/builddir
export CSINCLUDES=/scratch/development/coresight/OpenCSD/decoder/include/
export LD_LIBRARY_PATH=$CSLIBS
make NO_LIBELF=1 NO_JVMTI=1 VF=1 CORESIGHT=1 DEBUG=1 -C tools/perf/

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.


> 
> Suzuki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-07-05 10:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <MN0PR12MB5953EED4468905E749489200B72FA@MN0PR12MB5953.namprd12.prod.outlook.com>
2023-07-05  8:26 ` Linux coresight arm64 : Incorrect data in cstrace.bin Suzuki K Poulose
2023-07-05  9:56   ` Pandey, Radhey Shyam
2023-07-05 10:19     ` Suzuki K Poulose
2023-07-05 10:48       ` Pandey, Radhey Shyam [this message]
2023-07-05 10:58     ` James Clark
2023-07-05 11:48       ` Pandey, Radhey Shyam
2023-07-05 12:14         ` James Clark
2023-07-06 12:09           ` Pandey, Radhey Shyam
2023-07-06 12:47             ` Pandey, Radhey Shyam
2023-07-07  8:49               ` James Clark
2023-07-07 15:50                 ` James Clark
2023-07-11  9:30                   ` Pandey, Radhey Shyam

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=MN0PR12MB5953526EE6610D35C1A162A6B72FA@MN0PR12MB5953.namprd12.prod.outlook.com \
    --to=radhey.shyam.pandey@amd.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=suzuki.poulose@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.