Commit d7aa8d0a authored by Andrew Turner's avatar Andrew Turner
Browse files

Import OpenCSD v0.14.2

Sponsored by:	Innovate UK
parent cf98ba14
......@@ -4,37 +4,39 @@ HOWTO - using the library with perf {#howto_perf}
@brief Using command line perf and OpenCSD to collect and decode trace.
This HOWTO explains how to use the perf cmd line tools and the openCSD
library to collect and extract program flow traces generated by the
library to collect and extract program flow traces generated by the
CoreSight IP blocks on a Linux system. The examples have been generated using
an aarch64 Juno-r0 platform. All information is considered accurate and tested
using the latest version of the library and the `master` branch on the
[perf-opencsd github repository][1].
an aarch64 Juno-r0 platform.
On Target Trace Acquisition - Perf Record
-----------------------------------------
All the enhancement to the Perf tools that support the new `cs_etm` pmu have
not been upstreamed yet. To get the required functionality branch
`perf-opencsd-master` needs to be downloaded to the target system where
traces are to be collected. This branch is a vanilla upstream kernel
supplemented with modifications to the CoreSight framework and drivers to be
usable by the Perf core. The remaining out of tree patches are being
upstreamed incrementally.
From there compiling the perf tools with `make -C tools/perf CORESIGHT=1` will
yield a `perf` executable that will support CoreSight trace collection. Note
that if traces are to be decompressed *off* target, there is no need to download
Compile the perf tool from the same kernel source code version you are using with:
make -C tools/perf
This will yield a `perf` executable that will support CoreSight trace collection.
*Note:* If traces are to be decompressed **off** target, there is no need to download
and compile the openCSD library (on the target).
If you are instead planning to use perf to record and decode the trace on the target,
compile the perf tool linking against the openCSD library, in the following way:
make -C tools/perf VF=1 CORESIGHT=1
Further information on the needed build environments and options are detailed later
in the section **Off Target Perf Tools Compilation**.
Before launching a trace run a sink that will collect trace data needs to be
identified. All CoreSight blocks identified by the framework are registed in
sysFS:
linaro@linaro-nano:~$ ls /sys/bus/coresight/devices/
20010000.etf 20040000.main_funnel 22040000.etm 22140000.etm
230c0000.A53_funnel 23240000.etm replicator@20020000 20030000.tpiu
20070000.etr 220c0000.A57_funnel 23040000.etm 23140000.etm 23340000.etm
etm0 etm2 etm4 etm6 funnel0 funnel2 funnel4 stm0 tmc_etr0
etm1 etm3 etm5 etm7 funnel1 funnel3 replicator0 tmc_etf0
CoreSight blocks are listed in the device tree for a specific system and
......@@ -43,7 +45,7 @@ the sink that will recieve trace data needs to be identified and given as an
option on the perf command line. Once a sink has been identify trace collection
can start. An easy and yet interesting example is the `uname` command:
linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -e cs_etm/@20070000.etr/ --per-thread uname
linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -e cs_etm/@tmc_etr0/ --per-thread uname
This will generate a `perf.data` file where execution has been traced for both
user and kernel space. To narrow the field to either user or kernel space the
......@@ -51,7 +53,7 @@ user and kernel space. To narrow the field to either user or kernel space the
traces to user space:
linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -vvv -e cs_etm/@20070000.etr/u --per-thread uname
linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -vvv -e cs_etm/@tmc_etr0/u --per-thread uname
Problems setting modules path maps, continuing anyway...
-----------------------------------------------------------
perf_event_attr:
......@@ -131,9 +133,9 @@ falls within the specified range. Any work done by the CPU outside of that
range will not be traced. Address range filters can be specified for both
user and kernel space session:
perf record -e cs_etm/@20070000.etr/k --filter 'filter 0xffffff8008562d0c/0x48' --per-thread uname
perf record -e cs_etm/@tmc_etr0/k --filter 'filter 0xffffff8008562d0c/0x48' --per-thread uname
perf record -e cs_etm/@20070000.etr/u --filter 'filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' --per-thread ./main
perf record -e cs_etm/@tmc_etr0/u --filter 'filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' --per-thread ./main
When dealing with kernel space trace addresses are typically taken in the
'System.map' file. In user space addresses are relocatable and can be
......@@ -171,20 +173,20 @@ equal to the start address. Incidentally traces stop being generated when the
insruction pointer is equal to the stop address. Anything that happens between
there to events is traced:
perf record -e cs_etm/@20070000.etr/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0' --per-thread uname
perf record -e cs_etm/@tmc_etr0/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0' --per-thread uname
perf record -vvv -e cs_etm/@20070000.etr/u --filter 'start 0x72c@/opt/lib/libcstest.so.1.0, \
perf record -vvv -e cs_etm/@tmc_etr0/u --filter 'start 0x72c@/opt/lib/libcstest.so.1.0, \
stop 0x40082c@/home/linaro/main' \
--per-thread ./main
--per-thread ./main
**Limitation on address filters:**
The only limitation on address filters is the amount of address comparator
found on an implementation and the mutual exclusion between range and
start stop filters. As such the following example would _not_ work:
perf record -e cs_etm/@20070000.etr/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0, \ // start/stop
perf record -e cs_etm/@tmc_etr0/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0, \ // start/stop
filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' \ // address range
--per-thread uname
--per-thread uname
Additional Trace Options
------------------------
......@@ -198,10 +200,32 @@ Presently this threshold is fixed at 256 cycles for `perf record`.
Command line options in `perf record` to use these features are part of the options for the `cs_etm` event:
perf record -e cs_etm/timestamp,cycacc,@20070000.etr/ --per-thread uname
perf record -e cs_etm/timestamp,cycacc,@tmc_etr0/ --per-thread uname
At current version, `perf record` and `perf script` do not use this additional information.
The cs_etm perf event
---------------------
System information for this perf pmu event can be found at:
/sys/devices/cs_etm
This contains internal format of the parameters described above:
root@linaro-developer:~# ls /sys/devices/cs_etm/format
contextid cycacc retstack sinkid timestamp
and names of registered sinks:
root@linaro-developer:~# ls /sys/devices/cs_etm/sinks
tmc_etf0 tmc_etr0 tpiu0
Note: The `sinkid` parameter is there to document the usage of a 32-bit internal parameter to
pass the sink name used in the cs_etm/@sink/ command to the kernel drivers. It can be used
directly as cs_etm/sinkid=<hash_value>/ but this is not recommended as the values used are
considered opaque and subject to changes.
On Target Trace Collection
--------------------------
The entire program flow will have been recorded in the `perf.data` file.
......@@ -248,7 +272,7 @@ The openCSD library is not part of the perf tools. It is available on
[github][1] and needs to be compiled before the perf tools. Checkout the
required branch/tag version into a local directory.
linaro@t430:~/linaro/coresight$ git clone -b v0.8 https://github.com/Linaro/OpenCSD.git my-opencsd
linaro@t430:~/linaro/coresight$ git clone https://github.com/Linaro/OpenCSD.git my-opencsd
Cloning into 'OpenCSD'...
remote: Counting objects: 2063, done.
remote: Total 2063 (delta 0), reused 0 (delta 0), pack-reused 2063
......@@ -301,7 +325,8 @@ distribution without having to be compiled.
Off Target Perf Tools Compilation
---------------------------------
As mentionned above the openCSD library is not part of the perf tools' code base
As mentioned above the openCSD library is not part of the perf tools' code base
and needs to be installed on a system prior to compilation. Information about
the status of the openCSD library on a system is given at compile time by the
perf tools build script:
......@@ -366,8 +391,8 @@ output as follows:-
Set to any other value will remove the RAW_PACKED lines.
Working with a debug version of the openCSD library
---------------------------------------------------
Working with an alternate version of the openCSD library
--------------------------------------------------------
When compiling the perf tools it is possible to reference another version of
the openCSD library than the one installed on the system. This is useful when
working with multiple development trees or having the desire to keep system
......@@ -407,9 +432,13 @@ where the perf tools and openCSD library have been compiled.
-rw------- 1 linaro linaro 78016 Feb 24 12:21 perf.data
-rw-rw-r-- 1 linaro linaro 1245881 Feb 24 12:25 uname.v4.user.sept20.tgz
Perf is expecting files related to the trace capture (`perf.data`) to be located
under `~/.debug` [3]. This example will remove the current `~/.debug` directory
to be sure everything is clean.
Perf is expecting files related to the trace capture (`perf.data`) to be located in the `buildid` directory.
By default this is under `~/.debug`. Alternatively the default `buildid` directory can be changed
using the command:
perf config --system buildid.dir=/my/own/buildid/dir
This example will remove the current `~/.debug` directory to be sure everything is clean.
linaro@t430:~/linaro/coresight/sept20$ rm -rf ~/.debug
linaro@t430:~/linaro/coresight/sept20$ cp -dpR .debug ~/
......@@ -586,12 +615,18 @@ Use as follows:-
1. Prior to building perf, edit `perf-setup-env.bash` to conform to your environment. There are four lines at the top of the file that will require editing.
2. Execute the script using the command
2. Execute the script using the command:
source perf-setup-env.bash
This will set up all the environment variables mentioned in the sections on building and running
perf above, and these are used by the `perf-test...` scripts to run the tests.
This will set up a perf execute environment for using the perf report and script commands.
Alternatively use the command:
source perf-setup-env.base buildenv
This will add in the build environment variables mentioned in the sections on building above alongside the
environment for using the used by the `perf-test...` scripts to run the tests.
3. Build perf as described above.
4. Follow the instructions for downloading the test capture, or create a capture from your target.
......@@ -629,8 +664,6 @@ Best regards,
*The Linaro CoreSight Team*
--------------------------------------
[1]: https://github.com/Linaro/perf-opencsd "perf-opencsd Github"
[1]: https://github.com/Linaro/OpenCSD
[2]: http://people.linaro.org/~mathieu.poirier/openCSD/uname.v4.user.sept20.tgz
[3]: Get in touch with us if you know a way to change this.
......@@ -27,11 +27,11 @@ Releases will appear on the master branch in the git repository with an appropri
CoreSight Trace Component Support.
----------------------------------
_Current Version 0.12.0_
_Current Version 0.14.2_
### Current support:
- ETMv4 (v4.4) instruction trace - packet processing and packet decode.
- ETMv4 (v4.5 [A/R profile] v4.4 [M profile]) instruction trace - packet processing and packet decode.
- PTM (v1.1) instruction trace - packet processing and packet decode.
- ETMv3 (v3.5) instruction trace - packet processing and packet decode.
- ETMv3 (v3.5) data trace - packet processing.
......@@ -55,12 +55,11 @@ Note on the Git Repository.
This git repository for OpenCSD contains only source for the OpenCSD decoder library.
From version 0.4, releases appear as versioned tags on the master branch.
From version 0.7.4, the required updates to CoreSight drivers and perf, that are not
currently upstream in the linux kernel tree, are now contained in a separate
repository to be found at:
https://github.com/Linaro/perf-opencsd
CoreSight kernel drivers and perf suport for CoreSight trace is maintained in the latest
upstream kernel versions.
One exception is a minor patch required for autoFDO support.
See [autofdo.md](@ref AutoFDO).
Documentation
-------------
......@@ -142,29 +141,75 @@ Version and Modification Information
AutoFDO: update documentation for AutoFDO usage and add in "record.sh" script
- _Version 0.9.3_: Bugfix: Test snapshot library not handling 'offset' parameters in dump file sections.
Install: ocsd_if_version.h moved to opencsd/include to allow installation on OS & use in compiling client apps.
- _Version 0.10.0_: __Updates__: Add additional information about the last instruction to the generic output packet.
__Docs__: update docs for updated output packet.
__Bugfix__: typecast removed from OCSD_VER_NUM in ocsd_if_version.h to allow use in C pre-processor.
__Bugfix__: ETMV4: Interworking ISA change between A32-T32 occasionally missed during instruction decode.
- _Version 0.10.1_: __Updates__: Build update - allow multi-thread make (make -j<N>).
__Docs__: Minor update to AutoFDO documentation.
- _Version 0.11.0_: __Update__: ETM v4 decoder updated to support ETM version up to v4.4
__Update__: Memory access callback function - added new callback signature to provide TraceID to client when requesting memory.
__Update__: Created new example program to demonstrate using memory buffer in APIs.
__Bugfix__: Typos in docs and source.
__Bugfix__: Memory accessor - validate callback return values.
- _Version 0.11.1_: __Update__: build:- change -fpic to -fPIC to allow Debian build on sparc.
__Bugfix__: build:- remove unused variable
- _Version 0.11.2_: __Update__: docs:- HOWTO.md update to match new perf build requirements.
__Bugfix__: Minor spelling typos fixed.
- _Version 0.12.0_: __Update__: Frame deformatter - TPIU FSYNC and HSYNC support added.
__Update__: ETM v4: Bugfix & clarification on Exception trace handling. Where exception occurs at a branch target before any instructions
have been executed, the preferred return address is also the target address of the branch instruction. This case now includes as specific flag in
the packet. Additionally any context change associated with this target address was being applied incorrectly.
__Update__: Core / Architecture mapping to core names as used by test programs / snapshots updated to include additional recent ARM cores.
__Update__: Docs: Update to reflect new exception flag. Update test program example to reflect latest output.
__Bugfix__: ETM v4: Valid trace info packet was not handled correctly (0x01, 0x00).
__Bugfix__: ETM v4: Error messaging on commit stack overflow.
- _Version 0.10.0_:
- __Updates__: Add additional information about the last instruction to the generic output packet.
- __Docs__: update docs for updated output packet.
- __Bugfix__: typecast removed from OCSD_VER_NUM in ocsd_if_version.h to allow use in C pre-processor.
- __Bugfix__: ETMV4: Interworking ISA change between A32-T32 occasionally missed during instruction decode.
- _Version 0.10.1_:
- __Updates__: Build update - allow multi-thread make (make -j<N>).
- __Docs__: Minor update to AutoFDO documentation.
- _Version 0.11.0_:
- __Update__: ETM v4 decoder updated to support ETM version up to v4.4
- __Update__: Memory access callback function - added new callback signature to provide TraceID to client when requesting memory.
- __Update__: Created new example program to demonstrate using memory buffer in APIs.
- __Bugfix__: Typos in docs and source.
- __Bugfix__: Memory accessor - validate callback return values.
- _Version 0.11.1_:
- __Update__: build:- change -fpic to -fPIC to allow Debian build on sparc.
- __Bugfix__: build:- remove unused variable
- _Version 0.11.2_:
- __Update__: docs:- HOWTO.md update to match new perf build requirements.
- __Bugfix__: Minor spelling typos fixed.
- _Version 0.12.0_:
- __Update__: Frame deformatter - TPIU FSYNC and HSYNC support added.
- __Update__: ETM v4: Bugfix & clarification on Exception trace handling. Where exception occurs at a branch target before any instructions
have been executed, the preferred return address is also the target address of the branch instruction. This case now includes as specific flag in
the packet. Additionally any context change associated with this target address was being applied incorrectly.
- _Update__: Core / Architecture mapping to core names as used by test programs / snapshots updated to include additional recent ARM cores.
- __Update__: Docs: Update to reflect new exception flag. Update test program example to reflect latest output.
- __Bugfix__: ETM v4: Valid trace info packet was not handled correctly (0x01, 0x00).
- __Bugfix__: ETM v4: Error messaging on commit stack overflow.
- _Version 0.12.1_:
- __Update__: build: remove -g option from release build.
- __Update__: tests: Snapshots can now use generic arch+profile names rather than core names, e.g. ARMv8-A
- __Bugfix__: Instruction decode - v8.3 B[L]A{A|B}[Z] instructions mis-identified.
-__Bugfix__: Transition from A64 to A32 can be mis-decoded if the trace implementation represents the transition
as an individual address packet followed by a context packet.
- _Version 0.12.2_:
- __Bugfix__: Clean up memory leaks.
- __Bugfix__: ETMv4: Ensure addressing history zeroed after TINFO.
- __Update__: Allow GCC version to be included in build output path.
- __Bugfix__: Packet printing update when WFI/WFE is P0 element.
- _Version 0.13.x_ : Intermediate development version.
- _Version 0.14.0_:
- __Update__: ETMv4 - decoder update & simplification to handle advanced trace features.
- __Update__: ETMv4 - decoder support for speculative trace.
- __Update__: Generic Elements: Additional information in EOT, UNSYNC, ON packets to give reason.
- __Update__: Memaccess: Add EL2 secure memory space flag.
- __Update__: Documentation: Updated for release changes and to reflect latest kernel version support for CoreSight.
- __Update__: Perf helper scripts updated to reflect latest build flow.
- __Bugfix__: Fix for component operational flag inputs.
- _Version 0.14.1_:
- __Update__: ETMv4 - Add support for Q elements.
- __Bugfix__: build: fix logic issue for && operator. (github issue #23, sumitted by yabinc)
- _Version 0.14.2_:
- __Update__: Architecture versioning. Set enum tag values to make conversion to numeric version easier.
- __Update__: I-decode: remove global temporary decode state data and replace with local instance data
to make library more easily usable in multi-threaded programs.
- __Bugfix__: I-decode: Some Thumb instructions not correctly reported as implied returns.
(github issue #24, submitted by kongy).
Licence Information
......
......@@ -70,8 +70,8 @@ INSTALL_BIN_DIR=$(PREFIX)/bin
export INSTALL_INCLUDE_DIR=$(PREFIX)/include/
# compile flags
CFLAGS += $(CPPFLAGS) -c -Wall -DLINUX -Wno-switch -fPIC
CXXFLAGS += $(CPPFLAGS) -c -Wall -DLINUX -Wno-switch -fPIC -std=c++11
CFLAGS += $(CPPFLAGS) -c -Wall -DLINUX -Wno-switch -Wlogical-op -fPIC
CXXFLAGS += $(CPPFLAGS) -c -Wall -DLINUX -Wno-switch -Wlogical-op -fPIC -std=c++11
LDFLAGS += -Wl,-z,defs
ARFLAGS ?= rcs
......@@ -81,8 +81,8 @@ CFLAGS += -g -O0 -DDEBUG
CXXFLAGS += -g -O0 -DDEBUG
BUILD_VARIANT=dbg
else
CFLAGS += -g -O2 -DNDEBUG
CXXFLAGS += -g -O2 -DNDEBUG
CFLAGS += -O2 -DNDEBUG
CXXFLAGS += -O2 -DNDEBUG
BUILD_VARIANT=rel
endif
......
......@@ -56,7 +56,12 @@ CXXFLAGS += $(MFLAG)
CFLAGS += $(MFLAG)
LDFLAGS += $(MFLAG)
ifdef GCCDIR
GCCVER:= $(shell $(CROSS_COMPILE)gcc -dumpversion | cut -c 1-3)
PLAT_DIR=builddir/linux$(BIT_VARIANT)/GCC_$(GCCVER)
else
PLAT_DIR=linux$(BIT_VARIANT)/$(BUILD_VARIANT)
endif
# include the main makefile
include makefile
......@@ -59,11 +59,9 @@ ETMV3OBJ= $(BUILD_DIR)/trc_cmp_cfg_etmv3.o \
$(BUILD_DIR)/trc_pkt_proc_etmv3_impl.o
ETMV4OBJ= $(BUILD_DIR)/trc_cmp_cfg_etmv4.o \
$(BUILD_DIR)/trc_pkt_proc_etmv4.o \
$(BUILD_DIR)/trc_pkt_proc_etmv4i_impl.o \
$(BUILD_DIR)/trc_pkt_proc_etmv4i.o \
$(BUILD_DIR)/trc_pkt_decode_etmv4i.o \
$(BUILD_DIR)/trc_pkt_elem_etmv4i.o \
$(BUILD_DIR)/trc_pkt_elem_etmv4d.o \
$(BUILD_DIR)/trc_etmv4_stack_elem.o
PTMOBJ= $(BUILD_DIR)/trc_cmp_cfg_ptm.o \
......@@ -94,6 +92,7 @@ OBJECTS=$(BUILD_DIR)/ocsd_code_follower.o \
$(BUILD_DIR)/ocsd_error.o \
$(BUILD_DIR)/ocsd_error_logger.o \
$(BUILD_DIR)/ocsd_gen_elem_list.o \
$(BUILD_DIR)/ocsd_gen_elem_stack.o \
$(BUILD_DIR)/ocsd_lib_dcd_register.o \
$(BUILD_DIR)/ocsd_msg_logger.o \
$(BUILD_DIR)/ocsd_version.o \
......
......@@ -323,6 +323,7 @@
<ClInclude Include="..\..\..\include\common\ocsd_error.h" />
<ClInclude Include="..\..\..\include\common\ocsd_error_logger.h" />
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_list.h" />
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_stack.h" />
<ClInclude Include="..\..\..\include\common\ocsd_lib_dcd_register.h" />
<ClInclude Include="..\..\..\include\common\ocsd_msg_logger.h" />
<ClInclude Include="..\..\..\include\common\ocsd_pe_context.h" />
......@@ -400,8 +401,6 @@
<ClInclude Include="..\..\..\include\opencsd\trc_gen_elem_types.h" />
<ClInclude Include="..\..\..\include\opencsd\trc_pkt_types.h" />
<ClInclude Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.h" />
<ClInclude Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4d_impl.h" />
<ClInclude Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4i_impl.h" />
<ClInclude Include="..\..\..\source\trc_frame_deformatter_impl.h" />
</ItemGroup>
<ItemGroup>
......@@ -413,10 +412,8 @@
<ClCompile Include="..\..\..\source\etmv4\trc_cmp_cfg_etmv4.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_etmv4_stack_elem.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_decode_etmv4i.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_elem_etmv4d.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_elem_etmv4i.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4i_impl.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4i.cpp" />
<ClCompile Include="..\..\..\source\i_dec\trc_idec_arminst.cpp" />
<ClCompile Include="..\..\..\source\i_dec\trc_i_decode.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_base.cpp" />
......@@ -430,6 +427,7 @@
<ClCompile Include="..\..\..\source\ocsd_error.cpp" />
<ClCompile Include="..\..\..\source\ocsd_error_logger.cpp" />
<ClCompile Include="..\..\..\source\ocsd_gen_elem_list.cpp" />
<ClCompile Include="..\..\..\source\ocsd_gen_elem_stack.cpp" />
<ClCompile Include="..\..\..\source\ocsd_lib_dcd_register.cpp" />
<ClCompile Include="..\..\..\source\ocsd_msg_logger.cpp" />
<ClCompile Include="..\..\..\source\ocsd_version.cpp" />
......
......@@ -221,12 +221,6 @@
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_decode_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4d_impl.h">
<Filter>Source Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4i_impl.h">
<Filter>Source Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.h">
<Filter>Source Files\etmv3</Filter>
</ClInclude>
......@@ -359,6 +353,9 @@
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_stack.h">
<Filter>Header Files\common</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\trc_component.cpp">
......@@ -385,18 +382,9 @@
<ClCompile Include="..\..\..\source\ptm\trc_pkt_proc_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_elem_etmv4d.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_elem_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4i_impl.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_decode_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
......@@ -490,5 +478,11 @@
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cache.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_gen_elem_stack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -38,7 +38,7 @@ PROJECT_NAME = "OpenCSD - CoreSight Trace Decode Library"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 0.10.0
PROJECT_NUMBER = 0.14.2
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
......
......@@ -83,7 +83,7 @@ typedef struct _ocsd_generic_trace_elem {
trace_on_reason_t trace_on_reason; /* reason for the trace on packet */
ocsd_swt_info_t sw_trace_info; /* software trace packet info */
uint32_t num_instr_range; /* number of instructions covered by range packet (for T32 this cannot be calculated from en-st/i_size) */
unsync_info_t unsync_eot_info; /* additional information for unsync / end-of-trace packets. */
};
const void *ptr_extended_data; /* pointer to extended data buffer (data trace, sw trace payload) / custom structure */
......@@ -142,6 +142,19 @@ __ETMv3, PTM__ : These protocols can output a cycle count directly as part of th
the trace range. In this case `has_cc` will be 1 and `cycle_count` will be valid.
### OCSD_GEN_TRC_ELEM_I_RANGE_NOPATH ###
__packet fields valid__: `isa, st_addr, en_addr, num_instr_range`
`num_instr_range` represents the number of instructions executed in this range, but there is incomplete information
as to program execution path from start to end of range.
If `num_instr` is 0, then an unknown number of instructions were executed between the start and end of the range.
`st_addr` represents the start of execution represented by this packet.
`en_addr` represents the address where execution will continue from after the instructions represented by this packet.
`isa` represents the ISA for the instruction at `en_addr`.
Used when ETMv4 Q elements are being traced.
### OCSD_GEN_TRC_ELEM_ADDR_NACC ###
__packet fields valid__: `st_addr`
......
......@@ -20,6 +20,9 @@ See [external_custom.md](@ref custom_decoders) for details.
These programs are both built at the same time as the library for the same set of platforms.
See [build_libs.md](@ref build_lib) for build details.
_Note:_ The programs above use the library's [core name mapper helper class] (@ref CoreArchProfileMap) to map
the name of the core into a profile / architecture pair that the library can use.
The snapshot definition must use one of the names recognised by this class or an error will occur.
Trace "Snapshot" directory.
----------------------------
......
......@@ -115,6 +115,9 @@ ocsd_err_t DecoderMngrBase<P,Pt,Pc>::createDecoder(const int create_flags, cons
if(!pkt_proc)
return OCSD_ERR_MEM;
// set the op mode flags
pkt_proc->setComponentOpMode(create_flags & (OCSD_OPFLG_COMP_MODE_MASK | OCSD_OPFLG_PKTPROC_COMMON));
// set the configuration
TrcPktProcBase<P,Pt,Pc> *pProcBase = dynamic_cast< TrcPktProcBase<P,Pt,Pc> *>(pkt_proc);
if(pProcBase == 0)
......@@ -133,6 +136,9 @@ ocsd_err_t DecoderMngrBase<P,Pt,Pc>::createDecoder(const int create_flags, cons
if(!pkt_dcd)
return OCSD_ERR_MEM;
// set the op mode flags
pkt_dcd->setComponentOpMode(create_flags & (OCSD_OPFLG_COMP_MODE_MASK | OCSD_OPFLG_PKTDEC_COMMON));
// get the decoder base
TrcPktDecodeBase<P,Pc> *pBase = dynamic_cast< TrcPktDecodeBase<P,Pc> *>(pkt_dcd);
if(pBase == 0)
......
/*
* \file ocsd_gen_elem_stack.h
* \brief OpenCSD : Generic element output stack.
* \file ocsd_gen_elem_list.h
* \brief OpenCSD : Generic element output list.
*
* \copyright Copyright (c) 2016, ARM Limited. All Rights Reserved.
*/
......@@ -47,7 +47,7 @@
* This should remove some of the requirement on the packet processing to be re-enterant,
* simplifying this code.
*
* Last element(s) on this stack can be marked pending to allow for later cancellation.
* Last element(s) on this list can be marked pending to allow for later cancellation.
* (This required for cancel element in ETMv3 exeception branch).
*
* The "list" is actually a ring buffer - maintaining pointers to indicate current valid elements.
......@@ -150,4 +150,4 @@ inline void OcsdGenElemList::initSendIf(componentAttachPt<ITrcGenElemIn> *pGenEl
m_sendIf = pGenElemIf;
}
/* End of File ocsd_gen_elem_stack.h */
/* End of File ocsd_gen_elem_list.h */
/*
* \file ocsd_gen_elem_stack.h
* \brief OpenCSD : Generic element output stack.
*
* \copyright Copyright (c) 2020, ARM Limited. All Rights Reserved.
*/
/*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "trc_gen_elem.h"
#include "comp_attach_pt_t.h"
#include "interfaces/trc_gen_elem_in_i.h"