Update OpenCSD to v1.4.0.

Sponsored by:	UKRI
This commit is contained in:
Ruslan Bukin 2023-03-27 16:14:10 +01:00 committed by Oscar Zhao
parent 04ce393f6c
commit a45d0d65b7
499 changed files with 102989 additions and 386 deletions

93
.gitignore vendored
View File

@ -1,30 +1,69 @@
*.a
*.core
*.o
*.orig
*.rej
*.la
*.lo
# gcc dependency files
*.d
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.sw[nop]
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
# Vc++ build files
*tlog
Debug/
ipch/
*.opensdf
*.sdf
*.suo
*.user
*.idb
*.pdb
*.exp
*.ilk
.vs/
# ignore emacs backup saves
*~
_.tinderbox.*
_.universe-toolchain
_.amd64.*
_.arm.*
_.arm64.*
_.i386.*
_.powerpc.*
_.riscv.*
GPATH
GRTAGS
GTAGS
ID
cscope.files
cscope.in.out
cscope.out
cscope.po.out
compile_commands.json
compile_commands.events.json
tags
.cache
.clangd
.ccls-cache
# ignore bin test directory
bin/
*.log
ref_trace_decoder/build/win/rctdl_c_api_lib/Release/*
ref_trace_decoder/build/win/rctdl_c_api_lib/x64/Release/*
ref_trace_decoder/build/win/ref_trace_decode_lib/Release/*
ref_trace_decoder/build/win/ref_trace_decode_lib/x64/Release/*
ref_trace_decoder/tests/build/win/simple_pkt_print_c_api/Release/*
ref_trace_decoder/tests/build/win/simple_pkt_print_c_api/x64/Release/*
*.lastbuildstate
*.manifest
*.cache
ref_trace_decoder/docs/html/*
ref_trace_decoder/tests/build/win/simple_pkt_print_c_api/Debug-dll/*
ref_trace_decoder/tests/build/win/simple_pkt_print_c_api/x64/Debug-dll/*
ref_trace_decoder/tests/build/win/trc_pkt_lister/Debug-dll/*
ref_trace_decoder/tests/build/win/trc_pkt_lister/Release-dll/*
ref_trace_decoder/tests/build/win/trc_pkt_lister/x64/Debug-dll/*
ref_trace_decoder/tests/build/win/trc_pkt_lister/x64/Release-dll/*
*.bak
*.orig
decoder/docs/html/*
*.orig
*.VC.db
*.VC.VC.opendb
*.iobj
*.ipdb
decoder/tests/results*

292
README.md
View File

@ -42,4 +42,294 @@ Source Roadmap:
| usr.bin | User commands. |
| usr.sbin | System administration commands. |
For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see [FreeBSD Handbook](https://docs.freebsd.org/en/books/handbook/cutting-edge/#current-stable).
From version 0.4, library versioning will use a semantic versioning format
(per http://semver.org) of the form _Major.minor.patch_ (M.m.p).
Internal library version calls, documentation and git repository will use this format moving forwards.
Where a patch version is not quoted, or quoted as .x then comments will apply to the entire release.
Releases will be at M.m.0, with patch version incremented for bugfixes or documentation updates.
Releases will appear on the master branch in the git repository with an appropriate version tag.
CoreSight Trace Component Support.
----------------------------------
_Current Version 1.4.0_
### Current support:
- ETE (v1.3) instruction trace - packet processing and packet decode.
- ETMv4 (v4.6 [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.
- STM (v1.1) software trace - packet processing and packet decode.
- External Decoders - support for addition of external / custom decoders into the library.
### Support to be added:
- ITM software trace - packet processing and decode.
- ETMv3 data trace - packet decode.
- ETMv4 data trace - packet processing and decode.
Note: for ITM and STM, packet decode is combining Master+Channel+Marker+Payload packets into a single generic
output packet.
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.
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
-------------
API Documentation is provided inline in the source header files, which use the __doxygen__ standard mark-up.
Run `doxygen` on the `./doxygen_config.dox` file located in the `./docs` directory..
doxygen ./doxygen_config.dox
This will produce the documentation in the `./docs/html` directory. The doxygen configuration also includes
the `*.md` files as part of the documentation.
Application Programming using the Library
-----------------------------------------
See the [programmers guide](@ref prog_guide) for details on usage of the library in custom applications.
(`./docs/prog_guide/prog_guide_main.md`).
Building and Installing the Library
-----------------------------------
See [build_libs.md](@ref build_lib) in the `./docs` directory for build details.
The linux build makefile now contains options to install the library for a linux environment.
How the Library is used in Linux `perf`
---------------------------------------
The library and additional infrastructure for programming CoreSight components has been integrated
with the standard linux perfomance analysis tool `perf`.
See [HOWTO.md](@ref howto_perf) for details.
How to use the Library, perf and Trace for AutoFDO
--------------------------------------------------
Capturing trace using perf and decoding using the library can
generate profiles for AutoFDO.
See [autofdo.md](@ref AutoFDO) for details and scripts.
(`./tests/auto-fdo/autofdo.md`).
Version and Modification Information
====================================
- _Version 0.001_: Library development - tested with `perf` tools integration - BKK16, 8th March 2016
- _Version 0.002_: Library development - added in PTM decoder support. Restructure header dir, replaced ARM rctdl prefix with opencsd/ocsd.
- _Version 0.003_: Library development - added in ETMv3 instruction decoder support.
- _Version 0.4_ : Library development - updated decode tree and C-API for generic decoder handling. Switch to semantic versioning.
- _Version 0.4.1_: Minor Update & Bugfixes - fix to PTM decoder, ID checking on test program, adds NULL_TS support in STM packet processor.
- _Version 0.4.2_: Minor Update - Update to documentation for perf usage in 4.8 kernel branch.
- _Version 0.5.0_: Library Development - external decoder support. STM full decode.
- _Version 0.5.1_: Minor Update & Bugfixes - Update HOWTO for kernel 4.9. Build fixes for parallel builds
- _Version 0.5.2_: Minor Update & Bugfixes - Update trace info packet string o/p + Cycle count packet bugfixes.
- _Version 0.5.3_: Doc update for using AutoFDO with ETM and additional timestamp and cycle count options.
- _Version 0.5.4_: Updates: X-compile for arm/arm64. Remove deprecated VS2010 builds. Bugfix: GCC inline semantics in debug build.
- _Version 0.6.0_: Packet printers moved from tests into the main library. C++ and C APIs updated to allow clients to use them.
Update to allow perf to insert barrier packets (4xFSYNC) which the decoder can be made to use to reset the decode state.
- _Version 0.6.1_: Bugfix: instruction follower bug on A32 branch to T32.
- _Version 0.7.0_: Add handling for trace return stack feature to ETMv4 and PTM trace.
- _Version 0.7.1_: Bugfix: ETMv3 packet processor.
- _Version 0.7.2_: Bugfix: ETMv4 decoder - fix exact match packet address follower.
- _Version 0.7.3_: Bugfix: PTM decoder - issues with initialisation and ASYNC detection.
- _Version 0.7.4_: Notification of change of repository for perf extensions. gcc 6.x build fixes.
- _Version 0.7.5_: Bugfix: ETMv4 decoder memory leak. Linux build update - header dependencies force rebuild.
- _Version 0.8.0_: Header restructure and build update to enable linux version to install library and C-API headers in standard locations.
Library output naming changed from 'cstraced' to 'opencsd'.
- _Version 0.8.1_: Minor updates: Use install tool to copy headers. Changes to HOWTO for perf usage.
- _Version 0.8.2_: Bugfix: C++ init errors fixed for CLANG build process.
- _Version 0.8.3_: Bugfix: ETMv4 decoder issues fixed.
- _Version 0.8.4_: build: makefile updates and improvements to get build process compatible with Debian packaging.
- _Version 0.9.0_: Performance improvements for perf: Additional info in instruction range output packet. Caching memory accesses.
Added Programmers guide to documentation.
- _Version 0.9.1_: Bugfix: Crash during decode when first memory access is to address where no image provided.
- _Version 0.9.2_: Bugfix: ETMv4: Incorrect Exception number output for Genric exception packets.
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.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).
- _Version 0.14.3_:
- __Update__: Fix makefile to be compliant with RPM base distros. (github issue #26, submitted by jlinton)
- __Update__: Add section to autofdo document.
- __Bugfix__: STM: fix bug that was missing ASYNC packets. (github issue #27, reported by subhasish Karmakar)
- _Version 0.14.4_:
- __Update__: makefile: Add DESTDIR to install targets. (github issue #30)
- __Update__: tests: add script to run single test only.
- __Update__: docs: update to location of ARM coresight driver backports directory.
- __Bugfix__: ETMv3: Fix missing comma in string list. (github issue #31)
- __Bugfix__: makefile: tests: Fix build race problem (github issue #32)
- __Bugfix__: tests: fix ignore tpiu command line options (github issue #28)
- _Version 1.0.0_:
- __New Decode Protocol__: Support added for the ETE protocol, used by ARM PEs that implement the FEAT_ETE
feature. Supports new architectural features in this trace, including FEAT_TME.
- __Update__: Output Elememts: New protocol defines two new output elements.
- __Update__: Add support for WFIT / WFET instructions traced as P0 elements.
- __Update__: Architecture versioning. Arch v8 + PEs may add features in a flexible manner, and ARM also
declares future features ahead of architecture versions to allow support to be added.
APIs requiring an architecture version can now use ARCH_AA64 to declare a version of v8.3 +
additional features. This relaxes the strict versionnig rules that the decoder uses when
looking for Opcodes as trace waypoints.
- __Update__: docs: Add linux 'man' file and installation.
- __Bugfix__: build: Fix clean install, and remove static lib build test from main makefile to
dev makefile only. (github issue #33)
- _Version 1.1.0_:
- __Update__: ETM v4.6 support.
- __Update__: C-API - add API functions to get last error and convert error code to string.
- __Bugfix__: ETMv4/ETE - fix loop problem in commit elements.
- __Bugfix__: ETMv4/ETE - make error handling consistent.
- __Bugfix__: Add Pull request #36 from github (Ross Burton)
- __Bugfix__: Add Pull request #37 from github (Ian Rogers)
- _Version 1.1.1_:
- __Bugfix__: Fix include and install for ETE decoder headers.
- _Version 1.2.0_:
- __Update__: Add API for counting packet decode statistics, and Frame debmux statistics.
- __Update__: Update test scripts to allow additional command line options to be passed.
- __Bugfix__: Fix various build warnings.
- __Bugfix__: Remove unused variable (github issue #38 from Yi Kong)
- __Bugfix__: Remove noisy printf (James Clark)
- __Bugfix__: Fix documentation issues (github issues #39 & #40 from rbresalier)
- _Version 1.2.1_:
- __Bugfix__: ETM4x / ETE - output of context elements to client can in some circumstances
be delayed until after subsequent atoms have been processed leading to incorrect
memory decode access via the client callbacks.
Fixed to flush context elements immediately they are committed.
- _Version 1.3.0_:
- __Admin__: Dev versions now have patch versions at least +100 from root public version
- __Update__: Add support for conditional branch (BC.cond) introduced for v8.8 / v9.3 architecture.
- __Update__: ETE: Add support for NSE bit - security state bit defining Root / Realm states in FEAT_RME.
- _Version 1.3.1_:
- __Bugfix__: Add header file in snapshot parser - fix build for certain libc++ libs (github issue #43 from manojgupta)
- __Bugfix__: Fix typo in comment (github issue #42 from nothatDinger)
- _Version 1.3.2_:
- __Bugfix__: ETM4x / ETE - 64 bit timestamp value - MS bit incorrectly masked to 1b0 during extraction from packet.
- _Version 1.3.3_:
- __Update__: Add build directory for VS2022 build.
- __Update__: Add test program for Coresight Frame Demux code
- __Bugfix__: PTM: Fix incorrect extraction of Waypoint Address packet (github issue #48)
- __Bugfix__: Frame Demux: Fix HSYNC, FSYNC and 4xFSYNC handling that was causing out-of-bounds reads
on invalid data input. (issues #49, #50 and #51). Fixed error handling for incorrect
number of FSYNC packets in 4xFSYNC frame reset code that was not triggering an error
and allowing fun with mis-aligned input data.
- __Bugfix__: Fix silent failure if incorrect config flags set when setting up frame demux modes.
- _Version 1.4.0_:
- __Update__: ETE: Add support for Arch v9.4 FEAT_ITE. ETE v1p3, sw trace instrumentation.
Adds in new generic output packet type: OCSD_GEN_TRC_ELEM_INSTRUMENTATION.
- __Bugfix__: Fix memory leak in mispredict handling (github issue #52 from yabinc)
Licence Information
===================
This library is licensed under the [BSD three clause licence.](http://directory.fsf.org/wiki/License:BSD_3Clause)
A copy of this license is in the `LICENCE` file included with the source code.
Contact
=======
Using the github site: https://github.com/Linaro/OpenCSD
Mailing list: coresight@lists.linaro.org

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "BearSSL"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 1.4.0
# 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
@ -771,7 +771,23 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = inc/bearssl.h inc/bearssl_aead.h inc/bearssl_block.h inc/bearssl_ec.h inc/bearssl_hash.h inc/bearssl_hmac.h inc/bearssl_kdf.h inc/bearssl_pem.h inc/bearssl_prf.h inc/bearssl_rand.h inc/bearssl_rsa.h inc/bearssl_ssl.h inc/bearssl_x509.h
INPUT = ../include \
../include/interfaces \
../include/opencsd/etmv3 \
../include/opencsd/etmv4 \
../include/opencsd/ptm \
../include/opencsd/c_api \
../include/opencsd/stm \
../include/mem_acc \
../../README.md \
. \
../../HOWTO.md \
../include/common \
./prog_guide \
../include/opencsd \
../include \
../tests/auto-fdo/autofdo.md \
../include/opencsd/ete
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

View File

@ -80,16 +80,16 @@ public:
private:
ocsd_trace_protocol_t m_builtInProtocol; //!< Protocol ID if built in type.
const ocsd_trace_protocol_t m_builtInProtocol; //!< Protocol ID if built in type.
};
template <class P, class Pt, class Pc>
DecoderMngrBase<P,Pt,Pc>::DecoderMngrBase(const std::string &decoderTypeName, ocsd_trace_protocol_t builtInProtocol)
DecoderMngrBase<P,Pt,Pc>::DecoderMngrBase(const std::string &decoderTypeName, ocsd_trace_protocol_t builtInProtocol) :
m_builtInProtocol(builtInProtocol)
{
OcsdLibDcdRegister *pDcdReg = OcsdLibDcdRegister::getDecoderRegister();
if(pDcdReg)
pDcdReg->registerDecoderTypeByName(decoderTypeName,this);
m_builtInProtocol = builtInProtocol;
}
template <class P, class Pt, class Pc>
@ -362,6 +362,49 @@ public:
}
};
/* full decode - extended config object - base + derived. */
template< class P, // Packet class.
class Pt, // Packet enum type ID.
class Pc, // Processor config base class.
class PcEx, // Processor config derived class
class PcSt, // Processor config struct type
class PktProc, // Packet processor class.
class PktDcd> // Packet decoder class.
class DecodeMngrFullDcdExCfg : public DecoderMngrBase<P, Pt, Pc>
{
public:
DecodeMngrFullDcdExCfg(const std::string &name, ocsd_trace_protocol_t builtInProtocol)
: DecoderMngrBase<P, Pt, Pc>(name, builtInProtocol) {};
virtual ~DecodeMngrFullDcdExCfg() {};
virtual TraceComponent *createPktProc(const bool useInstID, const int instID)
{
TraceComponent *pComp;
if (useInstID)
pComp = new (std::nothrow) PktProc(instID);
else
pComp = new (std::nothrow) PktProc();
return pComp;
}
virtual TraceComponent *createPktDecode(const bool useInstID, const int instID)
{
TraceComponent *pComp;
if (useInstID)
pComp = new (std::nothrow)PktDcd(instID);
else
pComp = new (std::nothrow)PktDcd();
return pComp;
}
virtual CSConfig *createConfig(const void *pDataStruct)
{
return new (std::nothrow) PcEx((PcSt *)pDataStruct);
}
};
/****************************************************************************************************/
/* Packet processor only, templated base for creating decoder objects */
/****************************************************************************************************/

View File

@ -168,6 +168,30 @@ public:
*/
ocsd_err_t removeDecoder(const uint8_t CSID);
/*!
* Get the stats block for the channel indicated.
* Caller must check p_stats_block->version to esure that the block
* is filled in a compatible manner.
*
* @param CSID : Configured CoreSight trace ID for the decoder.
* @param p_stats_block: block pointer to set to reference the stats block.
*
* @return ocsd_err_t : Library error code - OCSD_OK if valid block pointer returned,
* OCSD_ERR_NOTINIT if decoder does not support stats counting.
*/
ocsd_err_t getDecoderStats(const uint8_t CSID, ocsd_decode_stats_t **p_stats_block);
/*!
* Reset the stats block for the chosens decode channel.
* stats block is reset independently of the decoder reset to allow counts across
* multiple decode runs.
*
* @param handle : Handle to decode tree.
* @param CSID : Configured CoreSight trace ID for the decoder.
*
* @return ocsd_err_t : Library error code - OCSD_OK if successful.
*/
ocsd_err_t resetDecoderStats(const uint8_t CSID);
/* get decoder elements currently in use */
@ -387,7 +411,7 @@ private:
void destroyMemAccMapper();
ocsd_err_t initCallbackMemAcc(const ocsd_vaddr_t st_address, const ocsd_vaddr_t en_address,
const ocsd_mem_space_acc_t mem_space, void *p_cb_func, bool IDfn, const void *p_context);
TrcPktProcI *getPktProcI(const uint8_t CSID);
ocsd_dcd_tree_src_t m_dcd_tree_type;
@ -417,6 +441,9 @@ private:
/**! default instruction decoder */
static TrcIDecode s_instruction_decoder;
/**! demux stats block */
ocsd_demux_stats_t m_demux_stats;
};
/** @}*/

View File

@ -108,6 +108,17 @@ inline ocsdError& ocsdError::operator=(const ocsdError &err)
return (*this = &err);
}
/* class to get data path response values as strings */
class ocsdDataRespStr
{
public:
ocsdDataRespStr(ocsd_datapath_resp_t type) { m_type = type; }
~ocsdDataRespStr() {};
const char* getStr();
private:
ocsd_datapath_resp_t m_type;
};
/** @}*/

View File

@ -53,7 +53,8 @@
*
* Valid architecture profile names are:-
* - ARMv7-A, ARMv7-R, ARMv7-M;
* - ARMv8-A, ARMv8.3A, ARMv8-R, ARMv8-M;
* - ARMv8-A, ARMv8.x-A, ARMv8-R, ARMv8-M;
* - ARM-AA64, ARM-aa64
*
*/
class CoreArchProfileMap
@ -65,36 +66,12 @@ public:
ocsd_arch_profile_t getArchProfile(const std::string &coreName);
private:
ocsd_arch_profile_t getPatternMatchCoreName(const std::string &coreName);
std::map<std::string, ocsd_arch_profile_t> core_profiles;
std::map<std::string, ocsd_arch_profile_t> arch_profiles;
};
inline ocsd_arch_profile_t CoreArchProfileMap::getArchProfile(const std::string &coreName)
{
ocsd_arch_profile_t ap = { ARCH_UNKNOWN, profile_Unknown };
bool bFound = false;
std::map<std::string, ocsd_arch_profile_t>::const_iterator it;
/* match against the core name map. */
it = core_profiles.find(coreName);
if (it != core_profiles.end())
{
ap = it->second;
bFound = true;
}
/* scan architecture profiles on no core name match */
if (!bFound)
{
it = arch_profiles.find(coreName);
if (it != arch_profiles.end())
ap = it->second;
}
return ap;
}
#endif // ARM_TRC_CORE_ARCH_MAP_H_INCLUDED
/* End of File trc_core_arch_map.h */

View File

@ -73,6 +73,9 @@ public:
componentAttachPt<ITraceErrorLog> *getErrLogAttachPt();
/* init decoder implementation object */
ocsd_err_t Init();
/* configuration - set operational mode for incoming stream (has FSYNCS etc) */
ocsd_err_t Configure(uint32_t cfg_flags);
const uint32_t getConfigFlags() const;
@ -85,9 +88,13 @@ public:
ocsd_datapath_resp_t Reset(); /* reset the decode to the start state, drop partial data - propogate to attached components */
ocsd_datapath_resp_t Flush(); /* flush existing data if possible, retain state - propogate to attached components */
/* demux stats */
void SetDemuxStatsBlock(ocsd_demux_stats_t *pStatsBlock);
private:
TraceFmtDcdImpl *m_pDecoder;
int m_instNum;
};
/** @}*/

View File

@ -69,19 +69,22 @@ public:
void setExcepMarker() { excep_data_marker = 1; };
void setExceptionNum(uint32_t excepNum) { exception_number = excepNum; };
void setTraceOnReason(const trace_on_reason_t reason);
void setUnSyncEOTReason(const unsync_info_t reason);
void setTransactionType(const trace_memtrans_t trans) { mem_trans = trans; };
void setAddrRange(const ocsd_vaddr_t st_addr, const ocsd_vaddr_t en_addr, const int num_instr = 1);
void setLastInstrInfo(const bool exec, const ocsd_instr_type last_i_type, const ocsd_instr_subtype last_i_subtype, const uint8_t size);
void setAddrStart(const ocsd_vaddr_t st_addr) { this->st_addr = st_addr; };
void setAddrStart(const ocsd_vaddr_t st_addr) { this->st_addr = st_addr; };
void setLastInstrCond(const int is_cond) { this->last_instr_cond = is_cond; };
void setSWTInfo(const ocsd_swt_info_t swt_info) { sw_trace_info = swt_info; };
void setExtendedDataPtr(const void *data_ptr);
void setITEInfo(const trace_sw_ite_t sw_instrumentation) { sw_ite = sw_instrumentation; };
void setSyncMarker(const trace_marker_payload_t &marker);
// stringize the element
virtual void toString(std::string &str) const;
@ -208,6 +211,11 @@ inline void OcsdTraceElement::setExtendedDataPtr(const void *data_ptr)
ptr_extended_data = data_ptr;
}
inline void OcsdTraceElement::setSyncMarker(const trace_marker_payload_t &marker)
{
sync_marker = marker;
}
// set persistent data between output packets.
inline void OcsdTraceElement::copyPersistentData(const OcsdTraceElement &src)
{

View File

@ -96,6 +96,7 @@ protected:
/* target access */
ocsd_err_t accessMemory(const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, uint32_t *num_bytes, uint8_t *p_buffer);
ocsd_err_t invalidateMemAccCache();
/* instruction decode */
ocsd_err_t instrDecode(ocsd_instr_info *instr_info);
@ -180,6 +181,14 @@ inline ocsd_err_t TrcPktDecodeI::accessMemory(const ocsd_vaddr_t address, const
return OCSD_ERR_DCD_INTERFACE_UNUSED;
}
inline ocsd_err_t TrcPktDecodeI::invalidateMemAccCache()
{
if (!m_uses_memaccess)
return OCSD_ERR_DCD_INTERFACE_UNUSED;
m_mem_access.first()->InvalidateMemAccCache(getCoreSightTraceID());
return OCSD_OK;
}
/**********************************************************************/
template <class P, class Pc>
class TrcPktDecodeBase : public TrcPktDecodeI, public IPktDataIn<P>

View File

@ -43,6 +43,7 @@
#include "trc_component.h"
#include "comp_attach_pt_t.h"
#include "opencsd/ocsd_if_version.h"
/** @defgroup ocsd_pkt_proc OpenCSD Library : Packet Processors.
@brief Classes providing Protocol Packet Processing capability.
@ -76,6 +77,8 @@ public:
const uint8_t *pDataBlock,
uint32_t *numBytesProcessed) = 0;
virtual ocsd_err_t getStatsBlock(ocsd_decode_stats_t **pp_stats) = 0;
virtual void resetStats() = 0;
protected:
/* implementation packet processing interface */
@ -155,6 +158,10 @@ public:
//!< Get the configuration for the decoder.
virtual const Pc *getProtocolConfig() const { return m_config; };
/* stats block access - derived class must init stats for the block to be returned. */
virtual ocsd_err_t getStatsBlock(ocsd_decode_stats_t **pp_stats);
virtual void resetStats(); /* reset the counts - operates separately from decoder reset. */
protected:
/* data output functions */
@ -183,6 +190,14 @@ protected:
const bool checkInit(); // return true if init (configured and at least one output sink attached), false otherwise.
/* stats block updates - called by derived protocol specific decoder */
void statsAddTotalCount(const uint64_t count) { m_stats.channel_total += count; };
void statsAddUnsyncCount(const uint64_t count) { m_stats.channel_unsynced += count; };
void statsAddBadSeqCount(const uint32_t count) { m_stats.bad_sequence_errs += count; };
void statsAddBadHdrCount(const uint32_t count) { m_stats.bad_header_errs += count; };
void statsInit() { m_stats_init = true; }; /* mark stats as in use */
private:
/* decode control */
ocsd_datapath_resp_t Reset(const ocsd_trc_index_t index);
@ -195,20 +210,29 @@ private:
componentAttachPt<ITrcPktIndexer<Pt>> m_pkt_indexer_i;
bool m_b_is_init;
/* decode statistics block */
ocsd_decode_stats_t m_stats;
bool m_stats_init; /*< true if the specific decoder is using the stats */
};
template<class P,class Pt, class Pc> TrcPktProcBase<P, Pt, Pc>::TrcPktProcBase(const char *component_name) :
TrcPktProcI(component_name),
m_config(0),
m_b_is_init(false)
m_b_is_init(false),
m_stats_init(false)
{
resetStats();
}
template<class P,class Pt, class Pc> TrcPktProcBase<P, Pt, Pc>::TrcPktProcBase(const char *component_name, int instIDNum) :
TrcPktProcI(component_name, instIDNum),
m_config(0),
m_b_is_init(false)
m_b_is_init(false),
m_stats_init(false)
{
resetStats();
}
template<class P,class Pt, class Pc> TrcPktProcBase<P, Pt, Pc>::~TrcPktProcBase()
@ -405,6 +429,26 @@ template<class P,class Pt, class Pc> const bool TrcPktProcBase<P, Pt, Pc>::check
return m_b_is_init;
}
template<class P,class Pt, class Pc> ocsd_err_t TrcPktProcBase<P, Pt, Pc>::getStatsBlock(ocsd_decode_stats_t **pp_stats)
{
*pp_stats = &m_stats;
return m_stats_init ? OCSD_OK : OCSD_ERR_NOT_INIT;
}
template<class P,class Pt, class Pc> void TrcPktProcBase<P, Pt, Pc>::resetStats()
{
m_stats.version = OCSD_VER_NUM;
m_stats.revision = OCSD_STATS_REVISION;
m_stats.channel_total = 0;
m_stats.channel_unsynced = 0;
m_stats.bad_header_errs = 0;
m_stats.bad_sequence_errs = 0;
m_stats.demux.frame_bytes = 0;
m_stats.demux.no_id_bytes = 0;
m_stats.demux.valid_id_bytes = 0;
}
/** @}*/
#endif // ARM_TRC_PKT_PROC_BASE_H_INCLUDED

View File

@ -44,7 +44,7 @@
/* supplementary decode information */
struct decode_info {
uint16_t arch_version;
ocsd_arch_version_t arch_version;
ocsd_instr_subtype instr_sub_type;
};
@ -121,7 +121,8 @@ arm_barrier_t inst_A64_barrier(uint32_t inst);
int inst_ARM_wfiwfe(uint32_t inst);
int inst_Thumb_wfiwfe(uint32_t inst);
int inst_A64_wfiwfe(uint32_t inst);
int inst_A64_wfiwfe(uint32_t inst, struct decode_info *info);
int inst_A64_Tstart(uint32_t inst);
/*
Test whether an instruction is definitely undefined, e.g. because

View File

@ -47,7 +47,7 @@
*
* This interface provides a monitor point for the packet processor block.
* The templated interface is called with a complete packet of the given
* type, plus the raw packet bytes. Use for tools which need to display compplete
* type, plus the raw packet bytes. Use for tools which need to display complete
* packets or require additional processing on raw packet data.
*
* This interface is not part of the data decode path and cannot provide feedback.

View File

@ -83,6 +83,14 @@ public:
const ocsd_mem_space_acc_t mem_space,
uint32_t *num_bytes,
uint8_t *p_buffer) = 0;
/*!
* Invalidate any caching that the memory accessor functions are using.
* Generally called when a memory context changes in the trace.
*
* @param cs_trace_id : protocol source trace ID.
*/
virtual void InvalidateMemAccCache(const uint8_t cs_trace_id) = 0;
};

View File

@ -61,6 +61,8 @@ public:
uint32_t *num_bytes,
uint8_t *p_buffer);
virtual void InvalidateMemAccCache(const uint8_t cs_trace_id);
// mapper memory area configuration interface
// add an accessor to this map

View File

@ -63,6 +63,7 @@
#include "opencsd/etmv4/etmv4_decoder.h"
#include "opencsd/ptm/ptm_decoder.h"
#include "opencsd/stm/stm_decoder.h"
#include "opencsd/ete/ete_decoder.h"
/** C++ library object types */
#include "common/ocsd_error_logger.h"

View File

@ -46,6 +46,7 @@
#include "opencsd/etmv4/trc_pkt_types_etmv4.h"
#include "opencsd/ptm/trc_pkt_types_ptm.h"
#include "opencsd/stm/trc_pkt_types_stm.h"
#include "opencsd/ete/trc_pkt_types_ete.h"
/** @ingroup lib_c_api
@{*/

View File

@ -210,10 +210,36 @@ OCSD_C_API ocsd_err_t ocsd_dt_attach_packet_callback( const dcd_tree_handle_t h
const void *p_context);
/*!
* Get the stats block for the channel indicated.
* Caller must check p_stats_block->version to esure that the block
* is filled in a compatible manner.
*
* @param handle : Handle to decode tree.
* @param CSID : Configured CoreSight trace ID for the decoder.
* @param p_stats_block: block pointer to set to reference the stats block.
*
* @return ocsd_err_t : Library error code - OCSD_OK if valid block pointer returned,
* OCSD_ERR_NOTINIT if decoder does not support stats counting.
*/
OCSD_C_API ocsd_err_t ocsd_dt_get_decode_stats( const dcd_tree_handle_t handle,
const unsigned char CSID,
ocsd_decode_stats_t **p_stats_block);
/*!
* Reset the stats block for the chosens decode channel.
* stats block is reset independently of the decoder reset to allow counts across
* multiple decode runs.
*
* @param handle : Handle to decode tree.
* @param CSID : Configured CoreSight trace ID for the decoder.
*
* @return ocsd_err_t : Library error code - OCSD_OK if successful.
*/
OCSD_C_API ocsd_err_t ocsd_dt_reset_decode_stats( const dcd_tree_handle_t handle,
const unsigned char CSID);
/** @}*/
/*---------------------- Memory Access for traced opcodes ----------------------------------------------------------------------------------*/
/** @name Library Memory Accessor configuration on decode tree.
@ -373,6 +399,28 @@ OCSD_C_API ocsd_err_t ocsd_def_errlog_set_strprint_cb(const dcd_tree_handle_t ha
*/
OCSD_C_API void ocsd_def_errlog_msgout(const char *msg);
/*!
* Convert an error code into a string.
*
* @param err : error code.
* @param buffer : buffer for return string
* @param buffer_size : length of buffer.
*/
OCSD_C_API void ocsd_err_str(const ocsd_err_t err, char *buffer, const int buffer_size);
/*!
* returns the last error logged by the system, with the related trace byte index, trace channel id,
* and any error message related string.
* If index or channel ID are not valid these will return OCSD_BAD_TRC_INDEX and OCSD_BAD_CS_SRC_ID.
*
* return value is the error code of the last logged error, OCSD_OK for no error available.
*
* @param index : returns trace byte index relating to error, or OCSD_BAD_TRC_INDEX
* @param chan_id : returns trace channel ID relating to error, or OCSD_BAD_CS_SRC_ID
* @param message : buffer to copy the last error message.
* @param message_len: length of message buffer.
*/
OCSD_C_API ocsd_err_t ocsd_get_last_err(ocsd_trc_index_t *index, uint8_t *chan_id, char *message, const int message_len);
/** @}*/

View File

@ -81,6 +81,7 @@ public:
const bool hasCycleCountI() const;
const bool hasRetStack() const;
const uint8_t numEvents() const;
const bool eteHasTSMarker() const;
typedef enum _condType {
COND_PASS_FAIL,
@ -104,6 +105,7 @@ public:
const uint32_t TimeStampSize() const;
const bool commitOpt1() const;
const bool commTransP0() const;
/* idr 1 */
const uint8_t MajVersion() const;
@ -151,6 +153,7 @@ public:
const bool enabledCCI() const;
const bool enabledCID() const;
const bool enabledVMID() const;
const bool enabledVMIDOpt() const;
typedef enum {
COND_TR_DIS,
@ -253,6 +256,11 @@ inline const bool EtmV4Config::hasTrcExcpData() const
return (bool)((m_cfg.reg_idr0 & 0x20000) == 0x20000);
}
inline const bool EtmV4Config::eteHasTSMarker() const
{
return (FullVersion() >= 0x51) && ((m_cfg.reg_idr0 & 0x800000) == 0x800000);
}
inline const uint32_t EtmV4Config::TimeStampSize() const
{
uint32_t tsSizeF = (m_cfg.reg_idr0 >> 24) & 0x1F;
@ -268,6 +276,11 @@ inline const bool EtmV4Config::commitOpt1() const
return (bool)((m_cfg.reg_idr0 & 0x20000000) == 0x20000000) && hasCycleCountI();
}
inline const bool EtmV4Config::commTransP0() const
{
return (bool)((m_cfg.reg_idr0 & 0x40000000) == 0x0);
}
/* idr 1 */
inline const uint8_t EtmV4Config::MajVersion() const
{
@ -424,6 +437,20 @@ inline const bool EtmV4Config::enabledVMID() const
return ((m_cfg.reg_configr & (0x1 << 7)) != 0);
}
inline const bool EtmV4Config::enabledVMIDOpt() const
{
bool vmidOptVal = ((m_cfg.reg_configr & (0x1 << 15)) != 0);
/* TRIDR2.VMIDOPT[30:29] determine value used */
if (!vmidOpt()) { /* [29] = 1'b0 */
vmidOptVal = false; /* res0 */
if (FullVersion() >= 0x45) {
/* umless version > 4.5 in which case [30] determines res val */
vmidOptVal = ((m_cfg.reg_idr2 & (0x1 << 30)) != 0);
}
}
return vmidOptVal;
}
inline const EtmV4Config::CondITrace_t EtmV4Config::enabledCondITrace()
{
if(!m_condTraceCalc)

View File

@ -34,6 +34,7 @@
#define ARM_TRC_ETMV4_STACK_ELEM_H_INCLUDED
#include "opencsd/etmv4/trc_pkt_types_etmv4.h"
#include "opencsd/trc_gen_elem_types.h"
#include <deque>
#include <vector>
@ -56,9 +57,16 @@ typedef enum _p0_elem_t
P0_TS,
P0_CC,
P0_TS_CC,
P0_MARKER,
P0_Q,
P0_OVERFLOW,
P0_FUNC_RET,
P0_SRC_ADDR,
P0_TRANS_TRACE_INIT,
P0_TRANS_START,
P0_TRANS_COMMIT,
P0_TRANS_FAIL,
P0_ITE,
} p0_elem_t;
@ -101,6 +109,7 @@ class TrcStackElemAddr : public TrcStackElem
{
protected:
TrcStackElemAddr(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index);
TrcStackElemAddr(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const bool src_addr);
virtual ~TrcStackElemAddr() {};
friend class EtmV4P0Stack;
@ -120,6 +129,14 @@ inline TrcStackElemAddr::TrcStackElemAddr(const ocsd_etmv4_i_pkt_type root_pkt,
m_addr_val.isa = 0;
}
inline TrcStackElemAddr::TrcStackElemAddr(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const bool src_addr) :
TrcStackElem(src_addr ? P0_SRC_ADDR : P0_ADDR, false, root_pkt, root_index)
{
m_addr_val.val = 0;
m_addr_val.isa = 0;
}
/************************************************************/
/** Q element */
class TrcStackQElem : public TrcStackElem
@ -294,6 +311,55 @@ inline TrcStackElemParam::TrcStackElemParam(const p0_elem_t p0_type, const bool
{
}
/************************************************************/
/** Marker element */
class TrcStackElemMarker : public TrcStackElem
{
protected:
TrcStackElemMarker(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index);
virtual ~TrcStackElemMarker() {};
friend class EtmV4P0Stack;
public:
void setMarker(const trace_marker_payload_t &marker) { m_marker = marker; };
const trace_marker_payload_t &getMarker() const { return m_marker; };
private:
trace_marker_payload_t m_marker;
};
inline TrcStackElemMarker::TrcStackElemMarker(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index) :
TrcStackElem(P0_MARKER, false, root_pkt, root_index)
{
}
/************************************************************/
/* Instrumentation element
*/
class TrcStackElemITE : public TrcStackElem
{
protected:
TrcStackElemITE(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index);
virtual ~TrcStackElemITE() {};
friend class EtmV4P0Stack;
public:
void setITE(const trace_sw_ite_t &ite) { m_ite = ite; };
const trace_sw_ite_t &getITE() { return m_ite; };
private:
trace_sw_ite_t m_ite;
};
inline TrcStackElemITE::TrcStackElemITE(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index) :
TrcStackElem(P0_ITE, false, root_pkt, root_index)
{
}
/************************************************************/
/* P0 element stack that allows push of elements, and deletion of elements when done.
*/
@ -329,6 +395,10 @@ public:
TrcStackElemCtxt *createContextElem(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const etmv4_context_t &context, const uint8_t IS, const bool back = false);
TrcStackElemAddr *createAddrElem(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const etmv4_addr_val_t &addr_val);
TrcStackQElem *createQElem(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const int count);
TrcStackElemMarker *createMarkerElem(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const trace_marker_payload_t &marker);
TrcStackElemAddr *createSrcAddrElem(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const etmv4_addr_val_t &addr_val);
TrcStackElemITE *createITEElem(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const trace_sw_ite_t &ite);
private:
std::deque<TrcStackElem *> m_P0_stack; //!< P0 decode element stack
std::vector<TrcStackElem *> m_popped_elem; //!< save list of popped but not deleted elements.

View File

@ -88,11 +88,29 @@ protected:
// process Q element
ocsd_err_t processQElement();
// process a source address element
ocsd_err_t processSourceAddress();
// process an element that cannot be cancelled / discarded
ocsd_err_t processTS_CC_EventElem(TrcStackElem *pElem);
// process marker elements
ocsd_err_t processMarkerElem(TrcStackElem *pElem);
// process a transaction element
ocsd_err_t processTransElem(TrcStackElem *pElem);
// process an Instrumentation element
ocsd_err_t processITEElem(TrcStackElem *pElem);
// process a bad packet
ocsd_err_t handleBadPacket(const char *reason);
ocsd_err_t handleBadPacket(const char *reason, ocsd_trc_index_t index = OCSD_BAD_TRC_INDEX);
// sequencing error on packet processing - optionally continue
ocsd_err_t handlePacketSeqErr(ocsd_err_t err, ocsd_trc_index_t index, const char *reason);
// common packet error routine
ocsd_err_t handlePacketErr(ocsd_err_t err, ocsd_err_severity_t sev, ocsd_trc_index_t index, const char *reason);
ocsd_err_t addElemCC(TrcStackElemParam *pParamElem);
ocsd_err_t addElemTS(TrcStackElemParam *pParamElem, bool withCC);
@ -127,6 +145,13 @@ private:
ocsd_err_t returnStackPop(); // pop return stack and update instruction address.
void setElemTraceRange(OcsdTraceElement &elemIn, const instr_range_t &addr_range, const bool executed, ocsd_trc_index_t index);
void setElemTraceRangeInstr(OcsdTraceElement &elemIn, const instr_range_t &addr_range,
const bool executed, ocsd_trc_index_t index, ocsd_instr_info &instr);
// true if we are ETE configured.
inline bool isETEConfig() {
return (m_config->MajVersion() >= ETE_ARCH_VERSION);
}
ocsd_mem_space_acc_t getCurrMemSpace();
@ -134,6 +159,7 @@ private:
// timestamping
uint64_t m_timestamp; // last broadcast global Timestamp.
bool m_ete_first_ts_marker;
// state and context
uint32_t m_context_id; // most recent context ID

View File

@ -145,7 +145,7 @@ public:
void setCondRF3(const uint16_t tokens);
void setCondRF4(const uint8_t token);
void setContextInfo(const bool update, const uint8_t EL = 0, const uint8_t NS = 0, const uint8_t SF = 0);
void setContextInfo(const bool update, const uint8_t EL = 0, const uint8_t NS = 0, const uint8_t SF = 0, const uint8_t NSE = 0);
void setContextVMID(const uint32_t VMID);
void setContextCID(const uint32_t CID);
@ -160,6 +160,7 @@ public:
void setEvent(const uint8_t event_val);
void setQType(const bool has_count, const uint32_t count, const bool has_addr, const bool addr_match, const uint8_t type);
void setITE(const uint8_t el, const uint64_t value);
// packet status interface - get packet info.
const ocsd_etmv4_i_pkt_type getType() const { return type; };
@ -200,6 +201,10 @@ public:
const int getCommitElem() const { return commit_elements; };
const int getCancelElem() const { return cancel_elements; };
// ITE
const uint8_t getITE_EL() const { return ite_pkt.el; };
const uint64_t getITE_value() const { return ite_pkt.value; };
// packet type
const bool isBadPacket() const;
@ -207,6 +212,8 @@ public:
virtual void toString(std::string &str) const;
virtual void toStringFmt(const uint32_t fmtFlags, std::string &str) const;
void setProtocolVersion(const uint8_t version) { protocol_version = version; };
private:
const char *packetTypeName(const ocsd_etmv4_i_pkt_type type, const char **pDesc) const;
void contextStr(std::string &ctxtStr) const;
@ -217,6 +224,8 @@ private:
void push_vaddr();
void pop_vaddr_idx(const uint8_t idx);
const bool isETE() const { return (protocol_version & 0xF0) == 0x50; };
Etmv4PktAddrStack m_addr_stack;
};
@ -412,7 +421,7 @@ inline void EtmV4ITrcPacket::setCondRF4(const uint8_t token)
cond_result.f2f4_token = token;
}
inline void EtmV4ITrcPacket::setContextInfo(const bool update, const uint8_t EL, const uint8_t NS, const uint8_t SF)
inline void EtmV4ITrcPacket::setContextInfo(const bool update, const uint8_t EL, const uint8_t NS, const uint8_t SF, const uint8_t NSE)
{
pkt_valid.bits.context_valid = 1;
if(update)
@ -421,6 +430,7 @@ inline void EtmV4ITrcPacket::setContextInfo(const bool update, const uint8_t EL,
context.EL = EL;
context.NS = NS;
context.SF = SF;
context.NSE = NSE;
}
}
@ -534,6 +544,12 @@ inline void EtmV4ITrcPacket::pop_vaddr_idx(const uint8_t idx)
m_addr_stack.get_idx(idx, v_addr, v_addr_ISA);
}
inline void EtmV4ITrcPacket::setITE(const uint8_t el, const uint64_t value)
{
ite_pkt.el = el;
ite_pkt.value = value;
}
/** @}*/
#endif // ARM_TRC_PKT_ELEM_ETMV4I_H_INCLUDED

View File

@ -117,6 +117,7 @@ private:
#define TINFO_KEY_SECT 0x02
#define TINFO_SPEC_SECT 0x04
#define TINFO_CYCT_SECT 0x08
#define TINFO_WNDW_SECT 0x10
#define TINFO_CTRL 0x20
#define TINFO_ALL_SECT 0x1F
#define TINFO_ALL 0x3F
@ -178,9 +179,10 @@ private:
void iPktQ(const uint8_t lastByte);
void iAtom(const uint8_t lastByte);
void iPktInvalidCfg(const uint8_t lastByte); // packet invalid in current config.
void iPktITE(const uint8_t lastByte);
unsigned extractContField(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint32_t &value, const unsigned byte_limit = 5);
unsigned extractContField64(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint64_t &value, const unsigned byte_limit = 9);
unsigned extractTSField64(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint64_t &value);
unsigned extractCondResult(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint32_t& key, uint8_t &result);
void extractAndSetContextInfo(const std::vector<uint8_t> &buffer, const int st_idx);
int extract64BitLongAddr(const std::vector<uint8_t> &buffer, const int st_idx, const uint8_t IS, uint64_t &value);

View File

@ -1,8 +1,8 @@
/*
* \file trc_pkt_types_etmv4.h
* \brief OpenCSD : ETMv4 packet info
* \brief OpenCSD : ETMv4 / ETE packet info
*
* \copyright Copyright (c) 2015,2019 ARM Limited. All Rights Reserved.
* \copyright Copyright (c) 2015,2019,2022 ARM Limited. All Rights Reserved.
*/
@ -41,7 +41,7 @@
/** @addtogroup trc_pkts
@{*/
/** @name ETMv4 Packet Types
/** @name ETMv4 Packet Types, ETE packet Types
@{*/
/** I stream packets. */
@ -70,9 +70,12 @@ typedef enum _ocsd_etmv4_i_pkt_type
ETM4_PKT_I_FUNC_RET = 0x05, /*!< b00000101 (V8M only) */
// Exceptions
ETM4_PKT_I_EXCEPT = 0x06, /*!< b00000110 */
ETM4_PKT_I_EXCEPT_RTN = 0x07, /*!< b00000111 */
ETM4_PKT_I_EXCEPT_RTN = 0x07, /*!< b00000111 (ETE invalid) */
/* unused encodings 0x08-0xB b00001000 to b00001011 */
/* unused encoding 0x08 b00001000 */
ETE_PKT_I_ITE = 0x09, /*! b00001001 (ETE only) */
ETE_PKT_I_TRANS_ST = 0x0A, /*! b00001010 (ETE only) */
ETE_PKT_I_TRANS_COMMIT = 0x0B, /*! b00001011 (ETE only) */
/* cycle count packets */
ETM4_PKT_I_CCNT_F2 = 0x0C, /*!< b0000110x */
@ -91,7 +94,7 @@ typedef enum _ocsd_etmv4_i_pkt_type
ETM4_PKT_I_CANCEL_F2 = 0x34, /*!< b001101xx */
ETM4_PKT_I_CANCEL_F3 = 0x38, /*!< b00111xxx */
/* conditional instruction tracing */
/* conditional instruction tracing - (reserved encodings ETE) */
ETM4_PKT_I_COND_I_F2 = 0x40, /*!< b01000000 - b01000010 */
ETM4_PKT_I_COND_FLUSH = 0x43, /*!< b01000011 */
ETM4_PKT_I_COND_RES_F4 = 0x44, /*!< b0100010x, b01000110 */
@ -116,7 +119,8 @@ typedef enum _ocsd_etmv4_i_pkt_type
ETM4_PKT_I_ADDR_CTXT_L_64IS0 = 0x85, /*!< b10000101 */
ETM4_PKT_I_ADDR_CTXT_L_64IS1, /*!< b10000110 */
/* unused encoding 0x87 b10000111 */
/* unused encodings 0x88-0x8F b10001xxx */
ETE_PKT_I_TS_MARKER = 0x88, /*!< b10001000 */
/* unused encodings 0x89-0x8F b10001001 to b10001111 */
ETM4_PKT_I_ADDR_MATCH = 0x90, /*!< b10010000 to b10010010 0x92 */
/* unused encodings 0x93-0x94 b10010011 to b10010010 */
ETM4_PKT_I_ADDR_S_IS0 = 0x95, /*!< b10010101 */
@ -132,7 +136,15 @@ typedef enum _ocsd_etmv4_i_pkt_type
/* Q packets */
ETM4_PKT_I_Q = 0xA0, /*!< b1010xxxx */
/* unused encodings 0xB0-0xBF b1011xxxx */
/* ETE source address packets, unused ETMv4 */
ETE_PKT_I_SRC_ADDR_MATCH = 0xB0, /*!< b101100xx */
ETE_PKT_I_SRC_ADDR_S_IS0 = 0xB4, /*!< b10110100 */
ETE_PKT_I_SRC_ADDR_S_IS1 = 0xB5, /*!< b10110101 */
ETE_PKT_I_SRC_ADDR_L_32IS0 = 0xB6, /*!< b10110110 */
ETE_PKT_I_SRC_ADDR_L_32IS1 = 0xB7, /*!< b10110111 */
ETE_PKT_I_SRC_ADDR_L_64IS0 = 0xB8, /*!< b10111000 */
ETE_PKT_I_SRC_ADDR_L_64IS1 = 0xB9, /*!< b10111001 */
/* unused encodings 0xBA-0xBF b10111010 - b10111111 */
/* Atom packets */
ETM4_PKT_I_ATOM_F6 = 0xC0, /*!< b11000000 - b11010100 0xC0 - 0xD4, b11100000 - b11110100 0xE0 - 0xF4 */
@ -147,15 +159,20 @@ typedef enum _ocsd_etmv4_i_pkt_type
ETM4_PKT_I_DISCARD = 0x103, //!< b00000011
ETM4_PKT_I_OVERFLOW = 0x105, //!< b00000101
// ETE extended types
ETE_PKT_I_PE_RESET = 0x400, // base type is exception packet.
ETE_PKT_I_TRANS_FAIL = 0x401, // base type is exception packet.
} ocsd_etmv4_i_pkt_type;
typedef union _etmv4_trace_info_t {
uint32_t val; //!< trace info full value.
struct {
uint32_t cc_enabled:1; //!< 1 if cycle count enabled
uint32_t cond_enabled:3; //!< conditional trace enabeld type
uint32_t cond_enabled:3; //!< conditional trace enabled type.
uint32_t p0_load:1; //!< 1 if tracing with P0 load elements (for data trace)
uint32_t p0_store:1; //!< 1 if tracing with P0 store elements (for data trace)
uint32_t in_trans_state:1; //!< 1 if starting trace when in a transactional state (ETE trace).
} bits; //!< bitfields for trace info value.
} etmv4_trace_info_t;
@ -167,6 +184,7 @@ typedef struct _etmv4_context_t {
uint32_t updated:1; //!< updated this context packet (otherwise same as last time)
uint32_t updated_c:1; //!< updated CtxtID
uint32_t updated_v:1; //!< updated VMID
uint32_t NSE:1; //!< PE FEAT_RME: root / realm indicator
};
uint32_t ctxtID; //!< Current ctxtID
uint32_t VMID; //!< current VMID
@ -256,6 +274,11 @@ typedef struct _ocsd_etmv4_i_pkt
};
} Q_pkt;
struct {
uint8_t el;
uint64_t value;
} ite_pkt;
//! valid bits for packet elements (addresses have their own valid bits).
union {
uint32_t val;
@ -277,6 +300,9 @@ typedef struct _ocsd_etmv4_i_pkt
ocsd_etmv4_i_pkt_type err_type;
uint8_t err_hdr_val;
// protocol version - validity of ETE specific fields 0xMm == v Major.minor
uint8_t protocol_version;
} ocsd_etmv4_i_pkt;
@ -359,6 +385,9 @@ typedef struct _ocsd_etmv4_cfg
ocsd_core_profile_t core_prof; /**< Core Profile */
} ocsd_etmv4_cfg;
#define ETE_ARCH_VERSION 0x5
#define ETE_OPFLG_PKTDEC_SRCADDR_N_ATOMS 0x00010000 /**< Split source address output ranges for N-atoms */
/** @}*/
/** @}*/

View File

@ -278,11 +278,13 @@ typedef enum _ocsd_arch_version {
ARCH_V7 = 0x0700, /**< V7 architecture */
ARCH_V8 = 0x0800, /**< V8 architecture */
ARCH_V8r3 = 0x0803, /**< V8.3 architecture */
ARCH_AA64 = 0x0864, /**< Min v8r3 plus additional AA64 PE features */
ARCH_V8_max = ARCH_AA64,
} ocsd_arch_version_t;
// macros for arch version comparisons.
#define OCSD_IS_V8_ARCH(arch) ((arch >= ARCH_V8) && (arch <= ARCH_V8r3))
#define OCSD_MIN_V8_ARCH(arch) (arch >= ARCH_V8)
#define OCSD_IS_V8_ARCH(arch) ((arch >= ARCH_V8) && (arch <= ARCH_V8_max))
#define OCSD_IS_ARCH_MINVER(arch, min_arch) (arch >= min_arch)
/** Core Profile */
typedef enum _ocsd_core_profile {
@ -336,8 +338,10 @@ typedef enum _ocsd_isa
*/
typedef enum _ocsd_sec_level
{
ocsd_sec_secure, /**< Core is in secure state */
ocsd_sec_nonsecure /**< Core is in non-secure state */
ocsd_sec_secure, /**< Core is in secure state */
ocsd_sec_nonsecure, /**< Core is in non-secure state */
ocsd_sec_root, /**< PE FEAT_RME: Core is in root state. */
ocsd_sec_realm, /**< PE FEAT_RME: Core is in realm state. */
} ocsd_sec_level ;
/** Exception level type
@ -352,7 +356,7 @@ typedef enum _ocsd_ex_level
} ocsd_ex_level;
/** instruction types - significant for waypoint calculaitons */
/** instruction types - significant for waypoint calculations */
typedef enum _ocsd_instr_type {
OCSD_INSTR_OTHER, /**< Other instruction - not significant for waypoints. */
OCSD_INSTR_BR, /**< Immediate Branch instruction */
@ -360,6 +364,7 @@ typedef enum _ocsd_instr_type {
OCSD_INSTR_ISB, /**< Barrier : ISB instruction */
OCSD_INSTR_DSB_DMB, /**< Barrier : DSB or DMB instruction */
OCSD_INSTR_WFI_WFE, /**< WFI or WFE traced as direct branch */
OCSD_INSTR_TSTART, /**< PE Arch feature FEAT_TME - TSTART instruction */
} ocsd_instr_type;
/** instruction sub types - addiitonal information passed to the output packets
@ -521,10 +526,11 @@ typedef struct _ocsd_file_mem_region {
(common flags share bitfield with pkt processor common flags and create flags)
@{*/
#define OCSD_OPFLG_PKTDEC_ERROR_BAD_PKTS 0x00000100 /**< throw error on bad packets input (default is to unsync and wait) */
#define OCSD_OPFLG_PKTDEC_ERROR_BAD_PKTS 0x00000100 /**< throw error on bad packets input (default is to warn) */
#define OCSD_OPFLG_PKTDEC_HALT_BAD_PKTS 0x00000200 /**< halt decoder on bad packets (default is to log error and continue by resetting decoder and wait for sync */
/** mask to combine all common packet processor operational control flags */
#define OCSD_OPFLG_PKTDEC_COMMON (OCSD_OPFLG_PKTDEC_ERROR_BAD_PKTS)
#define OCSD_OPFLG_PKTDEC_COMMON (OCSD_OPFLG_PKTDEC_ERROR_BAD_PKTS | OCSD_OPFLG_PKTDEC_HALT_BAD_PKTS)
/** @}*/
@ -547,6 +553,7 @@ typedef struct _ocsd_file_mem_region {
#define OCSD_BUILTIN_DCD_ETMV4I "ETMV4I" /**< ETMv4 instruction decoder */
#define OCSD_BUILTIN_DCD_ETMV4D "ETMV4D" /**< ETMv4 data decoder */
#define OCSD_BUILTIN_DCD_PTM "PTM" /**< PTM decoder */
#define OCSD_BUILTIN_DCD_ETE "ETE" /**< ETE decoder */
/*! Trace Protocol Builtin Types + extern
*/
@ -559,6 +566,7 @@ typedef enum _ocsd_trace_protocol_t {
OCSD_PROTOCOL_ETMV4D, /**< ETMV4 data trace protocol decoder. */
OCSD_PROTOCOL_PTM, /**< PTM program flow instruction trace protocol decoder. */
OCSD_PROTOCOL_STM, /**< STM system trace protocol decoder. */
OCSD_PROTOCOL_ETE, /**< ETE trace protocol decoder */
/* others to be added here */
OCSD_PROTOCOL_BUILTIN_END, /**< Invalid protocol - built-in protocol types end marker */
@ -627,6 +635,56 @@ typedef struct _ocsd_swt_info {
/** @}*/
/** @name Demux Statistics
Contains statistics for the CoreSight frame demultiplexor.
Counts total bytes sent to decoders registered against a trace ID, bytes in the input stream that are
associated with a trace ID that has no registered decoder, and frame bytes that are not trace data, but
are used to decode the frames - ID bytes, sync bytes etc.
@{*/
typedef struct _ocsd_demux_stats {
uint64_t valid_id_bytes; /**< number of bytes associated with an ID that has a registered decoder */
uint64_t no_id_bytes; /**< number of bytes associated with an ID that has no decoder */
uint64_t reserved_id_bytes; /**< number of bytes associated with reserved IDs */
uint64_t unknown_id_bytes; /**< bytes processed before ID seen in input frames */
uint64_t frame_bytes; /**< number of non-data bytes used for frame de-mux - ID bytes, sync etc */
} ocsd_demux_stats_t;
/** @}*/
/** @name Decode statistics
Contains statistics for bytes decoded by the packet decoder, if statistics are supported.
Stats block instantiated in the base class - derived protocol specific decoder must initialise and
use as required.
The single channel block contains the stats for the requested channel via the API call.
The global demux block contains the totals for all channels and non-data bytes used in CoreSight
frame demux. This block will show identical data for every requested channel via the API.
@{*/
typedef struct _ocsd_decode_stats {
uint32_t version; /**< library version number */
uint16_t revision; /**< revision number - defines the structure version for the stats. */
/* single channel block */
uint64_t channel_total; /**< total bytes processed for this channel */
uint64_t channel_unsynced; /**< number of unsynced bytes processed on this channel */
uint32_t bad_header_errs; /**< number of bad packet header errors */
uint32_t bad_sequence_errs; /**< number of bad packet sequence errors */
ocsd_demux_stats_t demux; /**< global demux stats block */
} ocsd_decode_stats_t;
#define OCSD_STATS_REVISION 0x1
/** @}*/
/** @}*/
#endif // ARM_OCSD_IF_TYPES_H_INCLUDED

View File

@ -42,9 +42,9 @@
/** @name Library Versioning
@{*/
#define OCSD_VER_MAJOR 0x0 /**< Library Major Version */
#define OCSD_VER_MINOR 0xE /**< Library Minor Version */
#define OCSD_VER_PATCH 0x2 /**< Library Patch Version */
#define OCSD_VER_MAJOR 0x1 /**< Library Major Version */
#define OCSD_VER_MINOR 0x4 /**< Library Minor Version */
#define OCSD_VER_PATCH 0x0 /**< Library Patch Version */
/** Library version number - MMMMnnpp format.
MMMM = major version,
@ -53,7 +53,7 @@
*/
#define OCSD_VER_NUM ((OCSD_VER_MAJOR << 16) | (OCSD_VER_MINOR << 8) | OCSD_VER_PATCH)
#define OCSD_VER_STRING "0.14.2" /**< Library Version string */
#define OCSD_VER_STRING "1.4.0" /**< Library Version string */
#define OCSD_LIB_NAME "OpenCSD Library" /**< Library name string */
#define OCSD_LIB_SHORT_NAME "OCSD" /**< Library Short name string */
/** @}*/

View File

@ -239,7 +239,8 @@ inline void TrcPktProcStm::checkSyncNibble()
if((m_nibble == 0) && (m_num_F_nibbles >= 21))
{
m_is_sync = true; //this nibble marks a sync sequence - keep the F nibble count
m_is_sync = true; //this nibble marks a sync sequence
m_num_F_nibbles = 21; // set the F nibble count - lose any extra as unsynced data.
}
else
{

View File

@ -60,7 +60,10 @@ typedef enum _ocsd_gen_trc_elem_t
OCSD_GEN_TRC_ELEM_TIMESTAMP, /*!< Timestamp - preceding elements happeded before this time. */
OCSD_GEN_TRC_ELEM_CYCLE_COUNT, /*!< Cycle count - cycles since last cycle count value - associated with a preceding instruction range. */
OCSD_GEN_TRC_ELEM_EVENT, /*!< Event - trigger or numbered event */
OCSD_GEN_TRC_ELEM_SWTRACE, /*!< Software trace packet - may contain data payload. */
OCSD_GEN_TRC_ELEM_SWTRACE, /*!< Software trace packet - may contain data payload. STM / ITM hardware trace with channel protocol */
OCSD_GEN_TRC_ELEM_SYNC_MARKER, /*!< Synchronisation marker - marks position in stream of an element that is output later. */
OCSD_GEN_TRC_ELEM_MEMTRANS, /*!< Trace indication of transactional memory operations. */
OCSD_GEN_TRC_ELEM_INSTRUMENTATION, /*!< PE instrumentation trace - PE generated SW trace, application dependent protocol. */
OCSD_GEN_TRC_ELEM_CUSTOM, /*!< Fully custom packet type - used by none-ARM architecture decoders */
} ocsd_gen_trc_elem_t;
@ -86,6 +89,27 @@ typedef enum _unsync_info_t {
UNSYNC_EOT, /**< end of trace - no additional info */
} unsync_info_t;
typedef enum _trace_sync_marker_t {
ELEM_MARKER_TS, /**< Marker for timestamp element */
} trace_sync_marker_t;
typedef struct _trace_marker_payload_t {
trace_sync_marker_t type; /**< type of sync marker */
uint32_t value; /**< sync marker value - usage depends on type */
} trace_marker_payload_t;
typedef enum _memtrans_t {
OCSD_MEM_TRANS_TRACE_INIT,/**< Trace started while PE in transactional state */
OCSD_MEM_TRANS_START, /**< Trace after this packet is part of a transactional memory sequence */
OCSD_MEM_TRANS_COMMIT, /**< Transactional memory sequence valid. */
OCSD_MEM_TRANS_FAIL, /**< Transactional memory sequence failed - operations since start of transaction have been unwound. */
} trace_memtrans_t;
typedef struct _sw_ite_t {
uint8_t el; /**< exception level for PE sw instrumentation instruction */
uint64_t value; /**< payload for PE sw instrumentation instruction */
} trace_sw_ite_t;
typedef struct _ocsd_generic_trace_elem {
ocsd_gen_trc_elem_t elem_type; /**< Element type - remaining data interpreted according to this value */
ocsd_isa isa; /**< instruction set for executed instructions */
@ -122,6 +146,9 @@ typedef struct _ocsd_generic_trace_elem {
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. */
trace_marker_payload_t sync_marker; /**< marker element - sync later element to position in stream */
trace_memtrans_t mem_trans; /**< memory transaction packet - transaction event */
trace_sw_ite_t sw_ite; /**< PE sw instrumentation using FEAT_ITE */
};
const void *ptr_extended_data; /**< pointer to extended data buffer (data trace, sw trace payload) / custom structure */

View File

@ -234,8 +234,24 @@ OCSD_C_API ocsd_err_t ocsd_dt_attach_packet_callback( const dcd_tree_handle_t h
return err;
}
/*** Decode tree set element output */
OCSD_C_API ocsd_err_t ocsd_dt_get_decode_stats(const dcd_tree_handle_t handle,
const unsigned char CSID,
ocsd_decode_stats_t **p_stats_block)
{
DecodeTree *pDT = static_cast<DecodeTree *>(handle);
return pDT->getDecoderStats(CSID, p_stats_block);
}
OCSD_C_API ocsd_err_t ocsd_dt_reset_decode_stats(const dcd_tree_handle_t handle,
const unsigned char CSID)
{
DecodeTree *pDT = static_cast<DecodeTree *>(handle);
return pDT->resetDecoderStats(CSID);
}
/*** Decode tree set element output */
OCSD_C_API ocsd_err_t ocsd_dt_set_gen_elem_outfn(const dcd_tree_handle_t handle, FnTraceElemIn pFn, const void *p_context)
{
@ -470,6 +486,39 @@ OCSD_C_API ocsd_err_t ocsd_dt_set_pkt_protocol_printer(const dcd_tree_handle_t h
return err;
}
OCSD_C_API void ocsd_err_str(const ocsd_err_t err, char *buffer, const int buffer_size)
{
std::string err_str;
err_str = ocsdError::getErrorString(ocsdError(OCSD_ERR_SEV_ERROR, err));
strncpy(buffer, err_str.c_str(), buffer_size - 1);
buffer[buffer_size - 1] = 0;
}
OCSD_C_API ocsd_err_t ocsd_get_last_err(ocsd_trc_index_t *index, uint8_t *chan_id, char *message, const int message_len)
{
ocsdError *p_err;
ocsd_err_t err = OCSD_OK;
std::string err_str;
p_err = DecodeTree::getDefaultErrorLogger()->GetLastError();
if (p_err)
{
*index = p_err->getErrorIndex();
*chan_id = p_err->getErrorChanID();
err_str = p_err->getErrorString(ocsdError(p_err));
strncpy(message, err_str.c_str(), message_len - 1);
message[message_len - 1] = 0;
err = p_err->getErrorCode();
}
else
{
message[0] = 0;
*index = OCSD_BAD_TRC_INDEX;
*chan_id = OCSD_BAD_CS_SRC_ID;
}
return err;
}
/*******************************************************************************/
/* C API local fns */
/*******************************************************************************/

View File

@ -659,7 +659,7 @@ void EtmV3TrcPacket::getExcepStr(std::string &excepStr) const
"IRQ4", "IRQ5", "IRQ6", "IRQ7",
"IRQ0","usage Fault","NMI","SVC",
"DebugMonitor", "Mem Manage","PendSV","SysTick",
"Reserved","PE Reset","Reserved","HardFault"
"Reserved","PE Reset","Reserved","HardFault",
"Reserved","BusFault","Reserved","Reserved"
};

View File

@ -98,7 +98,7 @@ void EtmV4Config::CalcVMIDSize()
uint32_t vmidszF = (m_cfg.reg_idr2 >> 10) & 0x1F;
if(vmidszF == 1)
m_VMIDSize = 8;
else if(MinVersion() > 0)
else if(FullVersion() > 0x40)
{
if(vmidszF == 2)
m_VMIDSize = 16;

View File

@ -128,6 +128,40 @@ TrcStackQElem *EtmV4P0Stack::createQElem(const ocsd_etmv4_i_pkt_type root_pkt, c
return pElem;
}
TrcStackElemMarker *EtmV4P0Stack::createMarkerElem(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const trace_marker_payload_t &marker)
{
TrcStackElemMarker *pElem = new (std::nothrow) TrcStackElemMarker(root_pkt, root_index);
if (pElem)
{
pElem->setMarker(marker);
push_front(pElem);
}
return pElem;
}
TrcStackElemAddr *EtmV4P0Stack::createSrcAddrElem(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const etmv4_addr_val_t &addr_val)
{
TrcStackElemAddr *pElem = new (std::nothrow) TrcStackElemAddr(root_pkt, root_index, true);
if (pElem)
{
pElem->setAddr(addr_val);
push_front(pElem);
}
return pElem;
}
TrcStackElemITE *EtmV4P0Stack::createITEElem(const ocsd_etmv4_i_pkt_type root_pkt, const ocsd_trc_index_t root_index, const trace_sw_ite_t &ite)
{
TrcStackElemITE *pElem = new (std::nothrow) TrcStackElemITE(root_pkt, root_index);
if (pElem)
{
pElem->setITE(ite);
push_front(pElem);
}
return pElem;
}
// iteration functions
void EtmV4P0Stack::from_front_init()
{
@ -150,6 +184,10 @@ void EtmV4P0Stack::erase_curr_from_front()
erase_iter = m_iter;
erase_iter--;
m_P0_stack.erase(erase_iter);
// explicitly delete the item here as the caller can no longer reference it.
// fixes memory leak from github issue #52
delete *erase_iter;
}

View File

@ -38,6 +38,7 @@
EtmV4ITrcPacket::EtmV4ITrcPacket()
{
protocol_version = 0x42; // min protocol version.
}
EtmV4ITrcPacket::~EtmV4ITrcPacket()
@ -101,6 +102,8 @@ void EtmV4ITrcPacket::toString(std::string &str) const
contextStr(ctxtStr);
case ETM4_PKT_I_ADDR_L_32IS0:
case ETM4_PKT_I_ADDR_L_32IS1:
case ETE_PKT_I_SRC_ADDR_L_32IS0:
case ETE_PKT_I_SRC_ADDR_L_32IS1:
trcPrintableElem::getValStr(valStr, (v_addr.size == VA_64BIT) ? 64 : 32, v_addr.valid_bits, v_addr.val, true, (v_addr.pkt_bits < 32) ? v_addr.pkt_bits : 0);
str += "; Addr=" + valStr + "; " + ctxtStr;
break;
@ -110,6 +113,8 @@ void EtmV4ITrcPacket::toString(std::string &str) const
contextStr(ctxtStr);
case ETM4_PKT_I_ADDR_L_64IS0:
case ETM4_PKT_I_ADDR_L_64IS1:
case ETE_PKT_I_SRC_ADDR_L_64IS0:
case ETE_PKT_I_SRC_ADDR_L_64IS1:
trcPrintableElem::getValStr(valStr, (v_addr.size == VA_64BIT) ? 64 : 32, v_addr.valid_bits, v_addr.val, true, (v_addr.pkt_bits < 64) ? v_addr.pkt_bits : 0);
str += "; Addr=" + valStr + "; " + ctxtStr;
break;
@ -121,11 +126,14 @@ void EtmV4ITrcPacket::toString(std::string &str) const
case ETM4_PKT_I_ADDR_S_IS0:
case ETM4_PKT_I_ADDR_S_IS1:
case ETE_PKT_I_SRC_ADDR_S_IS0:
case ETE_PKT_I_SRC_ADDR_S_IS1:
trcPrintableElem::getValStr(valStr, (v_addr.size == VA_64BIT) ? 64 : 32, v_addr.valid_bits, v_addr.val, true, v_addr.pkt_bits);
str += "; Addr=" + valStr;
break;
case ETM4_PKT_I_ADDR_MATCH:
case ETE_PKT_I_SRC_ADDR_MATCH:
addrMatchIdx(valStr);
str += ", " + valStr;
trcPrintableElem::getValStr(valStr, (v_addr.size == VA_64BIT) ? 64 : 32, v_addr.valid_bits, v_addr.val, true);
@ -161,7 +169,10 @@ void EtmV4ITrcPacket::toString(std::string &str) const
{
std::ostringstream oss;
oss << "; INFO=" << std::hex << "0x" << trace_info.val;
oss << " { CC." << std::dec << trace_info.bits.cc_enabled << " }";
oss << " { CC." << std::dec << trace_info.bits.cc_enabled;
if (isETE())
oss << ", TSTATE." << std::dec << trace_info.bits.in_trans_state;
oss << " }";
if (trace_info.bits.cc_enabled)
oss << "; CC_THRESHOLD=" << std::hex << "0x" << cc_threshold;
str += oss.str();
@ -264,6 +275,14 @@ void EtmV4ITrcPacket::toString(std::string &str) const
}
}
break;
case ETE_PKT_I_ITE:
{
std::ostringstream oss;
oss << "; EL" << std::dec << (int)ite_pkt.el << "; Payload=0x" << std::hex << ite_pkt.value;
str += oss.str();
}
break;
}
}
@ -349,6 +368,16 @@ const char *EtmV4ITrcPacket::packetTypeName(const ocsd_etmv4_i_pkt_type type, co
pName = "I_EXCEPT_RTN";
pDesc = "Exception Return.";
break;
case ETE_PKT_I_TRANS_ST:
pName = "I_TRANS_ST";
pDesc = "Transaction Start.";
break;
case ETE_PKT_I_TRANS_COMMIT:
pName = "I_TRANS_COMMIT";
pDesc = "Transaction Commit.";
break;
case ETM4_PKT_I_CCNT_F1:
pName = "I_CCNT_F1";
@ -481,6 +510,11 @@ const char *EtmV4ITrcPacket::packetTypeName(const ocsd_etmv4_i_pkt_type type, co
pDesc = "Address & Context, Long, 64 bit, IS1.";
break;
case ETE_PKT_I_TS_MARKER:
pName = "I_TS_MARKER";
pDesc = "Timestamp Marker";
break;
case ETM4_PKT_I_ADDR_MATCH:
pName = "I_ADDR_MATCH";
pDesc = "Exact Address Match.";
@ -521,6 +555,41 @@ const char *EtmV4ITrcPacket::packetTypeName(const ocsd_etmv4_i_pkt_type type, co
pDesc = "Q Packet.";
break;
case ETE_PKT_I_SRC_ADDR_MATCH:
pName = "I_SRC_ADDR_MATCH";
pDesc = "Exact Source Address Match.";
break;
case ETE_PKT_I_SRC_ADDR_S_IS0:
pName = "I_SRC_ADDR_S_IS0";
pDesc = "Source Address, Short, IS0.";
break;
case ETE_PKT_I_SRC_ADDR_S_IS1:
pName = "I_SRC_ADDR_S_IS1";
pDesc = "Source Address, Short, IS1.";
break;
case ETE_PKT_I_SRC_ADDR_L_32IS0:
pName = "I_SCR_ADDR_L_32IS0";
pDesc = "Source Address, Long, 32 bit, IS0.";
break;
case ETE_PKT_I_SRC_ADDR_L_32IS1:
pName = "I_SRC_ADDR_L_32IS1";
pDesc = "Source Address, Long, 32 bit, IS1.";
break;
case ETE_PKT_I_SRC_ADDR_L_64IS0:
pName = "I_SRC_ADDR_L_64IS0";
pDesc = "Source Address, Long, 64 bit, IS0.";
break;
case ETE_PKT_I_SRC_ADDR_L_64IS1:
pName = "I_SRC_ADDR_L_64IS1";
pDesc = "Source Address, Long, 64 bit, IS1.";
break;
case ETM4_PKT_I_ATOM_F6:
pName = "I_ATOM_F6";
pDesc = "Atom format 6.";
@ -566,6 +635,21 @@ const char *EtmV4ITrcPacket::packetTypeName(const ocsd_etmv4_i_pkt_type type, co
pDesc = "Overflow.";
break;
case ETE_PKT_I_PE_RESET:
pName = "I_PE_RESET";
pDesc = "PE Reset.";
break;
case ETE_PKT_I_TRANS_FAIL:
pName = "I_TRANS_FAIL";
pDesc = "Transaction Fail.";
break;
case ETE_PKT_I_ITE:
pName = "I_ITE";
pDesc = "Instrumentation";
break;
default:
break;
}

View File

@ -45,6 +45,9 @@
static const uint32_t ETMV4_SUPPORTED_OP_FLAGS = OCSD_OPFLG_PKTPROC_COMMON;
// test defines - if testing with ETMv4 sources, disable error on ERET.
// #define ETE_TRACE_ERET_AS_IGNORE
/* trace etmv4 packet processing class */
TrcPktProcEtmV4I::TrcPktProcEtmV4I() : TrcPktProcBase(ETMV4I_PKTS_NAME),
m_isInit(false),
@ -70,7 +73,9 @@ ocsd_err_t TrcPktProcEtmV4I::onProtocolConfig()
InitProcessorState();
m_config = *TrcPktProcBase::getProtocolConfig();
BuildIPacketTable(); // packet table based on config
m_curr_packet.setProtocolVersion(m_config.FullVersion());
m_isInit = true;
statsInit();
return OCSD_OK;
}
@ -152,6 +157,10 @@ ocsd_datapath_resp_t TrcPktProcEtmV4I::processData( const ocsd_trc_index_t inde
(err.getErrorCode() == OCSD_ERR_INVALID_PCKT_HDR))
{
// send invalid packets up the pipe to let the next stage decide what to do.
if (err.getErrorCode() == OCSD_ERR_INVALID_PCKT_HDR)
statsAddBadHdrCount(1);
else
statsAddBadSeqCount(1);
m_process_state = SEND_PKT;
done = false;
}
@ -171,6 +180,7 @@ ocsd_datapath_resp_t TrcPktProcEtmV4I::processData( const ocsd_trc_index_t inde
}
} while (!done);
statsAddTotalCount(m_trcIn.processed());
*numBytesProcessed = m_trcIn.processed();
return resp;
}
@ -241,8 +251,8 @@ ocsd_datapath_resp_t TrcPktProcEtmV4I::outputUnsyncedRawPacket()
{
ocsd_datapath_resp_t resp = OCSD_RESP_CONT;
outputRawPacketToMonitor(m_packet_index,&m_curr_packet,m_dump_unsynced_bytes,&m_currPacketData[0]);
statsAddUnsyncCount(m_dump_unsynced_bytes);
outputRawPacketToMonitor(m_packet_index,&m_curr_packet,m_dump_unsynced_bytes,&m_currPacketData[0]);
if(!m_sent_notsync_packet)
{
@ -290,6 +300,7 @@ void TrcPktProcEtmV4I::iPktNoPayload(const uint8_t lastByte)
switch(m_curr_packet.type)
{
case ETM4_PKT_I_ADDR_MATCH:
case ETE_PKT_I_SRC_ADDR_MATCH:
m_curr_packet.setAddressExactMatch(lastByte & 0x3);
break;
@ -307,6 +318,8 @@ void TrcPktProcEtmV4I::iPktNoPayload(const uint8_t lastByte)
case ETM4_PKT_I_EXCEPT_RTN:
case ETM4_PKT_I_TRACE_ON:
case ETM4_PKT_I_FUNC_RET:
case ETE_PKT_I_TRANS_ST:
case ETE_PKT_I_TRANS_COMMIT:
case ETM4_PKT_I_IGNORE:
default: break;
}
@ -437,6 +450,8 @@ void TrcPktProcEtmV4I::iPktTraceInfo(const uint8_t lastByte)
m_tinfo_sections.sectFlags |= (lastByte & 0x80) ? 0 : TINFO_SPEC_SECT;
else if(!(m_tinfo_sections.sectFlags & TINFO_CYCT_SECT))
m_tinfo_sections.sectFlags |= (lastByte & 0x80) ? 0 : TINFO_CYCT_SECT;
else if (!(m_tinfo_sections.sectFlags & TINFO_WNDW_SECT))
m_tinfo_sections.sectFlags |= (lastByte & 0x80) ? 0 : TINFO_WNDW_SECT;
}
// all sections accounted for?
@ -469,6 +484,11 @@ void TrcPktProcEtmV4I::iPktTraceInfo(const uint8_t lastByte)
idx += extractContField(m_currPacketData,idx,fieldVal);
m_curr_packet.setTraceInfoCyct(fieldVal);
}
if ((presSect & TINFO_WNDW_SECT) && (idx < m_currPacketData.size()))
{
idx += extractContField(m_currPacketData, idx, fieldVal);
/* Trace commit window unsupported in current ETE versions */
}
m_process_state = SEND_PKT;
m_first_trace_info = true;
}
@ -502,8 +522,11 @@ void TrcPktProcEtmV4I::iPktTimestamp(const uint8_t lastByte)
{
int idx = 1;
uint64_t tsVal;
int ts_bytes = extractContField64(m_currPacketData, idx, tsVal);
int ts_bits = ts_bytes < 7 ? ts_bytes * 7 : 64;
int ts_bytes = extractTSField64(m_currPacketData, idx, tsVal);
int ts_bits;
// if ts_bytes 8 or less, then cont bits on each byte, otherwise full 64 bit value for 9 bytes
ts_bits = ts_bytes < 9 ? ts_bytes * 7 : 64;
if(!m_curr_packet.pkt_valid.bits.ts_valid && m_first_trace_info)
ts_bits = 64; // after trace info, missing bits are all 0.
@ -534,6 +557,13 @@ void TrcPktProcEtmV4I::iPktException(const uint8_t lastByte)
case 1: m_excep_size = 3; break;
case 2: if((lastByte & 0x80) == 0x00)
m_excep_size = 2;
// ETE exception reset or trans failed
if (m_config.MajVersion() >= 0x5)
{
excep_type = (m_currPacketData[1] >> 1) & 0x1F;
if ((excep_type == 0x0) || (excep_type == 0x18))
m_excep_size = 3;
}
break;
}
@ -553,6 +583,18 @@ void TrcPktProcEtmV4I::iPktException(const uint8_t lastByte)
m_curr_packet.setExceptionInfo(excep_type,addr_interp,m_fault_pending, m_type);
m_process_state = SEND_PKT;
// ETE exception reset or trans failed
if (m_config.MajVersion() >= 0x5)
{
if ((excep_type == 0x0) || (excep_type == 0x18))
{
m_curr_packet.set64BitAddress(0, 0);
if (excep_type == 0x18)
m_curr_packet.setType(ETE_PKT_I_TRANS_FAIL);
else
m_curr_packet.setType(ETE_PKT_I_PE_RESET);
}
}
// allow the standard address packet handlers to process the address packet field for the exception.
}
}
@ -833,7 +875,7 @@ void TrcPktProcEtmV4I::extractAndSetContextInfo(const std::vector<uint8_t> &buff
// on input, buffer index points at the info byte - always present
uint8_t infoByte = m_currPacketData[st_idx];
m_curr_packet.setContextInfo(true, (infoByte & 0x3), (infoByte >> 5) & 0x1, (infoByte >> 4) & 0x1);
m_curr_packet.setContextInfo(true, (infoByte & 0x3), (infoByte >> 5) & 0x1, (infoByte >> 4) & 0x1, (infoByte >> 3) & 0x1);
// see if there are VMID and CID bytes, and how many.
int nVMID_bytes = ((infoByte & 0x40) == 0x40) ? (m_config.vmidSize()/8) : 0;
@ -937,7 +979,8 @@ void TrcPktProcEtmV4I::iPktShortAddr(const uint8_t lastByte)
{
m_addr_done = false;
m_addrIS = 0;
if (lastByte == ETM4_PKT_I_ADDR_S_IS1)
if ((lastByte == ETM4_PKT_I_ADDR_S_IS1) ||
(lastByte == ETE_PKT_I_SRC_ADDR_S_IS1))
m_addrIS = 1;
}
else if(!m_addr_done)
@ -988,14 +1031,18 @@ void TrcPktProcEtmV4I::iPktLongAddr(const uint8_t lastByte)
switch(m_curr_packet.type)
{
case ETM4_PKT_I_ADDR_L_32IS1:
case ETE_PKT_I_SRC_ADDR_L_32IS1:
m_addrIS = 1;
case ETM4_PKT_I_ADDR_L_32IS0:
case ETE_PKT_I_SRC_ADDR_L_32IS0:
m_addrBytes = 4;
break;
case ETM4_PKT_I_ADDR_L_64IS1:
case ETE_PKT_I_SRC_ADDR_L_64IS1:
m_addrIS = 1;
case ETM4_PKT_I_ADDR_L_64IS0:
case ETE_PKT_I_SRC_ADDR_L_64IS0:
m_addrBytes = 8;
m_bAddr64bit = true;
break;
@ -1203,6 +1250,23 @@ void TrcPktProcEtmV4I::iAtom(const uint8_t lastByte)
m_process_state = SEND_PKT;
}
void TrcPktProcEtmV4I::iPktITE(const uint8_t /* lastByte */)
{
uint64_t value;
int shift = 0;
/* packet is always 10 bytes, Header, EL info byte, 8 bytes payload */
if (m_currPacketData.size() == 10) {
value = 0;
for (int i = 2; i < 10; i++) {
value |= ((uint64_t)m_currPacketData[i]) << shift;
shift += 8;
}
m_curr_packet.setITE(m_currPacketData[1], value);
m_process_state = SEND_PKT;
}
}
// header byte processing is table driven.
void TrcPktProcEtmV4I::BuildIPacketTable()
{
@ -1247,7 +1311,35 @@ void TrcPktProcEtmV4I::BuildIPacketTable()
// b0000 0111 - exception return
m_i_table[0x07].pkt_type = ETM4_PKT_I_EXCEPT_RTN;
m_i_table[0x07].pptkFn = &TrcPktProcEtmV4I::iPktNoPayload;
if (m_config.MajVersion() >= 0x5) // not valid for ETE
{
#ifdef ETE_TRACE_ERET_AS_IGNORE
m_i_table[0x07].pkt_type = ETM4_PKT_I_IGNORE;
m_i_table[0x07].pptkFn = &EtmV4IPktProcImpl::iPktNoPayload;
#else
m_i_table[0x07].pptkFn = &TrcPktProcEtmV4I::iPktInvalidCfg;
#endif
}
else
m_i_table[0x07].pptkFn = &TrcPktProcEtmV4I::iPktNoPayload;
// b00001010, b00001011 ETE TRANS packets
// b00001001 - ETE sw instrumentation packet
if (m_config.MajVersion() >= 0x5)
{
m_i_table[0x0A].pkt_type = ETE_PKT_I_TRANS_ST;
m_i_table[0x0A].pptkFn = &TrcPktProcEtmV4I::iPktNoPayload;
m_i_table[0x0B].pkt_type = ETE_PKT_I_TRANS_COMMIT;
m_i_table[0x0B].pptkFn = &TrcPktProcEtmV4I::iPktNoPayload;
// FEAT_ITE - sw instrumentation packet
if (m_config.MinVersion() >= 0x3)
{
m_i_table[0x09].pkt_type = ETE_PKT_I_ITE;
m_i_table[0x09].pptkFn = &TrcPktProcEtmV4I::iPktITE;
}
}
// b0000 110x - cycle count f2
// b0000 111x - cycle count f1
@ -1443,6 +1535,12 @@ void TrcPktProcEtmV4I::BuildIPacketTable()
m_i_table[0x85+i].pptkFn = &TrcPktProcEtmV4I::iPktAddrCtxt;
}
// 0b1000 1000 - ETE 1.1 TS Marker. also ETMv4.6
if(m_config.FullVersion() >= 0x46)
{
m_i_table[0x88].pkt_type = ETE_PKT_I_TS_MARKER;
m_i_table[0x88].pptkFn = &TrcPktProcEtmV4I::iPktNoPayload;
}
// 0b1001 0000 to b1001 0010 - exact match addr
for(int i = 0; i < 3; i++)
{
@ -1492,6 +1590,30 @@ void TrcPktProcEtmV4I::BuildIPacketTable()
}
}
// b10110000 - b10111001 - ETE src address packets
if (m_config.FullVersion() >= 0x50)
{
for (int i = 0; i < 3; i++)
{
m_i_table[0xB0 + i].pkt_type = ETE_PKT_I_SRC_ADDR_MATCH;
m_i_table[0xB0 + i].pptkFn = &TrcPktProcEtmV4I::iPktNoPayload;
}
m_i_table[0xB4].pkt_type = ETE_PKT_I_SRC_ADDR_S_IS0;
m_i_table[0xB4].pptkFn = &TrcPktProcEtmV4I::iPktShortAddr;
m_i_table[0xB5].pkt_type = ETE_PKT_I_SRC_ADDR_S_IS1;
m_i_table[0xB5].pptkFn = &TrcPktProcEtmV4I::iPktShortAddr;
m_i_table[0xB6].pkt_type = ETE_PKT_I_SRC_ADDR_L_32IS0;
m_i_table[0xB6].pptkFn = &TrcPktProcEtmV4I::iPktLongAddr;
m_i_table[0xB7].pkt_type = ETE_PKT_I_SRC_ADDR_L_32IS1;
m_i_table[0xB7].pptkFn = &TrcPktProcEtmV4I::iPktLongAddr;
m_i_table[0xB8].pkt_type = ETE_PKT_I_SRC_ADDR_L_64IS0;
m_i_table[0xB8].pptkFn = &TrcPktProcEtmV4I::iPktLongAddr;
m_i_table[0xB9].pkt_type = ETE_PKT_I_SRC_ADDR_L_64IS1;
m_i_table[0xB9].pptkFn = &TrcPktProcEtmV4I::iPktLongAddr;
}
// Atom Packets - all no payload but have specific pattern generation fn
for(int i = 0xC0; i <= 0xD4; i++) // atom f6
{
@ -1559,20 +1681,33 @@ void TrcPktProcEtmV4I::BuildIPacketTable()
return idx;
}
unsigned TrcPktProcEtmV4I::extractContField64(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint64_t &value, const unsigned byte_limit /*= 9*/)
unsigned TrcPktProcEtmV4I::extractTSField64(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint64_t &value)
{
const unsigned max_byte_idx = 8; /* the 9th byte, index 8, will use full 8 bits for value */
unsigned idx = 0;
bool lastByte = false;
uint8_t byteVal;
uint8_t byteValMask = 0x7f;
/* init value */
value = 0;
while(!lastByte && (idx < byte_limit)) // max 9 bytes for 64 bit value;
while(!lastByte) // max 9 bytes for 64 bit value;
{
if(buffer.size() > (st_idx + idx))
{
// each byte has seven bits + cont bit
byteVal = buffer[(st_idx + idx)];
lastByte = (byteVal & 0x80) != 0x80;
value |= ((uint64_t)(byteVal & 0x7F)) << (idx * 7);
/* detect the final byte - which uses full 8 bits as value */
if (idx == max_byte_idx)
{
byteValMask = 0xFF; /* last byte of 9, no cont bit */
lastByte = true;
}
else
lastByte = (byteVal & 0x80) != 0x80;
value |= ((uint64_t)(byteVal & byteValMask)) << (idx * 7);
idx++;
}
else
@ -1580,6 +1715,7 @@ unsigned TrcPktProcEtmV4I::extractContField64(const std::vector<uint8_t> &buffer
throwBadSequenceError("Invalid 64 bit continuation fields in packet");
}
}
// index is the count of bytes used here.
return idx;
}

View File

@ -42,7 +42,7 @@ ocsd_err_t TrcIDecode::DecodeInstruction(ocsd_instr_info *instr_info)
struct decode_info info;
info.instr_sub_type = OCSD_S_INSTR_NONE;
info.arch_version = (uint16_t)(instr_info->pe_type.arch);
info.arch_version = instr_info->pe_type.arch;
switch(instr_info->isa)
{
@ -136,14 +136,12 @@ ocsd_err_t TrcIDecode::DecodeA64(ocsd_instr_info *instr_info, struct decode_info
if(inst_A64_is_indirect_branch_link(instr_info->opcode, &instr_info->is_link, info))
{
instr_info->type = OCSD_INSTR_BR_INDIRECT;
// instr_info->is_link = inst_A64_is_branch_and_link(instr_info->opcode);
}
else if(inst_A64_is_direct_branch_link(instr_info->opcode, &instr_info->is_link, info))
{
inst_A64_branch_destination(instr_info->instr_addr,instr_info->opcode,&branchAddr);
instr_info->type = OCSD_INSTR_BR;
instr_info->branch_addr = (ocsd_vaddr_t)branchAddr;
// instr_info->is_link = inst_A64_is_branch_and_link(instr_info->opcode);
}
else if((barrier = inst_A64_barrier(instr_info->opcode)) != ARM_BARRIER_NONE)
{
@ -160,12 +158,15 @@ ocsd_err_t TrcIDecode::DecodeA64(ocsd_instr_info *instr_info, struct decode_info
break;
}
}
else if (instr_info->wfi_wfe_branch)
else if (instr_info->wfi_wfe_branch &&
inst_A64_wfiwfe(instr_info->opcode, info))
{
if (inst_A64_wfiwfe(instr_info->opcode))
{
instr_info->type = OCSD_INSTR_WFI_WFE;
}
instr_info->type = OCSD_INSTR_WFI_WFE;
}
else if (OCSD_IS_ARCH_MINVER(info->arch_version, ARCH_AA64))
{
if (inst_A64_Tstart(instr_info->opcode))
instr_info->type = OCSD_INSTR_TSTART;
}
instr_info->is_conditional = inst_A64_is_conditional(instr_info->opcode);

View File

@ -244,8 +244,9 @@ int inst_A64_is_direct_branch_link(uint32_t inst, uint8_t *is_link, struct decod
int is_direct_branch = 1;
if ((inst & 0x7c000000) == 0x34000000) {
/* CB, TB */
} else if ((inst & 0xff000010) == 0x54000000) {
} else if ((inst & 0xff000000) == 0x54000000) {
/* B<cond> */
/* BC<cond> 8.8 / 9.3 arch - bit 4 = 1'b1 */
} else if ((inst & 0x7c000000) == 0x14000000) {
/* B, BL imm */
if (inst & 0x80000000) {
@ -258,11 +259,26 @@ int inst_A64_is_direct_branch_link(uint32_t inst, uint8_t *is_link, struct decod
return is_direct_branch;
}
int inst_A64_wfiwfe(uint32_t inst)
int inst_A64_wfiwfe(uint32_t inst, struct decode_info *info)
{
/* WFI, WFE may be traced as branches in etm 4.3++ */
if ((inst & 0xffffffdf) == 0xd503205f)
return 1;
/* new feature introduced post v8.3 */
if (OCSD_IS_ARCH_MINVER(info->arch_version, ARCH_AA64))
{
/* WFIT / WFET for later archs */
if ((inst & 0xffffffc0) == 0xd5031000)
return 1;
}
return 0;
}
int inst_A64_Tstart(uint32_t inst)
{
if ((inst & 0xffffffe0) == 0xd5233060)
return 1;
return 0;
}
@ -288,7 +304,7 @@ int inst_A64_is_indirect_branch_link(uint32_t inst, uint8_t *is_link, struct dec
} else if ((inst & 0xffffffff) == 0xd69f03e0) {
/* ERET */
info->instr_sub_type = OCSD_S_INSTR_V8_ERET;
} else if (info->arch_version >= 0x0803) {
} else if (OCSD_IS_ARCH_MINVER(info->arch_version, ARCH_V8r3)) {
/* new pointer auth instr for v8.3 arch */
if ((inst & 0xffdff800) == 0xd71f0800) {
/* BRAA, BRAB, BLRAA, BLRBB */
@ -399,8 +415,9 @@ int inst_A64_branch_destination(uint64_t addr, uint32_t inst, uint64_t *pnpc)
{
uint64_t npc;
int is_direct_branch = 1;
if ((inst & 0xff000010) == 0x54000000) {
if ((inst & 0xff000000) == 0x54000000) {
/* B<cond> */
/* BC<cond> */
npc = addr + ((int32_t)((inst & 0x00ffffe0) << 8) >> 11);
} else if ((inst & 0x7c000000) == 0x14000000) {
/* B, BL imm */
@ -484,7 +501,7 @@ int inst_A64_is_branch_and_link(uint32_t inst, struct decode_info *info)
} else if ((inst & 0xfc000000) == 0x94000000) {
/* BL */
info->instr_sub_type = OCSD_S_INSTR_BR_LINK;
} else if (info->arch_version >= 0x0803) {
} else if (OCSD_IS_ARCH_MINVER(info->arch_version, ARCH_V8r3)) {
/* new pointer auth instr for v8.3 arch */
if ((inst & 0xfffff800) == 0xd73f0800) {
/* BLRAA, BLRBB */
@ -553,8 +570,9 @@ int inst_A64_is_conditional(uint32_t inst)
if ((inst & 0x7c000000) == 0x34000000) {
/* CB, TB */
return 1;
} else if ((inst & 0xff000010) == 0x54000000) {
} else if ((inst & 0xff000000) == 0x54000000) {
/* B.cond */
/* BC.cond */
return 1;
}
return 0;

View File

@ -119,6 +119,14 @@ ocsd_err_t TrcMemAccMapper::ReadTargetMemory(const ocsd_vaddr_t address, const u
return err;
}
void TrcMemAccMapper::InvalidateMemAccCache(const uint8_t /* cs_trace_id */)
{
// default mapper does not use cs_trace_id for cache invalidation.
if (m_cache.enabled())
m_cache.invalidateAll();
m_acc_curr = 0;
}
void TrcMemAccMapper::RemoveAllAccessors()
{
TrcMemAccessorBase *pAcc = 0;

View File

@ -101,6 +101,13 @@ DecodeTree::DecodeTree() :
{
for(int i = 0; i < 0x80; i++)
m_decode_elements[i] = 0;
// reset the global demux stats.
m_demux_stats.frame_bytes = 0;
m_demux_stats.no_id_bytes = 0;
m_demux_stats.valid_id_bytes = 0;
m_demux_stats.unknown_id_bytes = 0;
m_demux_stats.reserved_id_bytes = 0;
}
DecodeTree::~DecodeTree()
@ -486,6 +493,62 @@ ocsd_err_t DecodeTree::removeDecoder(const uint8_t CSID)
return err;
}
ocsd_err_t DecodeTree::getDecoderStats(const uint8_t CSID, ocsd_decode_stats_t **p_stats_block)
{
ocsd_err_t err = OCSD_OK;
TrcPktProcI *pPktProc = getPktProcI(CSID);
if (!pPktProc)
return OCSD_ERR_INVALID_PARAM_VAL;
err = pPktProc->getStatsBlock(p_stats_block);
if (err == OCSD_OK) {
// copy in the global demux stats.
(*p_stats_block)->demux.frame_bytes = m_demux_stats.frame_bytes;
(*p_stats_block)->demux.no_id_bytes = m_demux_stats.no_id_bytes;
(*p_stats_block)->demux.valid_id_bytes = m_demux_stats.valid_id_bytes;
(*p_stats_block)->demux.unknown_id_bytes = m_demux_stats.unknown_id_bytes;
(*p_stats_block)->demux.reserved_id_bytes = m_demux_stats.reserved_id_bytes;
}
return err;
}
ocsd_err_t DecodeTree::resetDecoderStats(const uint8_t CSID)
{
TrcPktProcI *pPktProc = getPktProcI(CSID);
if (!pPktProc)
return OCSD_ERR_INVALID_PARAM_VAL;
pPktProc->resetStats();
// reset the global demux stats.
m_demux_stats.frame_bytes = 0;
m_demux_stats.no_id_bytes = 0;
m_demux_stats.valid_id_bytes = 0;
m_demux_stats.unknown_id_bytes = 0;
m_demux_stats.reserved_id_bytes = 0;
return OCSD_OK;
}
TrcPktProcI *DecodeTree::getPktProcI(const uint8_t CSID)
{
TrcPktProcI *pPktProc = 0;
TraceComponent *pComp, *pAssoc;
DecodeTreeElement *pElem = getDecoderElement(CSID);
if (pElem)
{
pComp = pElem->getDecoderHandle();
if (pComp)
{
/* if this is a full decoder then the associated component is the packet processor */
pAssoc = pComp->getAssocComponent();
if (pAssoc)
pPktProc = dynamic_cast<TrcPktProcI *>(pAssoc);
else
pPktProc = dynamic_cast<TrcPktProcI *>(pComp);
}
}
return pPktProc;
}
DecodeTreeElement * DecodeTree::getDecoderElement(const uint8_t CSID) const
{
DecodeTreeElement *ret_elem = 0;
@ -511,7 +574,7 @@ DecodeTreeElement *DecodeTree::getNextElement(uint8_t &elemID)
if(m_decode_elem_iter < 0x80)
{
// find a none zero entry or end of range
while((m_decode_elements[m_decode_elem_iter] == 0) && (m_decode_elem_iter < 0x80))
while((m_decode_elem_iter < 0x80) && (m_decode_elements[m_decode_elem_iter] == 0))
m_decode_elem_iter++;
// return entry unless end of range
@ -527,7 +590,7 @@ DecodeTreeElement *DecodeTree::getNextElement(uint8_t &elemID)
bool DecodeTree::initialise(const ocsd_dcd_tree_src_t type, uint32_t formatterCfgFlags)
{
bool initOK = true;
ocsd_err_t err;
m_dcd_tree_type = type;
if(type == OCSD_TRC_SRC_FRAME_FORMATTED)
{
@ -535,14 +598,19 @@ bool DecodeTree::initialise(const ocsd_dcd_tree_src_t type, uint32_t formatterCf
m_frame_deformatter_root = new (std::nothrow) TraceFormatterFrameDecoder();
if(m_frame_deformatter_root)
{
m_frame_deformatter_root->Configure(formatterCfgFlags);
if (m_frame_deformatter_root->Init() != OCSD_OK)
return false;
m_frame_deformatter_root->getErrLogAttachPt()->attach(DecodeTree::s_i_error_logger);
err = m_frame_deformatter_root->Configure(formatterCfgFlags);
if (err != OCSD_OK)
return false;
m_i_decoder_root = dynamic_cast<ITrcDataIn*>(m_frame_deformatter_root);
m_frame_deformatter_root->SetDemuxStatsBlock(&m_demux_stats);
}
else
initOK = false;
return false;
}
return initOK;
return true;
}
void DecodeTree::setSingleRoot(TrcPktProcI *pComp)
@ -621,6 +689,7 @@ ocsd_err_t DecodeTree::addPacketPrinter(uint8_t CSID, bool bMonitor, ItemPrinter
switch (protocol)
{
case OCSD_PROTOCOL_ETMV4I:
case OCSD_PROTOCOL_ETE:
{
PacketPrinter<EtmV4ITrcPacket> *pTPrinter = dynamic_cast<PacketPrinter<EtmV4ITrcPacket> *>(pPrinter);
if (bMonitor)

View File

@ -229,4 +229,25 @@ void ocsdError::appendErrorDetails(std::string &errStr, const ocsdError &error)
errStr = oss.str();
}
const char* ocsdDataRespStr::getStr()
{
static const char* szRespStr[] = {
"OCSD_RESP_CONT: Continue processing.",
"OCSD_RESP_WARN_CONT: Continue processing -> a component logged a warning.",
"OCSD_RESP_ERR_CONT: Continue processing -> a component logged an error.",
"OCSD_RESP_WAIT: Pause processing",
"OCSD_RESP_WARN_WAIT: Pause processing -> a component logged a warning.",
"OCSD_RESP_ERR_WAIT: Pause processing -> a component logged an error.",
"OCSD_RESP_FATAL_NOT_INIT: Processing Fatal Error : component unintialised.",
"OCSD_RESP_FATAL_INVALID_OP: Processing Fatal Error : invalid data path operation.",
"OCSD_RESP_FATAL_INVALID_PARAM: Processing Fatal Error : invalid parameter in datapath call.",
"OCSD_RESP_FATAL_INVALID_DATA: Processing Fatal Error : invalid trace data.",
"OCSD_RESP_FATAL_SYS_ERR: Processing Fatal Error : internal system error."
};
if ((m_type < OCSD_RESP_CONT) || (m_type > OCSD_RESP_FATAL_SYS_ERR))
return "Unknown OCSD_RESP type.";
return szRespStr[m_type];
}
/* End of File ocsd_error.cpp */

View File

@ -42,6 +42,7 @@ OcsdGenElemStack::OcsdGenElemStack() :
m_curr_elem_idx(0),
m_send_elem_idx(0),
m_CSID(0),
m_sendIf(NULL),
m_is_init(false)
{

View File

@ -39,13 +39,15 @@
#include "opencsd/etmv3/trc_dcd_mngr_etmv3.h"
#include "opencsd/ptm/trc_dcd_mngr_ptm.h"
#include "opencsd/stm/trc_dcd_mngr_stm.h"
#include "opencsd/ete/trc_dcd_mngr_ete.h"
// create array of built-in decoders to register with library
static built_in_decoder_info_t sBuiltInArray[] = {
CREATE_BUILTIN_ENTRY(DecoderMngrEtmV4I,OCSD_BUILTIN_DCD_ETMV4I),
CREATE_BUILTIN_ENTRY(DecoderMngrEtmV3, OCSD_BUILTIN_DCD_ETMV3),
CREATE_BUILTIN_ENTRY(DecoderMngrPtm, OCSD_BUILTIN_DCD_PTM),
CREATE_BUILTIN_ENTRY(DecoderMngrStm, OCSD_BUILTIN_DCD_STM)
CREATE_BUILTIN_ENTRY(DecoderMngrStm, OCSD_BUILTIN_DCD_STM),
CREATE_BUILTIN_ENTRY(DecoderMngrETE, OCSD_BUILTIN_DCD_ETE)
//{ 0, 0, 0}
};
@ -90,7 +92,6 @@ OcsdLibDcdRegister::~OcsdLibDcdRegister()
m_pLastTypedDecoderMngr = 0;
}
const ocsd_err_t OcsdLibDcdRegister::registerDecoderTypeByName(const std::string &name, IDecoderMngr *p_decoder_fact)
{
if(isRegisteredDecoder(name))

View File

@ -55,8 +55,9 @@ ItemPrinter *PktPrinterFact::createProtocolPrinter(std::vector<ItemPrinter *> &p
{
ItemPrinter *pPrinter = 0;
switch (protocol)
{
{
case OCSD_PROTOCOL_ETMV4I:
case OCSD_PROTOCOL_ETE:
pPrinter = new (std::nothrow) PacketPrinter<EtmV4ITrcPacket>(CSID);
break;
case OCSD_PROTOCOL_ETMV3:

View File

@ -224,6 +224,7 @@ void TrcPktProcPtm::InitProcessorState()
m_waitASyncSOPkt = false;
m_bAsyncRawOp = false;
m_bOPNotSyncPkt = false;
m_excepAltISA = 0;
m_curr_packet.ResetState();
InitPacketState();
@ -559,7 +560,7 @@ void TrcPktProcPtm::pktWPointUpdate()
m_gotExcepBytes = false; // mark as not got all required exception bytes thus far
m_numExcepBytes = 0; // 0 read in
m_addrPktIsa = ocsd_isa_unknown; // not set by this packet as yet
m_addrPktIsa = ocsd_isa_unknown; // not set by this packet as yet
}
// collect all the bytes needed
@ -567,10 +568,12 @@ void TrcPktProcPtm::pktWPointUpdate()
{
if(readByte(currByte))
{
byteIdx = m_currPacketData.size() - 1;
if(!m_gotAddrBytes)
{
if(byteIdx < 4)
// byteIdx for address byte will run from 1 to 5 - first 4 my have continuation or not.
if(byteIdx <= 4)
{
// address bytes 1 - 4;
// ISA stays the same

View File

@ -72,17 +72,6 @@ static ap_map_elem_t ap_map_array[] =
{ "Cortex-M4", { ARCH_V7, profile_CortexM } }
};
static ap_map_elem_t arch_map_array[] =
{
{ "ARMv7-A", { ARCH_V7, profile_CortexA } },
{ "ARMv7-R", { ARCH_V7, profile_CortexR } },
{ "ARMv7-M", { ARCH_V7, profile_CortexM } },
{ "ARMv8-A", { ARCH_V8, profile_CortexA } },
{ "ARMv8.3-A", { ARCH_V8r3, profile_CortexA } },
{ "ARMv8-R", { ARCH_V8, profile_CortexR } },
{ "ARMv8-M", { ARCH_V8, profile_CortexM } },
};
CoreArchProfileMap::CoreArchProfileMap()
{
unsigned i;
@ -90,10 +79,99 @@ CoreArchProfileMap::CoreArchProfileMap()
{
core_profiles[ap_map_array[i].name] = ap_map_array[i].ap;
}
for (i = 0; i < sizeof(arch_map_array) / sizeof(_ap_map_elements); i++)
{
arch_profiles[arch_map_array[i].name] = arch_map_array[i].ap;
}
}
ocsd_arch_profile_t CoreArchProfileMap::getArchProfile(const std::string &coreName)
{
ocsd_arch_profile_t ap = { ARCH_UNKNOWN, profile_Unknown };
bool bFound = false;
std::map<std::string, ocsd_arch_profile_t>::const_iterator it;
/* match against the core name map. */
it = core_profiles.find(coreName);
if (it != core_profiles.end())
{
ap = it->second;
bFound = true;
}
/* try a pattern match on core name - pick up ARMvM[.m]-P and ARM-{aa|AA}64[-P] */
if (!bFound)
ap = getPatternMatchCoreName(coreName);
return ap;
}
ocsd_arch_profile_t CoreArchProfileMap::getPatternMatchCoreName(const std::string &coreName)
{
ocsd_arch_profile_t ap = { ARCH_UNKNOWN, profile_Unknown };
size_t pos;
/* look for ARMvM[.m]-P */
pos = coreName.find("ARMv");
if (pos == 0)
{
int majver = coreName[4] - '0';
int minver = 0;
int dotoffset = 0;
pos = coreName.find_first_of(".");
if (pos == 5) {
minver = coreName[6] - '0';
dotoffset = 2;
}
else if (pos != std::string::npos)
return ap;
if (majver == 7)
ap.arch = ARCH_V7;
else if (majver >= 8) {
ap.arch = ARCH_AA64; /* default to 8.3+*/
if (majver == 8) {
if (minver < 3)
ap.arch = ARCH_V8;
else if (minver == 3)
ap.arch = ARCH_V8r3;
}
}
else
return ap; /* no valid version - return unknown */
if (coreName.find_first_of("-", 4) == (size_t)(5 + dotoffset)) {
int profile_idx = 6 + dotoffset;
if (coreName[profile_idx] == 'A')
ap.profile = profile_CortexA;
else if (coreName[profile_idx] == 'R')
ap.profile = profile_CortexR;
else if (coreName[profile_idx] == 'M')
ap.profile = profile_CortexM;
else
ap.arch = ARCH_UNKNOWN; /*reset arch, return unknown*/
}
else
ap.arch = ARCH_UNKNOWN; /*reset arch, return unknown*/
return ap;
}
/* look for ARM-{AA|aa}64[-P] */
pos = coreName.find("ARM-");
if (pos == 0)
{
pos = coreName.find("aa64");
if (pos != 4)
pos = coreName.find("AA64");
if (pos == 4)
{
ap.arch = ARCH_AA64;
ap.profile = profile_CortexA;
if (coreName.find_first_of("-", 7) == 8) {
if (coreName[9] == 'R')
ap.profile = profile_CortexR;
else if (coreName[9] == 'M')
ap.profile = profile_CortexM;
}
}
}
return ap;
}
/* End of File trc_core_arch_map.cpp */

View File

@ -54,7 +54,8 @@ TraceFmtDcdImpl::TraceFmtDcdImpl() : TraceComponent(DEFORMATTER_NAME),
m_use_force_sync(false),
m_alignment(16), // assume frame aligned data as default.
m_b_output_packed_raw(false),
m_b_output_unpacked_raw(false)
m_b_output_unpacked_raw(false),
m_pStatsBlock(0)
{
resetStateParams();
@ -244,7 +245,12 @@ ocsd_datapath_resp_t TraceFmtDcdImpl::processTraceData(
if(m_trc_curr_idx != index) // none continuous trace data - throw an error.
throw ocsdError(OCSD_ERR_SEV_ERROR,OCSD_ERR_DFMTR_NOTCONTTRACE,index);
}
// record the incoming block for extraction routines to use.
m_in_block_base = pDataBlock;
m_in_block_size = dataBlockSize;
m_in_block_processed = 0;
if(dataBlockSize % m_alignment) // must be correctly aligned data
{
ocsdError err(OCSD_ERR_SEV_ERROR, OCSD_ERR_INVALID_PARAM_VAL);
@ -254,11 +260,6 @@ ocsd_datapath_resp_t TraceFmtDcdImpl::processTraceData(
throw ocsdError(&err);
}
// record the incoming block for extraction routines to use.
m_in_block_base = pDataBlock;
m_in_block_size = dataBlockSize;
m_in_block_processed = 0;
// processing loop...
if(checkForSync())
{
@ -324,12 +325,18 @@ ocsd_err_t TraceFmtDcdImpl::DecodeConfigure(uint32_t flags)
}
else
{
// alightment is the multiple of bytes the buffer size must be.
m_cfgFlags = flags;
// using memory aligned buffers, the formatter always outputs 16 byte frames so enforce
// this on the input
m_alignment = 16;
if(flags & OCSD_DFRMTR_HAS_FSYNCS)
m_alignment = 4;
else if(flags & OCSD_DFRMTR_HAS_HSYNCS)
// if we have HSYNCS then always align to 2 byte buffers
if(flags & OCSD_DFRMTR_HAS_HSYNCS)
m_alignment = 2;
// otherwise FSYNCS only can have 4 byte aligned buffers.
else if(flags & OCSD_DFRMTR_HAS_FSYNCS)
m_alignment = 4;
}
return err;
}
@ -344,6 +351,7 @@ void TraceFmtDcdImpl::resetStateParams()
// current frame processing
m_ex_frm_n_bytes = 0;
m_b_fsync_start_eob = false;
m_trc_curr_idx_sof = OCSD_BAD_TRC_INDEX;
}
@ -415,20 +423,23 @@ void TraceFmtDcdImpl::outputUnsyncedBytes(uint32_t /*num_bytes*/)
//**TBD:
}
int TraceFmtDcdImpl::checkForResetFSyncPatterns()
ocsd_err_t TraceFmtDcdImpl::checkForResetFSyncPatterns(uint32_t &f_sync_bytes)
{
const uint32_t FSYNC_PATTERN = 0x7FFFFFFF; // LE host pattern for FSYNC
bool check_for_fsync = true;
int num_fsyncs = 0;
const uint8_t *dataPtr = m_in_block_base + m_in_block_processed;
uint32_t bytes_processed = m_in_block_processed;
const uint8_t *dataPtr = m_in_block_base + bytes_processed;
ocsd_err_t err = OCSD_OK;
while (check_for_fsync && (m_in_block_processed < m_in_block_size))
while (check_for_fsync && (bytes_processed < m_in_block_size))
{
// look for consecutive fsyncs as padding or for reset downstream - both cases will reset downstream....
if (*((uint32_t *)(dataPtr)) == FSYNC_PATTERN)
{
dataPtr += sizeof(uint32_t);
num_fsyncs++;
num_fsyncs++;
bytes_processed += sizeof(uint32_t);
}
else
check_for_fsync = false;
@ -436,7 +447,6 @@ int TraceFmtDcdImpl::checkForResetFSyncPatterns()
if (num_fsyncs)
{
printf("Frame deformatter: Found %d FSYNCS\n",num_fsyncs);
if ((num_fsyncs % 4) == 0)
{
// reset the upstream decoders
@ -449,32 +459,40 @@ int TraceFmtDcdImpl::checkForResetFSyncPatterns()
}
else
{
// TBD: throw processing error, none frame size block of fsyncs
err = OCSD_ERR_DFMTR_BAD_FHSYNC;
}
}
return num_fsyncs * 4;
f_sync_bytes += num_fsyncs * 4;
return err;
}
/* Extract a single frame from the input buffer. */
bool TraceFmtDcdImpl::extractFrame()
{
const uint32_t FSYNC_PATTERN = 0x7FFFFFFF; // LE host pattern for FSYNC
const uint16_t HSYNC_PATTERN = 0x7FFF; // LE host pattern for HSYNC
const uint16_t FSYNC_START = 0xFFFF; // LE host pattern for start 2 bytes of fsync
bool cont_process = true; // continue processing after extraction.
ocsd_err_t err;
uint32_t f_sync_bytes = 0; // skipped f sync bytes
uint32_t h_sync_bytes = 0; // skipped h sync bytes
uint32_t ex_bytes = 0; // extracted this pass (may be filling out part frame)
uint32_t buf_left = m_in_block_size - m_in_block_processed; // bytes remaining in buffer this pass.
// memory aligned sources are always multiples of frames, aligned to start.
// last call was end of input block - but carried on to process full frame.
// exit early here.
if (!buf_left)
return false;
// memory aligned input data is forced to be always multiples of 16 byte frames, aligned to start.
if( m_cfgFlags & OCSD_DFRMTR_FRAME_MEM_ALIGN)
{
// some linux drivers (e.g. for perf) will insert FSYNCS to pad or differentiate
// between blocks of aligned data, always in frame aligned complete 16 byte frames.
// between blocks of aligned data, always in frame aligned complete 16 byte frames.
// we need to skip past these frames, resetting as we go.
if (m_cfgFlags & OCSD_DFRMTR_RESET_ON_4X_FSYNC)
{
f_sync_bytes = checkForResetFSyncPatterns();
err = checkForResetFSyncPatterns(f_sync_bytes);
/* in this case the FSYNC pattern is output on both packed and unpacked cases */
if (f_sync_bytes && (m_b_output_packed_raw || m_b_output_unpacked_raw))
@ -486,77 +504,96 @@ bool TraceFmtDcdImpl::extractFrame()
m_in_block_base + m_in_block_processed,
0);
}
// throw processing error, none frame size block of fsyncs
if (err)
throw ocsdError(OCSD_ERR_SEV_ERROR, err, m_trc_curr_idx, "Incorrect FSYNC frame reset pattern");
buf_left -= f_sync_bytes;
}
if((m_in_block_processed+f_sync_bytes) == m_in_block_size)
if (buf_left)
{
m_ex_frm_n_bytes = 0;
cont_process = false; // end of input data.
}
else
{
// always a complete frame.
m_ex_frm_n_bytes = OCSD_DFRMTR_FRAME_SIZE;
memcpy(m_ex_frm_data, m_in_block_base + m_in_block_processed + f_sync_bytes, m_ex_frm_n_bytes);
m_trc_curr_idx_sof = m_trc_curr_idx + f_sync_bytes;
ex_bytes = OCSD_DFRMTR_FRAME_SIZE;
// always a complete frame - the input data has to be 16 byte multiple alignment.
m_ex_frm_n_bytes = OCSD_DFRMTR_FRAME_SIZE;
memcpy(m_ex_frm_data, m_in_block_base + m_in_block_processed + f_sync_bytes, m_ex_frm_n_bytes);
m_trc_curr_idx_sof = m_trc_curr_idx + f_sync_bytes;
ex_bytes = OCSD_DFRMTR_FRAME_SIZE;
}
}
else
{
// extract data accounting for frame syncs and hsyncs if present.
// we know we are aligned at this point - could be FSYNC or HSYNCs here.
// HSYNC present, library forces input to be aligned 2 byte multiples
// FSYNC - w/o HSYNCs, forces input to be aligned 4 byte multiples.
// check what we a looking for
bool hasFSyncs = ((m_cfgFlags & OCSD_DFRMTR_HAS_FSYNCS) == OCSD_DFRMTR_HAS_FSYNCS);
bool hasHSyncs = ((m_cfgFlags & OCSD_DFRMTR_HAS_HSYNCS) == OCSD_DFRMTR_HAS_HSYNCS);
bool hasFSyncs = ((m_cfgFlags & OCSD_DFRMTR_HAS_FSYNCS) == OCSD_DFRMTR_HAS_FSYNCS);
bool hasHSyncs = ((m_cfgFlags & OCSD_DFRMTR_HAS_HSYNCS) == OCSD_DFRMTR_HAS_HSYNCS);
const uint8_t* dataPtr = m_in_block_base + m_in_block_processed;
uint16_t data_pair_val;
const uint8_t *dataPtr = m_in_block_base+m_in_block_processed;
const uint8_t *eodPtr = m_in_block_base+m_in_block_size;
cont_process = (bool)(dataPtr < eodPtr);
// can have FSYNCS at start of frame (in middle is an error).
if(hasFSyncs && cont_process && (m_ex_frm_n_bytes == 0))
if (hasFSyncs && (m_ex_frm_n_bytes == 0))
{
while((*((uint32_t *)(dataPtr)) == FSYNC_PATTERN) && cont_process)
// was there an fsync start at the end of the last buffer?
if (m_b_fsync_start_eob) {
// last 2 of FSYNC look like HSYNC
if (*(uint16_t*)(dataPtr) != HSYNC_PATTERN)
{
// this means 0xFFFF followed by something else - invalid ID + ????
throw ocsdError(OCSD_ERR_SEV_ERROR, OCSD_ERR_DFMTR_BAD_FHSYNC, m_trc_curr_idx, "Bad FSYNC pattern before frame or invalid ID.(0x7F)");
}
else
{
f_sync_bytes += 2;
buf_left -= 2;
dataPtr += 2;
}
m_b_fsync_start_eob = false;
}
// regular fsync checks
while ((buf_left >= 4) && (*((uint32_t*)(dataPtr)) == FSYNC_PATTERN))
{
f_sync_bytes += 4;
dataPtr += 4;
cont_process = (bool)(dataPtr < eodPtr);
buf_left -= 4;
}
// handle possible part fsync at the end of a buffer
if (buf_left == 2)
{
if (*(uint16_t*)(dataPtr) == FSYNC_START)
{
f_sync_bytes += 2;
buf_left -= 2;
dataPtr += 2;
m_b_fsync_start_eob = true;
}
}
}
// not an FSYNC
while((m_ex_frm_n_bytes < OCSD_DFRMTR_FRAME_SIZE) && cont_process)
// process remaining data in pairs of bytes
while ((m_ex_frm_n_bytes < OCSD_DFRMTR_FRAME_SIZE) && buf_left)
{
// check for illegal out of sequence FSYNC
if((m_ex_frm_n_bytes % 4) == 0)
{
if(*((uint32_t *)(dataPtr)) == FSYNC_PATTERN)
{
// throw an illegal FSYNC error
throw ocsdError(OCSD_ERR_SEV_ERROR, OCSD_ERR_DFMTR_BAD_FHSYNC, m_trc_curr_idx, "Bad FSYNC in frame.");
}
}
// mark start of frame after FSyncs
if(m_ex_frm_n_bytes == 0)
if (m_ex_frm_n_bytes == 0)
m_trc_curr_idx_sof = m_trc_curr_idx + f_sync_bytes;
m_ex_frm_data[m_ex_frm_n_bytes] = dataPtr[0];
m_ex_frm_data[m_ex_frm_n_bytes+1] = dataPtr[1];
m_ex_frm_n_bytes+=2;
ex_bytes +=2;
m_ex_frm_data[m_ex_frm_n_bytes + 1] = dataPtr[1];
data_pair_val = *((uint16_t*)(dataPtr));
// check pair is not HSYNC
if(*((uint16_t *)(dataPtr)) == HSYNC_PATTERN)
if (data_pair_val == HSYNC_PATTERN)
{
if(hasHSyncs)
if (hasHSyncs)
{
m_ex_frm_n_bytes-=2;
ex_bytes -= 2;
h_sync_bytes+=2;
h_sync_bytes += 2;
}
else
{
@ -564,22 +601,27 @@ bool TraceFmtDcdImpl::extractFrame()
throw ocsdError(OCSD_ERR_SEV_ERROR, OCSD_ERR_DFMTR_BAD_FHSYNC, m_trc_curr_idx, "Bad HSYNC in frame.");
}
}
// can't have a start of FSYNC here / illegal trace ID
else if (data_pair_val == FSYNC_START)
{
throw ocsdError(OCSD_ERR_SEV_ERROR, OCSD_ERR_DFMTR_BAD_FHSYNC, m_trc_curr_idx, "Bad FSYNC start in frame or invalid ID (0x7F).");
}
else
{
m_ex_frm_n_bytes += 2;
ex_bytes += 2;
}
buf_left -= 2;
dataPtr += 2;
cont_process = (bool)(dataPtr < eodPtr);
}
// if we hit the end of data but still have a complete frame waiting,
// need to continue processing to allow it to be used.
if(!cont_process && (m_ex_frm_n_bytes == OCSD_DFRMTR_FRAME_SIZE))
cont_process = true;
}
// total bytes processed this pass
uint32_t total_processed = ex_bytes + f_sync_bytes + h_sync_bytes;
// output raw data on raw frame channel - packed raw.
if (((m_ex_frm_n_bytes == OCSD_DFRMTR_FRAME_SIZE) || !cont_process) && m_b_output_packed_raw)
if (((m_ex_frm_n_bytes == OCSD_DFRMTR_FRAME_SIZE) || (buf_left == 0)) && m_b_output_packed_raw)
{
outputRawMonBytes( OCSD_OP_DATA,
m_trc_curr_idx,
@ -595,7 +637,11 @@ bool TraceFmtDcdImpl::extractFrame()
// update index past the processed data
m_trc_curr_idx += total_processed;
return cont_process;
// update any none trace data byte stats
addToFrameStats((uint64_t)(f_sync_bytes + h_sync_bytes));
// if we are exiting with a full frame then signal processing to continue
return (bool)(m_ex_frm_n_bytes == OCSD_DFRMTR_FRAME_SIZE);
}
bool TraceFmtDcdImpl::unpackFrame()
@ -604,6 +650,7 @@ bool TraceFmtDcdImpl::unpackFrame()
uint8_t frameFlagBit = 0x1;
uint8_t newSrcID = OCSD_BAD_CS_SRC_ID;
bool PrevIDandIDChange = false;
uint64_t noneDataBytes = 0;
// init output processing
m_out_data_idx = 0;
@ -650,6 +697,7 @@ bool TraceFmtDcdImpl::unpackFrame()
/// TBD - ID indexing in here.
}
noneDataBytes++;
}
else
// it's just data
@ -671,6 +719,7 @@ bool TraceFmtDcdImpl::unpackFrame()
{
// no matter if change or not, no associated data in byte 15 anyway so just set.
m_curr_src_ID = (m_ex_frm_data[14] >> 1) & 0x7f;
noneDataBytes++;
}
// it's data
else
@ -678,6 +727,9 @@ bool TraceFmtDcdImpl::unpackFrame()
m_out_data[m_out_data_idx].data[m_out_data[m_out_data_idx].valid++] = m_ex_frm_data[14] | ((frameFlagBit & m_ex_frm_data[15]) ? 0x1 : 0x0);
}
m_ex_frm_n_bytes = 0; // mark frame as empty;
noneDataBytes++; // byte 15 is always non-data.
addToFrameStats(noneDataBytes); // update the non data byte stats.
return true;
}
@ -716,6 +768,8 @@ bool TraceFmtDcdImpl::outputFrame()
m_out_data[m_out_processed].data + m_out_data[m_out_processed].used,
&bytes_used));
addToIDStats((uint64_t)bytes_used);
if(!dataPathCont())
{
cont_processing = false;
@ -739,7 +793,12 @@ bool TraceFmtDcdImpl::outputFrame()
m_out_data[m_out_processed].valid,
m_out_data[m_out_processed].data,
m_out_data[m_out_processed].id);
}
}
if (isReservedID(m_out_data[m_out_processed].id))
addToReservedIDStats((uint64_t)m_out_data[m_out_processed].valid);
else
addToNoIDStats((uint64_t)m_out_data[m_out_processed].valid);
m_out_processed++; // skip past this data.
}
}
@ -754,13 +813,44 @@ bool TraceFmtDcdImpl::outputFrame()
m_out_data[m_out_processed].valid,
m_out_data[m_out_processed].data,
m_out_data[m_out_processed].id);
}
}
addToUnknownIDStats((uint64_t)m_out_data[m_out_processed].valid);
m_out_processed++; // skip past this data.
}
}
return cont_processing;
}
void TraceFmtDcdImpl::addToIDStats(uint64_t val)
{
if (m_pStatsBlock)
m_pStatsBlock->valid_id_bytes += val;
}
void TraceFmtDcdImpl::addToNoIDStats(uint64_t val)
{
if (m_pStatsBlock)
m_pStatsBlock->no_id_bytes += val;
}
void TraceFmtDcdImpl::addToFrameStats(uint64_t val)
{
if (m_pStatsBlock)
m_pStatsBlock->frame_bytes += val;
}
void TraceFmtDcdImpl::addToUnknownIDStats(uint64_t val)
{
if (m_pStatsBlock)
m_pStatsBlock->unknown_id_bytes += val;
}
void TraceFmtDcdImpl::addToReservedIDStats(uint64_t val)
{
if (m_pStatsBlock)
m_pStatsBlock->reserved_id_bytes += val;
}
/***************************************************************/
/* interface */
/***************************************************************/
@ -819,21 +909,27 @@ componentAttachPt<ITraceErrorLog> *TraceFormatterFrameDecoder::getErrLogAttachPt
return (m_pDecoder != 0) ? m_pDecoder->getErrorLogAttachPt() : 0;
}
/* configuration - set operational mode for incoming stream (has FSYNCS etc) */
ocsd_err_t TraceFormatterFrameDecoder::Configure(uint32_t cfg_flags)
ocsd_err_t TraceFormatterFrameDecoder::Init()
{
if(!m_pDecoder)
{
if(m_instNum >= 0)
if (!m_pDecoder)
{
if (m_instNum >= 0)
m_pDecoder = new (std::nothrow) TraceFmtDcdImpl(m_instNum);
else
m_pDecoder = new (std::nothrow) TraceFmtDcdImpl();
if(!m_pDecoder) return OCSD_ERR_MEM;
if (!m_pDecoder) return OCSD_ERR_MEM;
}
m_pDecoder->DecodeConfigure(cfg_flags);
return OCSD_OK;
}
/* configuration - set operational mode for incoming stream (has FSYNCS etc) */
ocsd_err_t TraceFormatterFrameDecoder::Configure(uint32_t cfg_flags)
{
if (!m_pDecoder)
return OCSD_ERR_NOT_INIT;
return m_pDecoder->DecodeConfigure(cfg_flags);
}
const uint32_t TraceFormatterFrameDecoder::getConfigFlags() const
{
uint32_t flags = 0;
@ -865,5 +961,10 @@ ocsd_datapath_resp_t TraceFormatterFrameDecoder::Flush()
return (m_pDecoder == 0) ? OCSD_RESP_FATAL_NOT_INIT : m_pDecoder->Flush();
}
void TraceFormatterFrameDecoder::SetDemuxStatsBlock(ocsd_demux_stats_t *pStatsBlock)
{
if (m_pDecoder)
m_pDecoder->SetDemuxStatsBlock(pStatsBlock);
}
/* End of File trc_frame_deformatter.cpp */

View File

@ -75,6 +75,8 @@ private:
ocsd_err_t DecodeConfigure(uint32_t flags);
ocsd_err_t SetForcedSyncIndex(ocsd_trc_index_t index, bool bSet);
void SetDemuxStatsBlock(ocsd_demux_stats_t *pStatsBlock) { m_pStatsBlock = pStatsBlock; };
private:
ocsd_datapath_resp_t executeNoneDataOpAllIDs(ocsd_datapath_op_t op, const ocsd_trc_index_t index = 0);
ocsd_datapath_resp_t processTraceData(const ocsd_trc_index_t index,
@ -113,12 +115,20 @@ private:
void setRawChanFilterAll(bool bEnable);
const bool rawChanEnabled(const uint8_t id) const;
int checkForResetFSyncPatterns();
ocsd_err_t checkForResetFSyncPatterns(uint32_t &f_sync_bytes);
friend class TraceFormatterFrameDecoder;
// attachment points
// stats updates
void addToIDStats(uint64_t val);
void addToNoIDStats(uint64_t val);
void addToFrameStats(uint64_t val);
void addToUnknownIDStats(uint64_t val);
void addToReservedIDStats(uint64_t val);
bool isReservedID(uint8_t ID) { return ((ID == 0) || (ID >= 0x70)); };
// attachment points
componentAttachPt<ITrcDataIn> m_IDStreams[128];
componentAttachPt<ITrcRawFrameIn> m_RawTraceFrame;
@ -142,12 +152,18 @@ private:
// incoming frame buffer
uint8_t m_ex_frm_data[OCSD_DFRMTR_FRAME_SIZE]; // buffer the current frame in case we have to stop part way through
int m_ex_frm_n_bytes; // number of valid bytes in the current frame (extraction)
bool m_b_fsync_start_eob; // flag to indicate that the end of the last buffer was a pair of bytes
// (0xffff) that could only validly be the start and FSYNC.
ocsd_trc_index_t m_trc_curr_idx_sof; // trace source index at start of frame.
// channel output data - can never be more than a frame of data for a single ID.
out_chan_data m_out_data[7]; // can only be 8 ID changes in a frame, but last on has no associated data so 7 possible data blocks
/* channel output data - can never be more than a frame of data for a single ID.
* 8 possible ID changes per frame. Although the final one can have no associated data, a pathological
* case exists with 7 ID changes, all data associated with a previous frame, except for last
* ID / data byte which is data. Not possible with normal hardware but guard against corrupt input.
*/
out_chan_data m_out_data[8]; // output data for a given ID
int m_out_data_idx; // number of out_chan_data frames used.
int m_out_processed; // number of complete out_chan_data frames output.
int m_out_processed; // number of complete out_chan_data frames output.
/* local copy of input buffer pointers*/
const uint8_t *m_in_block_base;
@ -159,6 +175,8 @@ private:
bool m_b_output_unpacked_raw;
bool m_raw_chan_enable[128];
ocsd_demux_stats_t *m_pStatsBlock;
};

View File

@ -54,7 +54,10 @@ static const char *s_elem_descs[][2] =
{"OCSD_GEN_TRC_ELEM_TIMESTAMP","Timestamp - preceding elements happeded before this time."},
{"OCSD_GEN_TRC_ELEM_CYCLE_COUNT","Cycle count - cycles since last cycle count value - associated with a preceding instruction range."},
{"OCSD_GEN_TRC_ELEM_EVENT","Event - numbered event or trigger"},
{"OCSD_GEN_TRC_ELEM_SWTRACE","Software trace packet - may contain data payload."},
{"OCSD_GEN_TRC_ELEM_SWTRACE","Software trace packet - may contain data payload. STM / ITM hardware trace with channel protocol."},
{"OCSD_GEN_TRC_ELEM_SYNC_MARKER","Synchronisation marker - marks position in stream of an element that is output later."},
{"OCSD_GEN_TRC_ELEM_MEMTRANS","Trace indication of transactional memory operations."},
{"OCSD_GEN_TRC_ELEM_INSTRUMENTATION", "PE instrumentation trace - PE generated SW trace, application dependent protocol."},
{"OCSD_GEN_TRC_ELEM_CUSTOM","Fully custom packet type."}
};
@ -64,7 +67,8 @@ static const char *instr_type[] = {
"iBR ",
"ISB ",
"DSB.DMB",
"WFI.WFE"
"WFI.WFE",
"TSTART"
};
#define T_SIZE (sizeof(instr_type) / sizeof(const char *))
@ -105,6 +109,16 @@ static const char *s_unsync_reason[] = {
"bad-packet", // UNSYNC_BAD_PACKET - bad packet at input - resync to restart.
"end-of-trace", // UNSYNC_EOT - end of trace info.
};
static const char *s_transaction_type[] = {
"Init",
"Start",
"Commit",
"Fail"
};
static const char *s_marker_t[] = {
"Timestamp marker", // ELEM_MARKER_TS
};
void OcsdTraceElement::toString(std::string &str) const
{
@ -158,7 +172,14 @@ void OcsdTraceElement::toString(std::string &str) const
{
oss << "EL" << std::dec << (int)(context.exception_level);
}
oss << (context.security_level == ocsd_sec_secure ? "S; " : "N; ") << (context.bits64 ? "64-bit; " : "32-bit; ");
switch (context.security_level)
{
case ocsd_sec_secure: oss << "S; "; break;
case ocsd_sec_nonsecure: oss << "N; "; break;
case ocsd_sec_root: oss << "Root; "; break;
case ocsd_sec_realm: oss << "Realm; "; break;
}
oss << (context.bits64 ? "64-bit; " : "32-bit; ");
if(context.vmid_valid)
oss << "VMID=0x" << std::hex << context.vmid << "; ";
if(context.ctxt_id_valid)
@ -190,6 +211,19 @@ void OcsdTraceElement::toString(std::string &str) const
oss << " [" << s_unsync_reason[unsync_eot_info] << "]";
break;
case OCSD_GEN_TRC_ELEM_SYNC_MARKER:
oss << " [" << s_marker_t[sync_marker.type] << "(0x" << std::setfill('0') << std::setw(8) << std::hex << sync_marker.value << ")]";
break;
case OCSD_GEN_TRC_ELEM_MEMTRANS:
if (mem_trans <= OCSD_MEM_TRANS_FAIL)
oss << s_transaction_type[mem_trans];
break;
case OCSD_GEN_TRC_ELEM_INSTRUMENTATION:
oss << "EL" << std::dec << (int)sw_ite.el << "; 0x" << std::setfill('0') << std::setw(16) << std::hex << sw_ite.value;
break;
default: break;
}
if(has_cc)

View File

@ -52,8 +52,6 @@ void trcPrintableElem::getValStr(std::string &valStr, const int valTotalBitSize,
assert((valTotalBitSize >= 4) && (valTotalBitSize <= 64));
uint64_t LimitMask = ~0ULL;
LimitMask >>= 64-valTotalBitSize;
valStr = "0x";
if(asHex)

View File

@ -0,0 +1,213 @@
########################################################
# Copyright 2015 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.
#
#################################################################################
# OpenCSD - master makefile for libraries and tests
#
# command line options
# DEBUG=1 create a debug build
#
# Set project root - relative to build makefile
ifeq ($(OCSD_ROOT),)
OCSD_ROOT := $(shell echo $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | sed 's,/build/linux.*,,')
export OCSD_ROOT
endif
# library names
LIB_BASE_NAME=opencsd
export LIB_BASE_NAME
LIB_CAPI_NAME=$(LIB_BASE_NAME)_c_api
export LIB_CAPI_NAME
# source root directories
export OCSD_LIB_ROOT=$(OCSD_ROOT)/lib
export OCSD_INCLUDE=$(OCSD_ROOT)/include
export OCSD_SOURCE=$(OCSD_ROOT)/source
export OCSD_TESTS=$(OCSD_ROOT)/tests
export LIB_UAPI_INC_DIR=opencsd
# tools
export MASTER_CC=$(CROSS_COMPILE)gcc
export MASTER_CXX=$(CROSS_COMPILE)g++
export MASTER_LINKER=$(CROSS_COMPILE)g++
export MASTER_LIB=$(CROSS_COMPILE)ar
export INSTALL=install
# installation directory
PREFIX ?=/usr
LIB_PATH ?= lib
INSTALL_LIB_DIR=$(DESTDIR)$(PREFIX)/$(LIB_PATH)
INSTALL_BIN_DIR=$(DESTDIR)$(PREFIX)/bin
export INSTALL_INCLUDE_DIR=$(DESTDIR)$(PREFIX)/include/
INSTALL_MAN_DIR=$(DESTDIR)$(PREFIX)/share/man/man1
# compile flags
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
# debug variant
ifdef DEBUG
CFLAGS += -g -O0 -DDEBUG
CXXFLAGS += -g -O0 -DDEBUG
BUILD_VARIANT=dbg
else
CFLAGS += -O2 -DNDEBUG
CXXFLAGS += -O2 -DNDEBUG
BUILD_VARIANT=rel
endif
# export build flags
export CFLAGS
export CXXFLAGS
export LDFLAGS
export ARFLAGS
# target directories - fixed for default packaging build
PLAT_DIR ?= builddir
export PLAT_DIR
export LIB_TARGET_DIR=$(OCSD_LIB_ROOT)/$(PLAT_DIR)
export LIB_TEST_TARGET_DIR=$(OCSD_TESTS)/lib/$(PLAT_DIR)
export BIN_TEST_TARGET_DIR=$(OCSD_TESTS)/bin/$(PLAT_DIR)
# Fish version out of header file (converting from hex)
getver:=printf "%d" $$(awk '/\#define VARNAME/ { print $$3 }' $(OCSD_ROOT)/include/opencsd/ocsd_if_version.h)
export SO_MAJOR_VER := $(shell $(subst VARNAME,OCSD_VER_MAJOR,$(getver)))
SO_MINOR_VER := $(shell $(subst VARNAME,OCSD_VER_MINOR,$(getver)))
SO_PATCH_VER := $(shell $(subst VARNAME,OCSD_VER_PATCH,$(getver)))
export SO_VER := $(SO_MAJOR_VER).$(SO_MINOR_VER).$(SO_PATCH_VER)
###########################################################
# build targets
all: libs tests
libs: $(LIB_BASE_NAME)_lib $(LIB_CAPI_NAME)_lib
DEF_SO_PERM ?= 644
install: libs tests
mkdir -p $(INSTALL_LIB_DIR) $(INSTALL_INCLUDE_DIR) $(INSTALL_BIN_DIR)
cp -d $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so $(INSTALL_LIB_DIR)/
cp -d $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so.$(SO_MAJOR_VER) $(INSTALL_LIB_DIR)/
$(INSTALL) --mode=$(DEF_SO_PERM) $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so.$(SO_VER) $(INSTALL_LIB_DIR)/
cp -d $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so $(INSTALL_LIB_DIR)/
cp -d $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so.$(SO_MAJOR_VER) $(INSTALL_LIB_DIR)/
$(INSTALL) --mode=$(DEF_SO_PERM) $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so.$(SO_VER) $(INSTALL_LIB_DIR)/
ifndef DISABLE_STATIC
$(INSTALL) --mode=644 $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).a $(INSTALL_LIB_DIR)/
$(INSTALL) --mode=644 $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).a $(INSTALL_LIB_DIR)/
endif
cd $(OCSD_ROOT)/build/linux/rctdl_c_api_lib && make install_inc
$(INSTALL) --mode=755 $(BIN_TEST_TARGET_DIR)/trc_pkt_lister $(INSTALL_BIN_DIR)/
install_man:
mkdir -p $(INSTALL_MAN_DIR)
$(INSTALL) --mode=644 $(OCSD_ROOT)/docs/man/trc_pkt_lister.1 $(INSTALL_MAN_DIR)/
################################
# build OpenCSD trace decode library
#
$(LIB_BASE_NAME)_lib: $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).a $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so
$(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so: $(LIB_BASE_NAME)_all
$(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).a: $(LIB_BASE_NAME)_all
# single command builds both .a and .so targets in sub-makefile
$(LIB_BASE_NAME)_all:
mkdir -p $(LIB_TARGET_DIR)
cd $(OCSD_ROOT)/build/linux/ref_trace_decode_lib && $(MAKE)
################################
# build OpenCSD trace decode C API library
#
$(LIB_CAPI_NAME)_lib: $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).a $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so
$(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so: $(LIB_CAPI_NAME)_all
$(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).a: $(LIB_CAPI_NAME)_all
# single command builds both .a and .so targets in sub-makefile
$(LIB_CAPI_NAME)_all: $(LIB_BASE_NAME)_lib
mkdir -p $(LIB_TARGET_DIR)
cd $(OCSD_ROOT)/build/linux/rctdl_c_api_lib && $(MAKE)
#################################
# build tests
.PHONY: tests
tests: libs
cd $(OCSD_ROOT)/tests/build/linux/echo_test_dcd_lib && $(MAKE)
cd $(OCSD_ROOT)/tests/build/linux/snapshot_parser_lib && $(MAKE)
cd $(OCSD_ROOT)/tests/build/linux/trc_pkt_lister && $(MAKE)
cd $(OCSD_ROOT)/tests/build/linux/c_api_pkt_print_test && $(MAKE)
cd $(OCSD_ROOT)/tests/build/linux/mem_buffer_eg && $(MAKE)
cd $(OCSD_ROOT)/tests/build/linux/frame_demux_test && $(MAKE)
#
# build docs
.PHONY: docs
docs:
(cd $(OCSD_ROOT)/docs; doxygen doxygen_config.dox)
#############################################################
# clean targets
#
clean: clean_libs clean_tests clean_docs
.PHONY: clean_libs clean_tests clean_docs clean_install
clean_libs:
cd $(OCSD_ROOT)/build/linux/ref_trace_decode_lib && $(MAKE) clean
cd $(OCSD_ROOT)/build/linux/rctdl_c_api_lib && $(MAKE) clean
clean_tests:
cd $(OCSD_ROOT)/tests/build/linux/echo_test_dcd_lib && $(MAKE) clean
cd $(OCSD_ROOT)/tests/build/linux/snapshot_parser_lib && $(MAKE) clean
cd $(OCSD_ROOT)/tests/build/linux/trc_pkt_lister && $(MAKE) clean
cd $(OCSD_ROOT)/tests/build/linux/c_api_pkt_print_test && $(MAKE) clean
cd $(OCSD_ROOT)/tests/build/linux/mem_buffer_eg && $(MAKE) clean
cd $(OCSD_ROOT)/tests/build/linux/frame_demux_test && $(MAKE) clean
-rmdir $(OCSD_TESTS)/lib
clean_docs:
-rm -r $(OCSD_ROOT)/docs/html
clean_install:
-rm $(INSTALL_LIB_DIR)/lib$(LIB_BASE_NAME).*
-rm $(INSTALL_LIB_DIR)/lib$(LIB_CAPI_NAME).*
-rm -r $(INSTALL_INCLUDE_DIR)/$(LIB_UAPI_INC_DIR)
-rm $(INSTALL_BIN_DIR)/trc_pkt_lister
-rm $(INSTALL_MAN_DIR)/trc_pkt_lister.1

View File

@ -0,0 +1,70 @@
########################################################
# Copyright 2018 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.
#
#################################################################################
## Set up some addtional parameters for development environment builds. ##
## define arch/build sub-dirs for non installed dev builds
ifndef ARCH
ARCH := $(shell dpkg-architecture -q DEB_HOST_GNU_CPU || echo not)
endif
# platform bit size variant
ifeq ($(ARCH),x86)
MFLAG:="-m32"
BIT_VARIANT=32
else ifeq ($(ARCH),x86_64)
MFLAG:="-m64"
BIT_VARIANT=64
else ifeq ($(ARCH),arm)
BIT_VARIANT=-arm
else ifeq ($(ARCH),arm64)
BIT_VARIANT=-arm64
else ifeq ($(ARCH),aarch64)
BIT_VARIANT=-arm64
else ifeq ($(ARCH),aarch32)
BIT_VARIANT=-arm
endif
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
# for dev env, enable static link build test
export TEST_STATIC_LINKING=1
# include the main makefile
include makefile

View File

@ -0,0 +1,123 @@
########################################################
# Copyright 2015 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.
#
#################################################################################
# OpenCSD - makefile for C API wrapper library
#
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
LIB := $(MASTER_LIB)
LIB_NAME = lib$(LIB_CAPI_NAME)
SO_LIB_DEPS= -L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME)
BUILD_DIR=./$(PLAT_DIR)
VPATH= $(OCSD_SOURCE)/c_api
CXX_INCLUDES= \
-I$(OCSD_INCLUDE) \
-I$(OCSD_SOURCE)/c_api
OBJECTS=$(BUILD_DIR)/ocsd_c_api.o \
$(BUILD_DIR)/ocsd_c_api_custom_obj.o
INST_INC_SRC=$(OCSD_INCLUDE)/$(LIB_UAPI_INC_DIR)
INST_INC_DST=$(INSTALL_INCLUDE_DIR)/$(LIB_UAPI_INC_DIR)
all: links
links: $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER) $(LIB_TARGET_DIR)/$(LIB_NAME).so
.PHONY: links
LIBS:= $(LIB_TARGET_DIR)/$(LIB_NAME).a $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER)
$(LIB_TARGET_DIR):
mkdir -p $(LIB_TARGET_DIR)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(LIB_TARGET_DIR)/$(LIB_NAME).a: $(OBJECTS) | $(BUILD_DIR) $(LIB_TARGET_DIR)
$(LIB) $(ARFLAGS) $(LIB_TARGET_DIR)/$(LIB_NAME).a $(OBJECTS)
$(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER): $(OBJECTS) | $(BUILD_DIR) $(LIB_TARGET_DIR)
$(LINKER) $(LDFLAGS) -shared -o $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER) -Wl,-soname,$(LIB_NAME).so.$(SO_MAJOR_VER) $(OBJECTS) $(SO_LIB_DEPS)
$(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER): $(LIBS) | $(LIB_TARGET_DIR)
( cd $(LIB_TARGET_DIR); ln -sf $(LIB_NAME).so.$(SO_VER) $(LIB_NAME).so.$(SO_MAJOR_VER) )
$(LIB_TARGET_DIR)/$(LIB_NAME).so: $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER) | $(LIB_TARGET_DIR)
( cd $(LIB_TARGET_DIR); ln -sf $(LIB_NAME).so.$(SO_MAJOR_VER) $(LIB_NAME).so )
##### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | $(BUILD_DIR)
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean:
rm -f $(OBJECTS)
rm -f $(DEPS)
rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).a
rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).so*
-rmdir $(BUILD_DIR)
#### install the necessary include files for the c-api library on linux
install_inc:
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/trc_gen_elem_types.h $(INST_INC_DST)/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/ocsd_if_types.h $(INST_INC_DST)/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/ocsd_if_version.h $(INST_INC_DST)/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/trc_pkt_types.h $(INST_INC_DST)/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/ptm
$(INSTALL) --mode=0644 $(INST_INC_SRC)/ptm/trc_pkt_types_ptm.h $(INST_INC_DST)/ptm/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/stm
$(INSTALL) --mode=0644 $(INST_INC_SRC)/stm/trc_pkt_types_stm.h $(INST_INC_DST)/stm/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/etmv3
$(INSTALL) --mode=0644 $(INST_INC_SRC)/etmv3/trc_pkt_types_etmv3.h $(INST_INC_DST)/etmv3/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/etmv4
$(INSTALL) --mode=0644 $(INST_INC_SRC)/etmv4/trc_pkt_types_etmv4.h $(INST_INC_DST)/etmv4/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/ete
$(INSTALL) --mode=0644 $(INST_INC_SRC)/ete/trc_pkt_types_ete.h $(INST_INC_DST)/ete/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/c_api
$(INSTALL) --mode=0644 $(INST_INC_SRC)/c_api/ocsd_c_api_types.h $(INST_INC_DST)/c_api/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/c_api/opencsd_c_api.h $(INST_INC_DST)/c_api/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/c_api/ocsd_c_api_custom.h $(INST_INC_DST)/c_api/

View File

@ -0,0 +1,160 @@
########################################################
# Copyright 2015 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.
#
#################################################################################
# OpenCSD - makefile for main trace decode library
#
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
LIB := $(MASTER_LIB)
LIB_NAME= lib$(LIB_BASE_NAME)
BUILD_DIR=./$(PLAT_DIR)
VPATH= $(OCSD_SOURCE) \
$(OCSD_SOURCE)/etmv3 \
$(OCSD_SOURCE)/etmv4 \
$(OCSD_SOURCE)/ete \
$(OCSD_SOURCE)/ptm \
$(OCSD_SOURCE)/i_dec \
$(OCSD_SOURCE)/mem_acc \
$(OCSD_SOURCE)/stm \
$(OCSD_SOURCE)/pkt_printers
CXX_INCLUDES= \
-I$(OCSD_INCLUDE) \
-I$(OCSD_SOURCE)
ETMV3OBJ= $(BUILD_DIR)/trc_cmp_cfg_etmv3.o \
$(BUILD_DIR)/trc_pkt_decode_etmv3.o \
$(BUILD_DIR)/trc_pkt_elem_etmv3.o \
$(BUILD_DIR)/trc_pkt_proc_etmv3.o \
$(BUILD_DIR)/trc_pkt_proc_etmv3_impl.o
ETMV4OBJ= $(BUILD_DIR)/trc_cmp_cfg_etmv4.o \
$(BUILD_DIR)/trc_etmv4_stack_elem.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_cmp_cfg_ete.o
PTMOBJ= $(BUILD_DIR)/trc_cmp_cfg_ptm.o \
$(BUILD_DIR)/trc_pkt_elem_ptm.o \
$(BUILD_DIR)/trc_pkt_proc_ptm.o \
$(BUILD_DIR)/trc_pkt_decode_ptm.o
IDECOBJ= $(BUILD_DIR)/trc_i_decode.o \
$(BUILD_DIR)/trc_idec_arminst.o
MEMACCOBJ= $(BUILD_DIR)/trc_mem_acc_mapper.o \
$(BUILD_DIR)/trc_mem_acc_bufptr.o \
$(BUILD_DIR)/trc_mem_acc_file.o \
$(BUILD_DIR)/trc_mem_acc_base.o \
$(BUILD_DIR)/trc_mem_acc_cb.o \
$(BUILD_DIR)/trc_mem_acc_cache.o
STMOBJ= $(BUILD_DIR)/trc_pkt_elem_stm.o \
$(BUILD_DIR)/trc_pkt_proc_stm.o \
$(BUILD_DIR)/trc_pkt_decode_stm.o
PKTPRNTOBJ= $(BUILD_DIR)/raw_frame_printer.o \
$(BUILD_DIR)/trc_print_fact.o
OBJECTS=$(BUILD_DIR)/ocsd_code_follower.o \
$(BUILD_DIR)/ocsd_dcd_tree.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 \
$(BUILD_DIR)/trc_component.o \
$(BUILD_DIR)/trc_core_arch_map.o \
$(BUILD_DIR)/trc_frame_deformatter.o \
$(BUILD_DIR)/trc_gen_elem.o \
$(BUILD_DIR)/trc_printable_elem.o \
$(BUILD_DIR)/trc_ret_stack.o \
$(ETMV3OBJ) \
$(ETMV4OBJ) \
$(IDECOBJ) \
$(MEMACCOBJ) \
$(STMOBJ) \
$(PTMOBJ) \
$(PKTPRNTOBJ)
all: links
links: $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER) $(LIB_TARGET_DIR)/$(LIB_NAME).so
.PHONY: links
LIBS:= $(LIB_TARGET_DIR)/$(LIB_NAME).a $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER)
$(LIB_TARGET_DIR):
mkdir -p $(LIB_TARGET_DIR)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(LIB_TARGET_DIR)/$(LIB_NAME).a: $(OBJECTS) | $(BUILD_DIR) $(LIB_TARGET_DIR)
$(LIB) $(ARFLAGS) $(LIB_TARGET_DIR)/$(LIB_NAME).a $(OBJECTS)
$(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER): $(OBJECTS) | $(BUILD_DIR) $(LIB_TARGET_DIR)
$(LINKER) $(LDFLAGS) -shared -o $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER) -Wl,-soname,$(LIB_NAME).so.$(SO_MAJOR_VER) $(OBJECTS)
$(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER): $(LIBS) | $(LIB_TARGET_DIR)
( cd $(LIB_TARGET_DIR); ln -sf $(LIB_NAME).so.$(SO_VER) $(LIB_NAME).so.$(SO_MAJOR_VER) )
$(LIB_TARGET_DIR)/$(LIB_NAME).so: $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER) | $(LIB_TARGET_DIR)
( cd $(LIB_TARGET_DIR); ln -sf $(LIB_NAME).so.$(SO_MAJOR_VER) $(LIB_NAME).so )
##### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | $(BUILD_DIR)
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean:
rm -f $(OBJECTS)
rm -f $(DEPS)
rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).a
rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).so*
-rmdir $(BUILD_DIR)

View File

@ -0,0 +1,460 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-dll|Win32">
<Configuration>Debug-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-dll|x64">
<Configuration>Debug-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|Win32">
<Configuration>Release-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|x64">
<Configuration>Release-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7F500891-CC76-405F-933F-F682BC39F923}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ref_trace_decode_lib</RootNamespace>
<ProjectName>opencsd_lib</ProjectName>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<TargetExt>.lib</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="..\..\..\..\HOWTO.md" />
<None Include="..\..\..\..\LICENSE" />
<None Include="..\..\..\..\README.md" />
<None Include="..\..\..\..\TODO" />
<None Include="..\..\..\docs\build_libs.md" />
<None Include="..\..\..\docs\external_custom.md" />
<None Include="..\..\..\docs\man\trc_pkt_lister.1" />
<None Include="..\..\..\docs\test_progs.md" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\common\comp_attach_notifier_i.h" />
<ClInclude Include="..\..\..\include\common\comp_attach_pt_t.h" />
<ClInclude Include="..\..\..\include\common\ocsd_code_follower.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr_i.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree_elem.h" />
<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" />
<ClInclude Include="..\..\..\include\common\ocsd_version.h" />
<ClInclude Include="..\..\..\include\common\trc_component.h" />
<ClInclude Include="..\..\..\include\common\trc_core_arch_map.h" />
<ClInclude Include="..\..\..\include\common\trc_cs_config.h" />
<ClInclude Include="..\..\..\include\common\trc_frame_deformatter.h" />
<ClInclude Include="..\..\..\include\common\trc_gen_elem.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_decode_base.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_elem_base.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_proc_base.h" />
<ClInclude Include="..\..\..\include\common\trc_printable_elem.h" />
<ClInclude Include="..\..\..\include\common\trc_ret_stack.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cache.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\ete_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_cmp_cfg_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_dcd_mngr_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_pkt_types_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\etmv3_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_cmp_cfg_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_dcd_mngr_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_decode_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_elem_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_proc_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_types_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\etmv4_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_cmp_cfg_etmv4.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_dcd_mngr_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_etmv4_stack_elem.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_decode_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4d.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_types_etmv4.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_abs_typed_base_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_data_rawframe_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_data_raw_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_error_log_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_gen_elem_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_pkt_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_src_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_instr_decode_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_raw_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_tgt_mem_access_i.h" />
<ClInclude Include="..\..\..\include\i_dec\trc_idec_arminst.h" />
<ClInclude Include="..\..\..\include\i_dec\trc_i_decode.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_base.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_bufptr.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb_if.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_file.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_mapper.h" />
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_types.h" />
<ClInclude Include="..\..\..\include\opencsd.h" />
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_version.h" />
<ClInclude Include="..\..\..\include\pkt_printers\gen_elem_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\item_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\pkt_printer_t.h" />
<ClInclude Include="..\..\..\include\pkt_printers\raw_frame_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\trc_pkt_printers.h" />
<ClInclude Include="..\..\..\include\pkt_printers\trc_print_fact.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\ptm_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_cmp_cfg_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_dcd_mngr_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_decode_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_elem_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_proc_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_types_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\stm_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_cmp_cfg_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_dcd_mngr_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_decode_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_elem_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_proc_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_types_stm.h" />
<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\trc_frame_deformatter_impl.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\ete\trc_cmp_cfg_ete.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_cmp_cfg_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_decode_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_elem_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.cpp" />
<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_etmv4i.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" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_bufptr.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cache.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cb.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_file.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_mapper.cpp" />
<ClCompile Include="..\..\..\source\ocsd_code_follower.cpp" />
<ClCompile Include="..\..\..\source\ocsd_dcd_tree.cpp" />
<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" />
<ClCompile Include="..\..\..\source\pkt_printers\raw_frame_printer.cpp" />
<ClCompile Include="..\..\..\source\pkt_printers\trc_print_fact.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_cmp_cfg_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_decode_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_elem_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_proc_ptm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_decode_stm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_elem_stm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_proc_stm.cpp" />
<ClCompile Include="..\..\..\source\trc_component.cpp" />
<ClCompile Include="..\..\..\source\trc_core_arch_map.cpp" />
<ClCompile Include="..\..\..\source\trc_frame_deformatter.cpp" />
<ClCompile Include="..\..\..\source\trc_gen_elem.cpp" />
<ClCompile Include="..\..\..\source\trc_printable_elem.cpp" />
<ClCompile Include="..\..\..\source\trc_ret_stack.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,515 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="interfaces">
<UniqueIdentifier>{80012968-9f0d-4623-901a-c2fa5f1c0890}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\etmv3">
<UniqueIdentifier>{98cd2a71-b44f-4884-bb8a-56c851cc8321}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\etmv4">
<UniqueIdentifier>{dd155712-7990-4cdd-b9b0-299d97f625e4}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\ptm">
<UniqueIdentifier>{9ec501e2-9ba4-4bad-a3d3-cdb604cc38b4}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\mem_acc">
<UniqueIdentifier>{23a35c62-e38f-43f6-a03b-6f1287478a69}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\i_dec">
<UniqueIdentifier>{f550018a-8974-4f8b-975a-bd8b86ae418f}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\stm">
<UniqueIdentifier>{2c796b59-81f6-49c9-88cf-e90ed2e741a3}</UniqueIdentifier>
</Filter>
<Filter Include="docs-files">
<UniqueIdentifier>{5ea7e02d-0667-4d2d-8c3d-039daf112edc}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\ptm">
<UniqueIdentifier>{2aa8a97b-13da-4bd1-bdb5-02f3e1cf030b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\etmv4">
<UniqueIdentifier>{ff9157b6-ef07-41e4-8ff4-322c50ea6665}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\etmv3">
<UniqueIdentifier>{0c2ba881-cc82-4567-ab59-d2363b4c3d1b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\stm">
<UniqueIdentifier>{73a56760-b7ff-4d56-88f0-13249201081c}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\i_dec">
<UniqueIdentifier>{cb3682ee-abbd-44c3-a175-4522d76e2d68}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\mem_acc">
<UniqueIdentifier>{eb9beab1-99c6-4eaa-88c0-893b05b2e673}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\common">
<UniqueIdentifier>{58d2398e-efdd-45d9-b7be-fc6096f3bec2}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\pkt_printers">
<UniqueIdentifier>{0e6e1f5d-465e-4f91-88a3-479952bbd316}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\pkt_printers">
<UniqueIdentifier>{baf047d0-0ff7-4502-b42b-4f1fda94d54b}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\ete">
<UniqueIdentifier>{3d119e90-c89b-4f27-8163-305924453e1f}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\ete">
<UniqueIdentifier>{8cfdb19c-28fc-4e79-b8d5-4e54907b1f82}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\..\LICENSE">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\README.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\TODO">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\build_libs.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\test_progs.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\HOWTO.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\external_custom.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\man\trc_pkt_lister.1">
<Filter>docs-files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\source\trc_frame_deformatter_impl.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_tgt_mem_access_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_raw_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_instr_decode_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_src_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_pkt_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_gen_elem_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_error_log_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_data_raw_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_data_rawframe_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\etmv3_decoder.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_elem_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_cmp_cfg_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_proc_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_types_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_types_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4d.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_cmp_cfg_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\etmv4_decoder.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_elem_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_cmp_cfg_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_types_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_proc_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\ptm_decoder.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_base.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_file.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_bufptr.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_mapper.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\i_dec\trc_idec_arminst.h">
<Filter>Header Files\i_dec</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\i_dec\trc_i_decode.h">
<Filter>Header Files\i_dec</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_decode_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\stm_decoder.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_elem_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_cmp_cfg_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_proc_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_types_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_decode_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb_if.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_decode_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.h">
<Filter>Source Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\comp_attach_notifier_i.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\comp_attach_pt_t.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_error.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_error_logger.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_msg_logger.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_version.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_component.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_core_arch_map.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_frame_deformatter.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_gen_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_decode_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_proc_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_printable_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_pe_context.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_code_follower.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_list.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_cs_config.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr_i.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_lib_dcd_register.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_abs_typed_base_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_dcd_mngr_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_dcd_mngr_etmv3.h">
<Filter>Source Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_dcd_mngr_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_dcd_mngr_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_elem_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_decode_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\gen_elem_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\item_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\pkt_printer_t.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\raw_frame_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\trc_pkt_printers.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\trc_print_fact.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_ret_stack.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_etmv4_stack_elem.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\trc_gen_elem_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\trc_pkt_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cache.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<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>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_pkt_types_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_cmp_cfg_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_dcd_mngr_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\ete_decoder.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\trc_component.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_frame_deformatter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_core_arch_map.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_printable_elem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_gen_elem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_decode_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_elem_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_proc_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_elem_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_decode_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_elem_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_decode_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_cmp_cfg_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_cmp_cfg_etmv4.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_cmp_cfg_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_proc_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_elem_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\i_dec\trc_i_decode.cpp">
<Filter>Source Files\i_dec</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\i_dec\trc_idec_arminst.cpp">
<Filter>Source Files\i_dec</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_base.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_mapper.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_bufptr.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cb.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_file.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_dcd_tree.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_error.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_error_logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_msg_logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_version.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_code_follower.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_gen_elem_list.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_lib_dcd_register.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_decode_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\pkt_printers\raw_frame_printer.cpp">
<Filter>Source Files\pkt_printers</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\pkt_printers\trc_print_fact.cpp">
<Filter>Source Files\pkt_printers</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_ret_stack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_etmv4_stack_elem.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<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>
<ClCompile Include="..\..\..\source\ete\trc_cmp_cfg_ete.cpp">
<Filter>Source Files\ete</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<LIB_BASE_NAME>opencsd</LIB_BASE_NAME>
<LIB_CAPI_NAME>opencsd_c_api</LIB_CAPI_NAME>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="LIB_BASE_NAME">
<Value>$(LIB_BASE_NAME)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="LIB_CAPI_NAME">
<Value>$(LIB_CAPI_NAME)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win32\dbg\libopencsd_c_api.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win32\rel\libopencsd_c_api.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win32\rel\opencsd_c_api.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,327 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-dll|Win32">
<Configuration>Debug-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-dll|x64">
<Configuration>Debug-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|Win32">
<Configuration>Release-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|x64">
<Configuration>Release-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{533F929A-A73B-46B6-9D5F-FFCD62F734E3}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>rctdl_c_api_lib</RootNamespace>
<ProjectName>ocsd_c_api_lib</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<BasicRuntimeChecks />
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_OCSD_C_API_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_OCSD_C_API_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_OCSD_C_API_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_OCSD_C_API_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_custom.h" />
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_cust_fact.h" />
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_cust_impl.h" />
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_types.h" />
<ClInclude Include="..\..\..\include\opencsd\c_api\opencsd_c_api.h" />
<ClInclude Include="..\..\..\source\c_api\ocsd_c_api_custom_obj.h" />
<ClInclude Include="..\..\..\source\c_api\ocsd_c_api_obj.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ref_trace_decode_lib\ref_trace_decode_lib.vcxproj">
<Project>{7f500891-cc76-405f-933f-f682bc39f923}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\c_api\ocsd_c_api.cpp" />
<ClCompile Include="..\..\..\source\c_api\ocsd_c_api_custom_obj.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\c_api\opencsd_c_api.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\c_api\ocsd_c_api_obj.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_custom.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\c_api\ocsd_c_api_custom_obj.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_cust_fact.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_cust_impl.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\c_api\ocsd_c_api.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\c_api\ocsd_c_api_custom_obj.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win64\dbg\libopencsd_c_api.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win64\rel\libopencsd_c_api.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win32\dbg\libopencsd.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,166 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32929.387
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opencsd_lib", "ref_trace_decode_lib.vcxproj", "{7F500891-CC76-405F-933F-F682BC39F923}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ocsd_c_api_lib", "..\rctdl_c_api_lib\rctdl_c_api_lib.vcxproj", "{533F929A-A73B-46B6-9D5F-FFCD62F734E3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c_api_pkt_print_test", "..\..\..\tests\build\win-vs2022\c_api_pkt_print_test\c_api_pkt_print_test.vcxproj", "{3AC169DA-E156-4D16-95DF-73D7302A5606}"
ProjectSection(ProjectDependencies) = postProject
{46219A32-8178-41C1-B3B1-B5A6E547515F} = {46219A32-8178-41C1-B3B1-B5A6E547515F}
{533F929A-A73B-46B6-9D5F-FFCD62F734E3} = {533F929A-A73B-46B6-9D5F-FFCD62F734E3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ext_dcd_echo_test", "..\..\..\tests\build\win-vs2022\ext_dcd_echo_test\ext_dcd_echo_test.vcxproj", "{46219A32-8178-41C1-B3B1-B5A6E547515F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mem-buffer-eg", "..\..\..\tests\build\win-vs2022\mem-buffer-eg\mem-buffer-eg.vcxproj", "{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}"
ProjectSection(ProjectDependencies) = postProject
{7F500891-CC76-405F-933F-F682BC39F923} = {7F500891-CC76-405F-933F-F682BC39F923}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "snapshot_parser_lib", "..\..\..\tests\build\win-vs2022\snapshot_parser_lib\snapshot_parser_lib.vcxproj", "{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "trc_pkt_lister", "..\..\..\tests\build\win-vs2022\trc_pkt_lister\trc_pkt_lister.vcxproj", "{18ABC652-AB11-4993-9491-1A7FB7117339}"
ProjectSection(ProjectDependencies) = postProject
{7F500891-CC76-405F-933F-F682BC39F923} = {7F500891-CC76-405F-933F-F682BC39F923}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "frame_demux_test", "..\..\..\tests\build\win-vs2022\frame_demux_test\frame_demux_test.vcxproj", "{98EE9884-A4EB-4C75-A911-DFEDF992754F}"
ProjectSection(ProjectDependencies) = postProject
{7F500891-CC76-405F-933F-F682BC39F923} = {7F500891-CC76-405F-933F-F682BC39F923}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Debug-dll|Win32 = Debug-dll|Win32
Debug-dll|x64 = Debug-dll|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Release-dll|Win32 = Release-dll|Win32
Release-dll|x64 = Release-dll|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7F500891-CC76-405F-933F-F682BC39F923}.Debug|Win32.ActiveCfg = Debug|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Debug|Win32.Build.0 = Debug|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Debug|x64.ActiveCfg = Debug|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Debug|x64.Build.0 = Debug|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Debug-dll|Win32.Build.0 = Debug|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Debug-dll|x64.ActiveCfg = Debug|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Debug-dll|x64.Build.0 = Debug|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Release|Win32.ActiveCfg = Release|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Release|Win32.Build.0 = Release|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Release|x64.ActiveCfg = Release|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Release|x64.Build.0 = Release|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Release-dll|Win32.ActiveCfg = Release|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Release-dll|Win32.Build.0 = Release|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Release-dll|x64.ActiveCfg = Release|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Release-dll|x64.Build.0 = Release|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug|Win32.ActiveCfg = Debug|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug|Win32.Build.0 = Debug|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug|x64.ActiveCfg = Debug|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug|x64.Build.0 = Debug|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug-dll|Win32.ActiveCfg = Debug-dll|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug-dll|Win32.Build.0 = Debug-dll|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug-dll|x64.ActiveCfg = Debug-dll|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug-dll|x64.Build.0 = Debug-dll|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release|Win32.ActiveCfg = Release|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release|Win32.Build.0 = Release|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release|x64.ActiveCfg = Release|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release|x64.Build.0 = Release|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release-dll|Win32.ActiveCfg = Release-dll|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release-dll|Win32.Build.0 = Release-dll|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release-dll|x64.ActiveCfg = Release-dll|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release-dll|x64.Build.0 = Release-dll|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug|Win32.ActiveCfg = Debug|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug|Win32.Build.0 = Debug|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug|x64.ActiveCfg = Debug|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug|x64.Build.0 = Debug|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug-dll|Win32.ActiveCfg = debug-dll|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug-dll|Win32.Build.0 = debug-dll|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug-dll|x64.ActiveCfg = debug-dll|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug-dll|x64.Build.0 = debug-dll|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release|Win32.ActiveCfg = Release|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release|Win32.Build.0 = Release|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release|x64.ActiveCfg = Release|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release|x64.Build.0 = Release|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release-dll|Win32.ActiveCfg = Release-dll|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release-dll|Win32.Build.0 = Release-dll|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release-dll|x64.ActiveCfg = Release-dll|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release-dll|x64.Build.0 = Release-dll|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug|Win32.ActiveCfg = Debug|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug|Win32.Build.0 = Debug|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug|x64.ActiveCfg = Debug|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug|x64.Build.0 = Debug|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug-dll|Win32.Build.0 = Debug|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug-dll|x64.ActiveCfg = Debug|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug-dll|x64.Build.0 = Debug|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release|Win32.ActiveCfg = Release|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release|Win32.Build.0 = Release|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release|x64.ActiveCfg = Release|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release|x64.Build.0 = Release|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release-dll|Win32.ActiveCfg = Release|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release-dll|Win32.Build.0 = Release|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release-dll|x64.ActiveCfg = Release|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release-dll|x64.Build.0 = Release|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug|Win32.ActiveCfg = Debug|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug|Win32.Build.0 = Debug|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug|x64.ActiveCfg = Debug|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug|x64.Build.0 = Debug|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug-dll|x64.ActiveCfg = Debug|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release|Win32.ActiveCfg = Release|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release|Win32.Build.0 = Release|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release|x64.ActiveCfg = Release|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release|x64.Build.0 = Release|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release-dll|Win32.ActiveCfg = Release|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release-dll|x64.ActiveCfg = Release|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug|Win32.ActiveCfg = Debug|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug|Win32.Build.0 = Debug|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug|x64.ActiveCfg = Debug|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug|x64.Build.0 = Debug|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug-dll|x64.ActiveCfg = Debug|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release|Win32.ActiveCfg = Release|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release|Win32.Build.0 = Release|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release|x64.ActiveCfg = Release|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release|x64.Build.0 = Release|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release-dll|Win32.ActiveCfg = Release|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release-dll|x64.ActiveCfg = Release|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug|Win32.ActiveCfg = Debug|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug|Win32.Build.0 = Debug|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug|x64.ActiveCfg = Debug|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug|x64.Build.0 = Debug|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug-dll|x64.ActiveCfg = Debug|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release|Win32.ActiveCfg = Release|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release|Win32.Build.0 = Release|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release|x64.ActiveCfg = Release|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release|x64.Build.0 = Release|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release-dll|Win32.ActiveCfg = Release|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release-dll|x64.ActiveCfg = Release|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug|Win32.ActiveCfg = Debug|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug|Win32.Build.0 = Debug|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug|x64.ActiveCfg = Debug|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug|x64.Build.0 = Debug|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug-dll|x64.ActiveCfg = Debug|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release|Win32.ActiveCfg = Release|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release|Win32.Build.0 = Release|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release|x64.ActiveCfg = Release|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release|x64.Build.0 = Release|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release-dll|Win32.ActiveCfg = Release|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release-dll|x64.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8A5D77A4-7683-4395-84D4-9A22BD625E52}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,462 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-dll|Win32">
<Configuration>Debug-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-dll|x64">
<Configuration>Debug-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|Win32">
<Configuration>Release-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|x64">
<Configuration>Release-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7F500891-CC76-405F-933F-F682BC39F923}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ref_trace_decode_lib</RootNamespace>
<ProjectName>opencsd_lib</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
<EnableASAN>true</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="..\..\..\..\HOWTO.md" />
<None Include="..\..\..\..\LICENSE" />
<None Include="..\..\..\..\README.md" />
<None Include="..\..\..\..\TODO" />
<None Include="..\..\..\docs\build_libs.md" />
<None Include="..\..\..\docs\external_custom.md" />
<None Include="..\..\..\docs\man\trc_pkt_lister.1" />
<None Include="..\..\..\docs\test_progs.md" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\common\comp_attach_notifier_i.h" />
<ClInclude Include="..\..\..\include\common\comp_attach_pt_t.h" />
<ClInclude Include="..\..\..\include\common\ocsd_code_follower.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr_i.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree_elem.h" />
<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" />
<ClInclude Include="..\..\..\include\common\ocsd_version.h" />
<ClInclude Include="..\..\..\include\common\trc_component.h" />
<ClInclude Include="..\..\..\include\common\trc_core_arch_map.h" />
<ClInclude Include="..\..\..\include\common\trc_cs_config.h" />
<ClInclude Include="..\..\..\include\common\trc_frame_deformatter.h" />
<ClInclude Include="..\..\..\include\common\trc_gen_elem.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_decode_base.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_elem_base.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_proc_base.h" />
<ClInclude Include="..\..\..\include\common\trc_printable_elem.h" />
<ClInclude Include="..\..\..\include\common\trc_ret_stack.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cache.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\ete_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_cmp_cfg_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_dcd_mngr_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_pkt_types_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\etmv3_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_cmp_cfg_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_dcd_mngr_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_decode_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_elem_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_proc_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_types_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\etmv4_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_cmp_cfg_etmv4.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_dcd_mngr_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_etmv4_stack_elem.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_decode_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4d.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_types_etmv4.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_abs_typed_base_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_data_rawframe_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_data_raw_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_error_log_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_gen_elem_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_pkt_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_src_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_instr_decode_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_raw_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_tgt_mem_access_i.h" />
<ClInclude Include="..\..\..\include\i_dec\trc_idec_arminst.h" />
<ClInclude Include="..\..\..\include\i_dec\trc_i_decode.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_base.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_bufptr.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb_if.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_file.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_mapper.h" />
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_types.h" />
<ClInclude Include="..\..\..\include\opencsd.h" />
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_version.h" />
<ClInclude Include="..\..\..\include\pkt_printers\gen_elem_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\item_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\pkt_printer_t.h" />
<ClInclude Include="..\..\..\include\pkt_printers\raw_frame_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\trc_pkt_printers.h" />
<ClInclude Include="..\..\..\include\pkt_printers\trc_print_fact.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\ptm_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_cmp_cfg_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_dcd_mngr_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_decode_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_elem_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_proc_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_types_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\stm_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_cmp_cfg_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_dcd_mngr_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_decode_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_elem_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_proc_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_types_stm.h" />
<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\trc_frame_deformatter_impl.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\ete\trc_cmp_cfg_ete.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_cmp_cfg_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_decode_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_elem_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.cpp" />
<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_etmv4i.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" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_bufptr.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cache.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cb.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_file.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_mapper.cpp" />
<ClCompile Include="..\..\..\source\ocsd_code_follower.cpp" />
<ClCompile Include="..\..\..\source\ocsd_dcd_tree.cpp" />
<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" />
<ClCompile Include="..\..\..\source\pkt_printers\raw_frame_printer.cpp" />
<ClCompile Include="..\..\..\source\pkt_printers\trc_print_fact.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_cmp_cfg_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_decode_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_elem_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_proc_ptm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_decode_stm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_elem_stm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_proc_stm.cpp" />
<ClCompile Include="..\..\..\source\trc_component.cpp" />
<ClCompile Include="..\..\..\source\trc_core_arch_map.cpp" />
<ClCompile Include="..\..\..\source\trc_frame_deformatter.cpp" />
<ClCompile Include="..\..\..\source\trc_gen_elem.cpp" />
<ClCompile Include="..\..\..\source\trc_printable_elem.cpp" />
<ClCompile Include="..\..\..\source\trc_ret_stack.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,515 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="interfaces">
<UniqueIdentifier>{80012968-9f0d-4623-901a-c2fa5f1c0890}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\etmv3">
<UniqueIdentifier>{98cd2a71-b44f-4884-bb8a-56c851cc8321}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\etmv4">
<UniqueIdentifier>{dd155712-7990-4cdd-b9b0-299d97f625e4}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\ptm">
<UniqueIdentifier>{9ec501e2-9ba4-4bad-a3d3-cdb604cc38b4}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\mem_acc">
<UniqueIdentifier>{23a35c62-e38f-43f6-a03b-6f1287478a69}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\i_dec">
<UniqueIdentifier>{f550018a-8974-4f8b-975a-bd8b86ae418f}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\stm">
<UniqueIdentifier>{2c796b59-81f6-49c9-88cf-e90ed2e741a3}</UniqueIdentifier>
</Filter>
<Filter Include="docs-files">
<UniqueIdentifier>{5ea7e02d-0667-4d2d-8c3d-039daf112edc}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\ptm">
<UniqueIdentifier>{2aa8a97b-13da-4bd1-bdb5-02f3e1cf030b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\etmv4">
<UniqueIdentifier>{ff9157b6-ef07-41e4-8ff4-322c50ea6665}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\etmv3">
<UniqueIdentifier>{0c2ba881-cc82-4567-ab59-d2363b4c3d1b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\stm">
<UniqueIdentifier>{73a56760-b7ff-4d56-88f0-13249201081c}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\i_dec">
<UniqueIdentifier>{cb3682ee-abbd-44c3-a175-4522d76e2d68}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\mem_acc">
<UniqueIdentifier>{eb9beab1-99c6-4eaa-88c0-893b05b2e673}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\common">
<UniqueIdentifier>{58d2398e-efdd-45d9-b7be-fc6096f3bec2}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\pkt_printers">
<UniqueIdentifier>{0e6e1f5d-465e-4f91-88a3-479952bbd316}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\pkt_printers">
<UniqueIdentifier>{baf047d0-0ff7-4502-b42b-4f1fda94d54b}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\ete">
<UniqueIdentifier>{3d119e90-c89b-4f27-8163-305924453e1f}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\ete">
<UniqueIdentifier>{8cfdb19c-28fc-4e79-b8d5-4e54907b1f82}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\..\LICENSE">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\README.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\TODO">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\build_libs.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\test_progs.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\HOWTO.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\external_custom.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\man\trc_pkt_lister.1">
<Filter>docs-files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\source\trc_frame_deformatter_impl.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_tgt_mem_access_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_raw_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_instr_decode_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_src_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_pkt_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_gen_elem_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_error_log_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_data_raw_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_data_rawframe_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\etmv3_decoder.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_elem_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_cmp_cfg_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_proc_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_types_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_types_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4d.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_cmp_cfg_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\etmv4_decoder.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_elem_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_cmp_cfg_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_types_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_proc_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\ptm_decoder.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_base.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_file.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_bufptr.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_mapper.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\i_dec\trc_idec_arminst.h">
<Filter>Header Files\i_dec</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\i_dec\trc_i_decode.h">
<Filter>Header Files\i_dec</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_decode_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\stm_decoder.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_elem_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_cmp_cfg_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_proc_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_types_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_decode_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb_if.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_decode_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.h">
<Filter>Source Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\comp_attach_notifier_i.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\comp_attach_pt_t.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_error.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_error_logger.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_msg_logger.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_version.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_component.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_core_arch_map.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_frame_deformatter.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_gen_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_decode_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_proc_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_printable_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_pe_context.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_code_follower.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_list.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_cs_config.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr_i.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_lib_dcd_register.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_abs_typed_base_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_dcd_mngr_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_dcd_mngr_etmv3.h">
<Filter>Source Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_dcd_mngr_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_dcd_mngr_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_elem_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_decode_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\gen_elem_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\item_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\pkt_printer_t.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\raw_frame_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\trc_pkt_printers.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\trc_print_fact.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_ret_stack.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_etmv4_stack_elem.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\trc_gen_elem_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\trc_pkt_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cache.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<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>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_pkt_types_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_cmp_cfg_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_dcd_mngr_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\ete_decoder.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\trc_component.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_frame_deformatter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_core_arch_map.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_printable_elem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_gen_elem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_decode_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_elem_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_proc_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_elem_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_decode_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_elem_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_decode_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_cmp_cfg_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_cmp_cfg_etmv4.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_cmp_cfg_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_proc_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_elem_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\i_dec\trc_i_decode.cpp">
<Filter>Source Files\i_dec</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\i_dec\trc_idec_arminst.cpp">
<Filter>Source Files\i_dec</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_base.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_mapper.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_bufptr.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cb.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_file.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_dcd_tree.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_error.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_error_logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_msg_logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_version.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_code_follower.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_gen_elem_list.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_lib_dcd_register.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_decode_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\pkt_printers\raw_frame_printer.cpp">
<Filter>Source Files\pkt_printers</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\pkt_printers\trc_print_fact.cpp">
<Filter>Source Files\pkt_printers</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_ret_stack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_etmv4_stack_elem.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<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>
<ClCompile Include="..\..\..\source\ete\trc_cmp_cfg_ete.cpp">
<Filter>Source Files\ete</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

174
decoder/docs/build_libs.md Normal file
View File

@ -0,0 +1,174 @@
Building and using the Library {#build_lib}
==============================
@brief How to build the library and test programs and include the library in an application
Platform Support
----------------
The current makefiles and build projects support building the library on:
- Linux and Windows, x86 or x64 hosts.
- ARM linux - AArch32 and AArch64
- ARM aarch32 and aarch64 libs, x-compiled on x86/64 hosts.
In addition to building the library from the project, the library may be installed into the standard
`/usr/lib/` area in Linux, and will soon be available as a package from Linux Distros.
Building the Library
--------------------
The library and test programs are built from the library `./build/<platform>` directory, where
<platform> is either 'linux' or 'win-vs2015' / 'win-vs2022'
See [`./docs/test_progs.md`](@ref test_progs) for further information on use of the test
programs.
### Linux x86/x64/ARM ###
Libraries are built into a <tgt_dir>. This is used as the final output directory for the
libraries in `decoder/lib/<tgt_dir>`, and also as a sub-directory of the build process for
intermediate files - `decoder/build/linux/ref_trace_decode_lib/<tgt_dir>`.
For a standard build, go to the `./build/linux/` and run `make` in that directory.
This will set <tgt_dir> to `builddir` for all build variants of the library. Using this only one variant of the library can be built at any one time.
For development, alternatively use `make -f makefile.dev`
This will set <tgt_dir> to `linux<bit-variant>/<dbg|rel>` and therefore build libraries into the
`decoder/lib/linux<bit-variant>/<dbg|rel>` directories, allowing multiple variants of the library
to be present during development.
e.g.
`./lib/linux64/rel` will contain the linux 64 bit release libraries.
`./lib/linux-arm64/dbg` will contain the linux aarch 64 debug libraries for ARM.
Options to pass to both makefiles are:-
- `DEBUG=1` : build the debug version of the library.
Options to pass to makefile.dev are:-
- ARCH=<arch> : sets the bit variant in the delivery directories. Set if cross compilation for ARCH
other than host. Otherwise ARCH is auto-detected.
<arch> can be x86, x86_64, arm, arm64, aarch64, aarch32
For cross compilation, set the environment variable `CROSS_COMPILE` to the name path/prefix for the
compiler to use. The following would set the environment to cross-compile for ARM
export PATH=$PATH:~/work/gcc-x-aarch64-6.2/bin
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
The makefile will scan the `ocsd_if_version.h` to get the library version numbers and use these
in the form Major.minor.patch when naming the output .so files.
Main C++ library names:
- `libcstraced.so.M.m.p` : shared library containing the main C++ based decoder library
- `libcstrace.so.M` : symbolic link name to library - major version only.
- `libcstrace.so` : symbolic link name to library - no version.
C API wrapper library names:
- `libcstraced_c_api.so.M.m.p` : shared library containing the C-API wrapper library. Dependent on `libcstraced.so.M`
- `libcstraced_c_api.so.M` : symbolic link name to library - major version only.
- `libcstraced_c_api.so` : symbolic link name to library - no version.
Static versions of the libraries:
- `libcstraced.a` : static library containing the main C++ based decoder library.
- `libcstraced_c_api.a` : static library containing the C-API wrapper library.
Test programs are delivered to the `./tests/bin/<tgt_dir>` directories.
The test programs are built to used the .so versions of the libraries.
- `trc_pkt_lister` - dependent on `libcstraced.so`.
- `simple_pkt_print_c_api` - dependent on `libcstraced_c_api.so` & hence `libcstraced.so`.
The test program build for `trc_pkt_lister` also builds an auxiliary library used by this program for test purposes only.
This is the `libsnapshot_parser.a` library, delivered to the `./tests/lib/<tgt_dir>` directories.
**Note on Linux Build Directory Names**
Due to tool limitations, the makefiles will not operate correctly if the path to the opencsd directories contains spaces.
e.g. checking out the project into a directory such as ` /home/name/my opencsd/` will result in build failures.
__Installing on Linux__
The libraries can be installed on linux using the `make install` command. This will usually require root privileges. Installation will be the version in the `./lib/<tgt_dir>` directory, according to options chosen.
e.g. ` make -f makefile.dev DEBUG=1 install`
will install from `./lib/linux64/dbg`
The libraries `libopencsd` and `libopencsd_c_api` are installed to `/usr/lib`.
Sufficient header files to build using the C-API library will be installed to `/usr/include/opencsd`.
The installation can be removed using `make clean_install`. No additional options are necessary.
### Windows (x86/x64) ###
Use the `.\build\win\ref_trace_decode_lib\ref_trace_decode_lib.sln` file to load a solution
which contains all library and test build projects.
Libraries are delivered to the `./lib/win<bitsize>/<dbg\rel>` directories.
e.g. `./lib/win64/rel` will contain the windows 64 bit release libraries.
The solution contains four configurations:-
- *Debug* : builds debug versions of static C++ main library and C-API libraries, test programs linked to the static library.
- *Debug-dll* : builds debug versions of static main library and C-API DLL. C-API statically linked to the main library.
C-API test built as `simple_pkt_print_c_api-dl.exe` and linked against the DLL version of the C-API library.
- *Release* : builds release static library versions, test programs linked to static libraries.
- *Release-dll* : builds release C-API DLL, static main library.
_Note_: Currently there is no Windows DLL version of the main C++ library. This may follow once
the project is nearer completion with further decode protocols, and the classes requiring export are established..
Libraries built are:-
- `libcstraced.lib` : static main C++ decoder library.
- `cstraced_c_api.dll` : C-API DLL library. Statically linked against `libcstraced.lib` at .DLL build time.
- `libcstraced_c_api.lib` : C-API static library.
There is also a project file to build an auxiliary library used `trc_pkt_lister` for test purposes only.
This is the `snapshot_parser_lib.lib` library, delivered to the `./tests/lib/win<bitsize>/<dgb\rel>` directories.
### Additional Build Options ###
__Library Virtual Address Size__
The ocsd_if_types.h file includes a #define that controls the size of the virtual addresses
used within the library. By default this is a 64 bit `uint64_t` value.
When building for ARM architectures that have only a 32 bit Virtual Address, and building on
32 bit ARM architectures it may be desirable to build a library that uses a v-addr size of
32 bits. Define `USE_32BIT_V_ADDR` to enable this option
Including the Library in an Application
---------------------------------------
The user source code includes a header according to the API to be used:-
- Main C++ decoder library - include `opencsd.h`. Link to C++ library.
- C-API library - include `opencsd_c_api.h`. Link to C-API library.
### Linux build ###
By default linux builds will link against the .so versions of the library. Using the C-API library will also
introduce a dependency on the main C++ decoder .so. Ensure that the library paths and link commands are part of the
application makefile.
To use the static versions use appropriate linker options.
### Windows build ###
To link against the C-API DLL, include the .DLL name as a dependency in the application project options.
To link against the C-API static library, include the library name in the dependency list, and define the macro
`OCSD_USE_STATIC_C_API` in the preprocessor definitions. This ensures that the correct static bindings are declared in
the header file. Also link against the main C++ library.
To link against the main C++ library include the library name in the dependency list.

View File

@ -0,0 +1,127 @@
.\" Hey, EMACS: -*- nroff -*-
.TH TRC_PKT_LISTER 1 "2018-03-28"
.SH NAME
trc_pkt_lister \- decodes captured CoreSight\*R trace
.SH SYNOPSIS
.RI trc_pkt_lister
[ \-ss_dir \fI<dir>\fP ]
[ -ss_verbose ]
[ \-id \fI<n>\fP ]
[ \-src_name \fI<name>\fP ]
[ \-decode ]
[ \-decode_only ]
[ \-src_addr_n ]
[ \-o_raw_packed ]
[ \-o_raw_unpacked ]
[ \-logstdout ]
[ \-logstderr ]
[ \-logfile ]
[ \-logfilename \fI<name>\fP ]
.br
.SH DESCRIPTION
.B trc_pkt_lister
is a tool that takes a snapshot directory as an input, and lists and/or
decodes all the trace packets for a single source, for any currently
supported protocol.
.PP
The output will be a list of discrete packets, generic output packets
and any error messages to file and/or screen as selected by the input
command line options.
.PP
By default the program will list packets only (no decode), for the
first discovered trace sink (ETB, ETF, ETR) in the snapshot directory,
with all streams output.
.SH OPTIONS
.SS Snapshot selection
The program defaults to \./ if no \-ss_dir option is given
.TP
.B \-ss\_dir <dir>
Set the directory path to a trace snapshot.
.TP
\fB\fC\-ss\_verbose\fR
Verbose output when reading the snapshot.
.SS Decode options
.TP
.B \-id <n>
Set an ID to list (may be used multiple times) \- default if no id set is for all IDs to be printed.
.TP
.B \-src\_name <name>
List packets from a given snapshot source name (defaults to first source found).
.TP
.B \-decode
Full decode of the packets from the trace snapshot (default is to list undecoded packets only.
.TP
.B \-decode_only
Does not list the undecoded packets, just the trace decode.
.TP
.B \-src\_addr\_n
In ETE protocol, indicate skipped N atoms in source address packet ranges by breaking the decode
range into multiple ranges on N atoms.
.TP
.B \-o\_raw\_packed
Output raw packed trace frames.
.TP
.B \-o\_raw\_unpacked
Output raw unpacked trace data per ID.
.SS Output options
Default is to output to file and stdout. Setting any option overrides and limits to only
the options set.
.TP
.B \-logstdout
output to stdout.
.TP
.B \-logstderr
output to stderr.
.TP
.B \-logfile
output to file using the default log file name.
.TP
.B \-logfilename <name>
change the name of the output log file.
.SH FILES
.B Trace Snapshot directory.
.PP
The \fR./tests/snapshots\fP directory contains a number of trace
snapshots used for testing the library. Trace snapshots are dumps of
captured binary trace data, CoreSight component configurations and
memory dumps to allow trace decode.
.PP
Snapshots are generated on ARM targets and can then be analysed
offline. The snapshot format is available in a separate document.
.SH EXAMPLE
Example command lines with short output excerpts.
.PP
.BI TC2 " ETMv3 packet processor output, raw packet output."
.br
Command line:
.br
.RI "trc\_pkt\_lister -ss\_dir ../../snapshots/TC2 -o_raw_unpacked"
.PP
Output:
.br
Frame Data; Index 17958; ID_DATA[0x11]; 16 04 c0 86 42 97 e1 c4
.br
Idx:17945; ID:11; I_SYNC : Instruction Packet synchronisation.; (Periodic); Addr=0xc00
416e2; S; ISA=Thumb2;
.br
Idx:17961; ID:11; P_HDR : Atom P-header.; WEN; Cycles=1
.br
Frame Data; Index 17968; ID_DATA[0x11]; ce af 90 80 80 00 a4 84 a0 84 a4 88
.br
Idx:17962; ID:11; TIMESTAMP : Timestamp Value.; TS=0x82f9d13097 (562536984727)
.br
Idx:17974; ID:11; P_HDR : Atom P-header.; WW; Cycles=2
.PP
.BI Juno " ETB\_1 selected for STM packet output, raw packet output"
.br
Command line:
.br
.RI "trc\_pkt\_lister -ss\_dir ../../snapshots/juno_r1_1 -o\_raw\_unpacked -src\_name ETB\_1"
.PP
.BI Juno " ETMv4 full trace decode + packet monitor, source trace ID 0x10 only."
.br
Command line:
.br
.RI "trc\_pkt\_lister -ss\_dir ../../snapshots/juno\_r1\_1 -decode -id 0x10"

View File

@ -0,0 +1,469 @@
OpenCSD Library - Generic Trace Packet Descriptions {#generic_pkts}
===================================================
@brief Interpretation of the Generic Trace output packets.
Generic Trace Packets - Collection.
-----------------------------------
### Packet interface ###
The generic trace packets are the fully decoded output from the trace library.
These are delivered to the client application in the form of a callback function. Packets from all trace sources
will use the same single callback function, with the CoreSight Trace ID provided to identify the source.
The callback is in the form of an interface class ITrcGenElemIn, which has a single function:
~~~{.cpp}
virtual ocsd_datapath_resp_t TraceElemIn( const ocsd_trc_index_t index_sop,
const uint8_t trc_chan_id,
const OcsdTraceElement &elem
) = 0;
~~~
The client program will create derived class providing this interface to collect trace packets from the library.
The parameters describe the output packet and source channel:
|Parameter | Description |
|:--------------------------------|:------------------------------------------------------------------------|
| `ocsd_trc_index_t index_sop` | Index of the first byte of the trace packet that generated this output. |
| `uint8_t trc_chan_id` | The source CoreSight Trace ID. |
| `OcsdTraceElement &elem` | The packet class - wraps the `ocsd_generic_trace_elem` structure. |
_Note_ : `index_sop` may be the same for multiple output packets. This is due to an one byte atom packet which
can represent multiple atoms and hence multiple ranges.
The C-API provides a similarly specified callback function definition, with an additional opaque `void *` pointer
that the client application may use.
~~~{.c}
/** function pointer type for decoder outputs. all protocols, generic data element input */
typedef ocsd_datapath_resp_t (* FnTraceElemIn)( const void *p_context,
const ocsd_trc_index_t index_sop,
const uint8_t trc_chan_id,
const ocsd_generic_trace_elem *elem);
~~~
### The Packet Structure ###
~~~{.c}
typedef struct _ocsd_generic_trace_elem {
ocsd_gen_trc_elem_t elem_type; /* Element type - remaining data interpreted according to this value */
ocsd_isa isa; /* instruction set for executed instructions */
ocsd_vaddr_t st_addr; /* start address for instruction execution range / inaccessible code address / data address */
ocsd_vaddr_t en_addr; /* end address (exclusive) for instruction execution range. */
ocsd_pe_context context; /* PE Context */
uint64_t timestamp; /* timestamp value for TS element type */
uint32_t cycle_count; /* cycle count for explicit cycle count element, or count for element with associated cycle count */
ocsd_instr_type last_i_type; /* Last instruction type if instruction execution range */
ocsd_instr_subtype last_i_subtype; /* sub type for last instruction in range */
//! per element flags
union {
struct {
uint32_t last_instr_exec:1; /* 1 if last instruction in range was executed; */
uint32_t last_instr_sz:3; /* size of last instruction in bytes (2/4) */
uint32_t has_cc:1; /* 1 if this packet has a valid cycle count included (e.g. cycle count included as part of instruction range packet, always 1 for pure cycle count packet.*/
uint32_t cpu_freq_change:1; /* 1 if this packet indicates a change in CPU frequency */
uint32_t excep_ret_addr:1; /* 1 if en_addr is the preferred exception return address on exception packet type */
uint32_t excep_data_marker:1; /* 1 if the exception entry packet is a data push marker only, with no address information (used typically in v7M trace for marking data pushed onto stack) */
uint32_t extended_data:1; /* 1 if the packet extended data pointer is valid. Allows packet extensions for custom decoders, or additional data payloads for data trace. */
uint32_t has_ts:1; /* 1 if the packet has an associated timestamp - e.g. SW/STM trace TS+Payload as a single packet */
uint32_t last_instr_cond:1; /* 1 if the last instruction was conditional */
uint32_t excep_ret_addr_br_tgt:1; /* 1 if exception return address (en_addr) is also the target of a taken branch addr from the previous range. */
};
uint32_t flag_bits;
};
//! packet specific payloads
union {
uint32_t exception_number; /* exception number for exception type packets */
trace_event_t trace_event; /* Trace event - trigger etc */
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. */
trace_marker_payload_t sync_marker; /* marker element - sync later element to position in stream */
trace_memtrans_t mem_trans; /* memory transaction packet - transaction event */
trace_sw_ite_t sw_ite; /* PE sw instrumentation using FEAT_ITE */
};
const void *ptr_extended_data; /* pointer to extended data buffer (data trace, sw trace payload) / custom structure */
} ocsd_generic_trace_elem;
~~~
The packet structure contains multiple fields and flag bits. The validity of any of these fields or flags
is dependent on the `elem_type` member. The client program must not assume that field values will persist
between packets, and must process all valid data during the callback function.
The packet reference guide below defines the fields valid for each packet type.
--------------------------------------------------------------------------------------------------
Generic Trace Packets - Packet Reference.
-----------------------------------------
This section contains reference descriptions of each of the generic trace packets types define as part of the
`ocsd_gen_trc_elem_t` enum value that appears as the first `elem_type` field in the packet structure.
The descriptions will include information on which fields in the packets are always valid, optional and any protocol specific information.
The tags used in the reference are:-
- __packet fields valid__ : fields that are always valid and filled for this packet type.
- __packet fields optional__ : fields that _may_ be filled for this packet type.
The form `flag -> field` indicates a flag that may be set and the value that is valid if the flag is true
- __protocol specific__ : indicates type or fields may be source protocol specific.
_Note_: while most of the packets are not protocol specific, there are some protocol differences that mean
certain types and fields will differ slightly across protocols. These differences are highlighted in the
reference.
### OCSD_GEN_TRC_ELEM_NO_SYNC ###
__packet fields valid__: None
Element output before the decoder has synchronised with the input stream, or synchronisation is lost.
### OCSD_GEN_TRC_ELEM_INSTR_RANGE ###
__packet fields valid__: `isa, st_addr, en_addr, last_i_type, last_i_subtype, last_instr_exec, last_instr_sz, num_instr_range, last_instr_cond`
__packet fields optional__: `has_cc -> cycle_count,`
__protocol specific__ : ETMv3, PTM
This should be the most common packet output for full trace decode. Represents a range of instructions of
a single `isa`, executed by the PE. Instruction byte range is from `st_addr` (inclusive) to `en_addr` (exclusive).
The total number of instructions executed for the range is given in `num_instr_range`.
Information on the last instruction in the range is provided. `last_i_type` shows if the last instruction
was a branch or otherwise - which combined with `last_instr_exec` determines if the branch was taken.
The last instruction size in bytes is given, to allow clients to quickly determine the address of the last
instruction by subtraction from `en_addr`. This value can be 2 or 4 bytes in the T32 instruction set.
__ETMv3, PTM__ : These protocols can output a cycle count directly as part of the trace packet that generates
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`
Trace decoder found address in trace that cannot be accessed in the mapped memory images.
`st_addr` is the address that cannot be found.
Decoder will wait for new address to appear in trace before attempting to restart decoding.
### OCSD_GEN_TRC_ELEM_UNKNOWN ###
__packet fields valid__: None
Decoder saw invalid packet for protocol being processed. Likely incorrect protocol settings, or corrupted
trace data.
### OCSD_GEN_TRC_ELEM_TRACE_ON ###
__packet fields valid__: trace_on_reason
__packet fields optional__: `has_cc -> cycle_count,`
__protocol specific__ : ETMv3, PTM
Notification that trace has started / is synced after a discontinuity or at start of trace decode.
__ETMv3, PTM__ : These protocols can output a cycle count directly as part of the trace packet that generates
the trace on indicator. In this case `has_cc` will be 1 and `cycle_count` will be valid.
### OCSD_GEN_TRC_ELEM_EO_TRACE ###
__packet fields valid__: None
Marker for end of trace data. Sent once for each CoreSight ID channel.
### OCSD_GEN_TRC_ELEM_PE_CONTEXT ###
__packet fields valid__: context
__packet fields optional__: `has_cc -> cycle_count,`
__protocol specific__ : ETMv3, PTM
This packet indicates an update to the PE context - which may be the initial context in a trace stream, or a
change since the trace started.
The context is contained in a `ocsd_pe_context` structure.
~~~{.c}
typedef struct _ocsd_pe_context {
ocsd_sec_level security_level; /* security state */
ocsd_ex_level exception_level; /* exception level */
uint32_t context_id; /* context ID */
uint32_t vmid; /* VMID */
struct {
uint32_t bits64:1; /* 1 if 64 bit operation */
uint32_t ctxt_id_valid:1; /* 1 if context ID value valid */
uint32_t vmid_valid:1; /* 1 if VMID value is valid */
uint32_t el_valid:1; /* 1 if EL value is valid (ETMv4 traces current EL, other protocols do not) */
};
} ocsd_pe_context;
~~~
__ETMv3, PTM__ : These protocols can output a cycle count directly as part of the trace packet that generates
the PE context. In this case `has_cc` will be 1 and `cycle_count` will be valid.
__ETMv3__ : From ETM 3.5 onwards, exception_level can be set to `ocsd_EL2` when tracing through hypervisor code.
On all other occasions this will be set to `ocsd_EL_unknown`.
### OCSD_GEN_TRC_ELEM_ADDR_UNKNOWN ###
__packet fields optional__: `has_cc -> cycle_count,`
__protocol specific__: ETMv3
This packet will only be seen when decoding an ETMv3 protocol source. This indicates that the decoder
is waiting for a valid address in order to process trace correctly.
The packet can have a cycle count associated with it which the client must account for when tracking cycles used.
The packet will be sent once when unknown address occurs. Further `OCSD_GEN_TRC_ELEM_CYCLE_COUNT` packets may follow
before the decode receives a valid address to continue decode.
### OCSD_GEN_TRC_ELEM_EXCEPTION ###
__packet fields valid__: `exception_number`
__packet fields optional__: `has_cc -> cycle_count, excep_ret_addr -> en_addr, excep_data_marker, excep_ret_addr_br_tgt`
__protocol specific__: ETMv4, ETMv3, PTM
All protocols will include the exception number in the packet.
__ETMv4__ : This protocol may provide the preferred return address for the exception - this is the address of
the instruction that could be executed on exception return. This address appears in `en_addr` if `excep_ret_addr` = 1.
Additionally, this address could also represent the target address of a branch, if the exception occured at the branch target, before any further instructions were execute. If htis is the case then the excep_ret_addr_br_tgt flag will be set. This makes explicit what was previously only implied by teh packet ordered. This information could be used for clients such as perf that branch source/target address pairs.
__ETMv3__ : This can set the `excep_data_marker` flag. This indicates that the exception packet is a marker
to indicate exception entry in a 7M profile core, for the purposes of tracking data. This will __not__ provide
an exception number in this case.
__PTM__ : Can have an associated cycle count (`has_cc == 1`), and may provide preferred return address in `en_addr`
if `excep_ret_addr` = 1.
### OCSD_GEN_TRC_ELEM_EXCEPTION_RET ###
__packet fields valid__: None
Marker that a preceding branch was an exception return.
### OCSD_GEN_TRC_ELEM_TIMESTAMP ###
__packet fields valid__: `timestamp`
__packet fields optional__: `has_cc -> cycle_count,`
__protocol specific__: ETMv4, PTM
The timestamp packet explicitly provides a timestamp value for the trace stream ID in the callback interface.
__PTM__ : This can have an associated cycle count (`has_cc == 1`). For this protocol, the cycle count __is__ part
of the cumulative cycle count for the trace session.
__ETMv4__ : This can have an associated cycle count (`has_cc == 1`). For this protocl, the cycle coun represents
the number of cycles between the previous cycle count packet and this timestamp packet, but __is not__ part of
the cumulative cycle count for the trace session.
### OCSD_GEN_TRC_ELEM_CYCLE_COUNT ###
__packet fields valid__: `has_cc -> cycle_count`
Packet contains a cycle count value. A cycle count value represents the number of cycles passed since the
last cycle count value seen. The cycle count value may be associated with a specific packet or instruction
range preceding the cycle count packet.
Cycle count packets may be added together to build a cumulative count for the trace session.
### OCSD_GEN_TRC_ELEM_EVENT ###
__packet fields valid__: `trace_event`
This is a hardware event injected into the trace by the ETM/PTM hardware resource programming. See the
relevent trace hardware reference manuals for the programming of these events.
The `trace_event` is a `trace_event_t` structure that can have an event type - and an event number.
~~~{.c}
typedef struct _trace_event_t {
uint16_t ev_type; /* event type - unknown (0) trigger (1), numbered event (2)*/
uint16_t ev_number; /* event number if numbered event type */
} trace_event_t;
~~~
The event types depend on the trace hardware:-
__ETMv4__ : produces numbered events. The event number is a bitfield of up to four events that occurred.
Events 0-3 -> bits 0-3. The bitfield allows a single packet to represent multiple different events occurring.
_Note_: The ETMv4 specification has further information on timing of events and event packets. Event 0
is also considered a trigger event in ETMv4 hardware, but is not explicitly represented as such in the OCSD protocol.
__PTM__, __ETMv3__ : produce trigger events. Event number always set to 0.
### OCSD_GEN_TRC_ELEM_SWTRACE ###
__packet fields valid__: `sw_trace_info`
__packet fields optional__: `has_ts -> timestamp`, ` extended_data -> ptr_extended_data`
The Software trace packet always has a filled in `sw_trace_info` field to describe the current master and channel ID,
plus the packet type and size of any payload data.
SW trace packets that have a payload will use the extended_data flag and pointer to deliver this data.
SW trace packets that include timestamp information will us the `has_ts` flag and fill in the timestamp value.
These packets are generated by memory writes to STM / ITM trace hardware.
### OCSD_GEN_TRC_ELEM_SYNC_MARKER ###
__packet fields valid__: `sync_marker`
Synchronisation marker - marks position in stream of an element that is output later.
e.g. a timestamp marker can be output to represent the correct position in the stream for a
timestamp packet the is output later.
The `sync_marker` field has a structure as shown below.
~~~{.c}
typedef enum _trace_sync_marker_t {
ELEM_MARKER_TS, /**< Marker for timestamp element */
} trace_sync_marker_t;
typedef struct _trace_marker_payload_t {
trace_sync_marker_t type; /**< type of sync marker */
uint32_t value; /**< sync marker value - usage depends on type */
} trace_marker_payload_t;
~~~
### OCSD_GEN_TRC_ELEM_MEMTRANS ###
__packet fields valid__: `mem_trans`
Memory transaction elements may appear in the output stream, if they are not otherwise cancelled
by speculative trace packets.
The memory transaction field has values as defined in the enum below:-
~~~{.c}
typedef enum _memtrans_t {
OCSD_MEM_TRANS_TRACE_INIT,/* Trace started while PE in transactional state */
OCSD_MEM_TRANS_START, /* Trace after this packet is part of a transactional memory sequence */
OCSD_MEM_TRANS_COMMIT, /* Transactional memory sequence valid. */
OCSD_MEM_TRANS_FAIL, /* Transactional memory sequence failed - operations since start of transaction have been unwound. */
} trace_memtrans_t;
~~~
### OCSD_GEN_TRC_ELEM_INSTRUMENTATION ###
__packet fields valid__: `sw_ite`
Software instrumentation packets generated by the PE `TRCIT` instruction (on cores with `FEAT_ITE`).
The `sw_ite` structure has the fields defined below:-
~~~{.c}
typedef struct _sw_ite_t {
uint8_t el; /* exception level for PE sw instrumentation instruction */
uint64_t value; /* payload for PE sw instrumentation instruction */
} trace_sw_ite_t;
~~~
### OCSD_GEN_TRC_ELEM_CUSTOM ###
__packet fields optional__: `extended_data -> ptr_extended_data`,_any others_
Custom protocol decoders can use this packet type to provide protocol specific information.
Standard fields may be used for similar purposes as defined above, or the extended data pointer can reference
other data.
--------------------------------------------------------------------------------------------------
Generic Trace Packets - Notes on interpretation.
------------------------------------------------
The interpretation of the trace output should always be done with reference to the underlying protocol
specifications.
While the output packets are in general protocol agnostic, there are some inevitable
differences related to the underlying protocol that stem from the development of the trace hardware over time.
### OCSD ranges and Trace Atom Packets ###
The most common raw trace packet in all the protocols is the Atom packet, and this packet is the basis for most of
the `OCSD_GEN_TRC_ELEM_INSTR_RANGE` packets output from the library. A trace range will be output for each atom
in the raw trace stream - the `last_instr_exec` flag taking the value of the Atom - 1 for E, 0 for N.
`OCSD_GEN_TRC_ELEM_INSTR_RANGE` packets can also be generated for non-atom packets, where flow changes - e.g.
exceptions.
### Multi feature OCSD output packets ###
Where a raw trace packet contains additional information on top of the basic packet data, then this additional
information will be added to the OCSD output packet and flagged accordingly (in the `flag_bits` union in the
packet structure).
Typically this will be atom+cycle count packets in ETMv3 and PTM protocols. For efficiency and to retain
the coupling between the information an `OCSD_GEN_TRC_ELEM_INSTR_RANGE` packet will be output in this case
with a `has_cc` flag set and the `cycle_count` value filled.
ETMv3 and PTM can add a cycle count to a number of packets, or explicitly emit a cycle count only packet. By
contrast ETMv4 only emits cycle count only packets.
Clients processing the library output must be aware of these optional additions to the base packet. The
OCSD packet descriptions above outline where the additional information can occur.
### Cycle counts ###
Cycle counts are cumulative, and represent cycles since the last cycle count output.
Explicit cycle count packets are associated with the previous range event, otherwise where a
packet includes a cycle count as additional information, then the count is associated with that
specific packet - which will often be a range packet.
The only exception to this is where the underlying protocol is ETMv4, and a cycle count is included
in a timestamp packet. Here the cycle count represents that number of cycles since the last cycle count
packet that occurred before the timestamp packet was emitted. This cycle count is not part of the cumulative
count. See the ETMv4 specification for further details.
### Correlation - timestamps and cycle counts ###
Different trace streams can be correlated using either timestamps, or timestamps plus cycle counts.
Both timestamps and cycle counts are enabled by programming ETM control registers, and it is also possible
to control the frequency that timestamps appear, or the threshold at which cycle count packets are emitted by
additional programming.
The output of timestamps and cycle counts increases the amount of trace generated, very significantly when cycle
counts are present, so the choice of generating these elements needs to be balanced against the requirement
for their use.
Decent correlation can be gained by the use of timestamps alone - especially if the source is programmed to
produce them more frequently than the default timestamp events. More precise correllation can be performed if
the 'gaps' between timestamps can be resolved using cycle counts.
Correlation is performed by identifying the same/close timestamp values in two separate trace streams. Cycle counts
if present can then be used to resolve the correlation with additional accuracy.

View File

@ -0,0 +1,611 @@
OpenCSD Library - Programmers Guide {#prog_guide}
===================================
@brief A guide to programming the OpenCSD library.
Introduction and review of Coresight Hardware
---------------------------------------------
The OpenCSD trace decode library is designed to allow programmers to decode ARM CoreSight trace
data. This guide will describe the various stages of configuring and programming a decoder instance
for a given CoreSight system.
The diagram below shows a typical Coresight trace hardware arrangement
![Example CoreSight Trace Capture Hardware](cs_trace_hw.jpg)
The design shown has four Cortex cores, each with an ETM, along with a system STM all of which generate trace into the
trace funnel. The output of the funnel is fed into a trace sink, which might be an ETB or ETR, saving the trace
which is multiplexed into CoreSight trace frames in the trace sink memory. The colours represent the sources
of trace data, each of which will be tagged with a CoreSight Trace ID.
### CoreSight Trace ID ###
The CoreSight Trace ID - also referred to as the Trace Source Channel ID - is a unique 8 bit number programmed
into each trace source in a system (ETM,PTM,STM) which identifies the source to both the hardware components
downstream and the software trace decoders. This ID is used
Overview of Configuration and Decode
------------------------------------
The OpenCSD library will take the trace data from the trace sink, and when correctly configured and programmed, will
demultiplex and decode each of the trace sources.
The library supports ETMV3, PTM, ETMv4 and STM trace protocols. The decode occurs in three stages:
- __Demultiplex__ - the combined trace streams in CoreSight trace frame format are split into their constituent streams according to the CoreSight trace ID.
- __Packet Processing__ - the individual trace ID streams are resolved into discrete trace packets.
- __Packet Decode__ - the trace packets are interpreted to produce a decoded representation of instructions executed.
There are input configuration requirements for each stage of the decode process - these allow the decode process to correctly
interpret the incoming byte stream.
- __Demultiplex__ - Input flags are set to indicate if the frames are 16 byte aligned or if the stream contains alignment
bytes between frames.
- __Packet Processing__ - The hardware configuration of the trace source must be provided. This consists of a sub-set of the
hardware register values for the source. Each protocol has differing requirements, represented by an input structure of the
register values.
- __Packet Decode__ - For ETM/PTM packet decode, this stage requires the memory images of the code executed in order
to determine the path through the code. These are provided either as memory dumps, or as links to binary code files.
_Note_ : STM, being a largely software generated data trace, does not require memory images to recover the data written by the source
processors.
The diagram below shows the basic stages of decode for the library when used in a client application:
![Example Library Usage for Trace Decode](lib_usage.jpg)
The DecodeTree object is a representation of the structure of the CoreSight hardware, but in reverse in that the data is pushed into the
tree, through the demultiplexor and then along the individual trace stream decode paths till the output decode packets are produced.
These outpup packets are referred to as Generic Trace packets, and are at this stage protocol independent. They consist primarily of
PE context information and address ranges representing the instructions processed.
### Decode Tree ###
The DecodeTree is the principal wrapper for all the decoders the library supports. This provides a programming
API which allows the creation of protocol packet processors and decoders.
The API allows the client application to configure the de-multiplexor, create and connect packet processors and
packet decoders to the trace data streams and collect the output generic decoded trace packets. The DecodeTree
provides a built in instruction decoder to allow correct trace decode, and an additional API through a memory
access handler to allow the client applications to provide the images of the traced code in file or memory dump
format.
Once a DecodeTree is configured, then it can be re-used for multiple sets of captured trace data where the same
set of applications has been traced, or by changing only the supplied memory images, different traced applications
on the same hardware configuration.
The process for programming a decode tree for a specific set of trace hardware is as follows;-
1. Create the decode tree and specify the de-multiplexor options.
2. For each trace protocol of interest, use the API to create a decoder, providing the hardware configuration,
including the CoreSight trace ID for that trace stream. Specify packet processing only, or full decode. Client
program must know the correct protocol to use for each trace stream.
3. Attach callback(s) to receive the decoded generic trace output (ITrcGenElemIn).
4. Provide the memory images if using full decode.
The DecodeTree can now be used to process the trace data by pushing the captured trace data through the trace
data input API call (ITrcDataIn) and analyzing as required the resulting decoded trace (ITrcGenElemIn).
The objects and connections used for a single trace stream are shown below.
![Decode Tree objects - single trace stream](dt_components.jpg)
All these components can be created and used outside of a DecodeTree, but that is beyond the scope of this
guide and expected to be used for custom implementations only.
Programming Examples - decoder configuration.
---------------------------------------------
The remainder of this programming guide will provide programming exceprts for each of the required stages
to get a working decode tree, capable of processing trace data.
The guide will be based on an ETMv4 system, similar to the example above, using the C++ interface, but
equivalent calls from the C-API wrapper library will also be provided.
The source code for the two test applications `trc_pkt_lister` and `c_api_pkt_print_test` may be used as
further programming guidance.
### Create the decode tree ###
The first step is to create the decode tree. Key choices here are the flags defining expected trace data
input format and de-mux operations.
~~~{.cpp}
uint32_t formatterCfgFlags = OCSD_DFRMTR_FRAME_MEM_ALIGN; /* basic operational mode for on-chip captured trace */
DecodeTree *pTree = DecodeTree::CreateDecodeTree(OCSD_TRC_SRC_FRAME_FORMATTED, formatterCfgFlags);
~~~
This creates a decode tree that is usable in the majority of cases - that is for trace captured in on chip
RAM via ETB or ETR. Additional flags are available if a TPIU is used that will indicate to the frame de-mux
that additional frame synchronisation data is present.
In limited cases where the hardware has a single trace source, or only a single source is being used, then
it is possible to switch off the hardware frame formatter in the ETB/ETR/TPIU. In this case @ref OCSD_TRC_SRC_SINGLE
(from enum @ref ocsd_dcd_tree_src_t) may be defined as the first parameter to the function.
C-API version of above code:
~~~{.c}
dcd_tree_handle_t dcdtree_handle = ocsd_create_dcd_tree(OCSD_TRC_SRC_FRAME_FORMATTED, OCSD_DFRMTR_FRAME_MEM_ALIGN);
~~~
### Error loggers and printers ###
The library defines a standard error logging interface ITraceErrorLog which many of the key components can register
with to output errors. The process of registering the source means that errors can be tied to a particular component,
or CoreSight Trace ID. The library provides a standard error logger object - ocsdDefaultErrorLogger - which
keeps a copy of the last error logged, plus a copy of the last error logged for each data stream associated
with a CoreSight trace ID.
The error logger can be attached to an output logger - ocsdMsgLogger - which can print text versions of the
error, or other error messages, out to screen or logging file. Errors can be filtered according to a severity rating,
defined by @ref ocsd_err_severity_t.
The DecodeTree can use a default error logger from the library - with a message logger that will output to `stderr`.
Client applications can create and adjust the configuration of this error logger and message logger by getting and intialising
the logger.
~~~{.cpp}
// ** Initialise default error logger.
DecodeTree::getDefaultErrorLogger()->initErrorLogger(verbosity,true);
~~~
Alternatively clients may provide their own configured error logger / message logger pair.
The test program `trc_pkt_lister` provides a customised version of an `ocsdMsgLogger` / `ocsdDefaultErrorLogger` pair
to ensure that messages and errors are logged to the screen and a file of its choice. This logger is eventually
passed through to the decode tree.
Code excerpts below (trc_pkt_lister.cpp):
~~~{.cpp}
static ocsdMsgLogger logger;
static int logOpts = ocsdMsgLogger::OUT_STDOUT | ocsdMsgLogger::OUT_FILE;
static std::string logfileName = "trc_pkt_lister.ppl";
// ** other vars
main() {
// ** some init code
logger.setLogOpts(logOpts);
logger.setLogFileName(logfileName.c_str());
ocsdDefaultErrorLogger err_log;
err_log.initErrorLogger(OCSD_ERR_SEV_INFO);
err_log.setOutputLogger(&logger);
// pass err_log reference into snapshot library code
SnapShotReader ss_reader;
ss_reader.setErrorLogger(&err_log);
// ** rest of program
}
~~~
In the library code for the snapshot reader (ss_to_dcd_tree.cpp):
~~~{.cpp}
bool CreateDcdTreeFromSnapShot::createDecodeTree()
{
// ** create a decode tree
// use our error logger - don't use the tree default.
m_pDecodeTree->setAlternateErrorLogger(m_pErrLogInterface);
}
~~~
__Note__: The Snapshot reader library is test code designed to allow the test application read trace snapshots
which are in the form defined by the open specification in `./decoder/docs/specs/ARM Trace and Debug Snapshot file format 0v2.pdf`
This format is used in ARM's DS-5 debugger, and the open source CoreSight Access Library (CSAL).
### Configuring decoders ###
The next task is to configure the requried decoders. The client program must know the type of ETM/PTM in use
to correctly set the decoder configuration.
Each class of trace source has a specific set of register values that the decoder requires to correctly interpret the
raw trace data and convert it to packets then fully decode.
Configuration of an ETMv4 decoder requires initialisation of the EtmV4Config class, which is achieved by filling in a
@ref ocsd_etmv4_cfg structure:-
~~~{.c}
typedef struct _ocsd_etmv4_cfg
{
uint32_t reg_idr0; /**< ID0 register */
uint32_t reg_idr1; /**< ID1 register */
uint32_t reg_idr2; /**< ID2 register */
uint32_t reg_idr8;
uint32_t reg_idr9;
uint32_t reg_idr10;
uint32_t reg_idr11;
uint32_t reg_idr12;
uint32_t reg_idr13;
uint32_t reg_configr; /**< Config Register */
uint32_t reg_traceidr; /**< Trace Stream ID register */
ocsd_arch_version_t arch_ver; /**< Architecture version */
ocsd_core_profile_t core_prof; /**< Core Profile */
} ocsd_etmv4_cfg;
~~~
The structure contains a number of read-only ID registers, and key programmable control registers that define
the trace output features - such as if the ETM will output timestamps or cycle counts - and the CoreSight Trace ID.
Once this structure is filled in then the decoder can be configured in the decode tree:-
~~~{.cpp}
ocsd_etmv4_cfg config;
// ...
// code to fill in config from programmed registers and id registers
// ...
EtmV4Config configObj(&config); // initialise decoder config class
std::string decoderName(OCSD_BUILTIN_DCD_ETMV4I); // use built in ETMv4 instruction decoder.
int decoderCreateFlags = OCSD_CREATE_FLG_FULL_DECODER; // decoder type to create - OCSD_CREATE_FLG_PACKET_PROC for packet processor only
ocsd_err_t err = pDecodeTree->createDecoder(decoderName, decoderCreateFlags,&configObj);
~~~
This code creates a full trace decoder for an ETMv4 source, which consists of a packet processor and packet decoder pair. The decoder is automatically associated with the
CoreSight Trace ID programmed into the register provided in the `config` structure.
It is also possible to create a packet processor only decoder if the `OCSD_CREATE_FLG_PACKET_PROC` flag is
used instead. These packet only decoders can be used to create a dump of the raw trace as discrete trace packets.
All decoders a registered with the library using a name - the standard ARM protocols are considered built in
decoders and are registered automatically. The library contains defined names for these decoders - `OCSD_BUILTIN_DCD_ETMV4I`
being the name used for ETMv4 protocol.
The C-API uses the call create_generic_decoder() with the same configuration structure:-
~~~{.c}
ocsd_etmv4_cfg config;
// ...
// code to fill in config from programmed registers and id registers
// ...
const char * decoderName = OCSD_BUILTIN_DCD_ETMV4I); // use built in ETMv4 instruction decoder.
int decoderCreateFlags = OCSD_CREATE_FLG_FULL_DECODER; // decoder type to create - OCSD_CREATE_FLG_PACKET_PROC for packet processor only
void *p_context = // <some_client_context>
ocsd_err_t err = create_generic_decoder(dcdtree_handle,decoderName,(void *)&config,p_context);
~~~
The configuration must be completed for each trace source in the decode tree which requires decoding.
The different trace source types have different configuration structures, classes and names
| protocol | config struct | class | name define |
|:----------|:--------------------|:------------|:-----------------------------|
| __ETE__ | @ref ocsd_ete_cfg | ETEConfig | @ref OCSD_BUILTIN_DCD_ETE |
| __ETMv4__ | @ref ocsd_etmv4_cfg | EtmV4Config | @ref OCSD_BUILTIN_DCD_ETMV4I |
| __ETMv3__ | @ref ocsd_etmv3_cfg | EtmV3Config | @ref OCSD_BUILTIN_DCD_ETMV3 |
| __PTM__ | @ref ocsd_ptm_cfg | PtmConfig | @ref OCSD_BUILTIN_DCD_PTM |
| __STM__ | @ref ocsd_stm_cfg | STMConfig | @ref OCSD_BUILTIN_DCD_STM |
### Adding in Memory Images ###
Memory images are needed when a full trace decode is required. Memory images consist of a base address and length, and
contain instruction opcodes that may be executed during the operation of the traced program. The images are used by
the decoder to follow the path of the traced program by interpreting the information contained within the trace that
defines which program branches are taken and the target addresses of those branches.
The library defined memory image accessor objects, which can be simple memory buffers, files containing the binary
code image, or a callback that allows the client to handle memory accesses directly. When files are used, the
object may contain a set of base addresses and lengths, with offsets into the file - allowing the decoder
to directly access multiple code segments in executable image files.
Memory image objects are collated by a memory mapper. This interfaces to the decoder through the ITargetMemAccess interface,
and selects the correct image object for the address requested by the decoder. The memory mapper will also validate image
objects as they are added to the decoder, and will not permit overlapping images.
![Memory Mapper and Memory Images](memacc_objs.jpg)
The client can add memory images to the decoder via API calls to the decode tree. These methods add memory image accessors of various
types to be managed by a memory access mapper:-
~~~{.cpp}
class DecodeTree {
// ...
ocsd_err_t createMemAccMapper(memacc_mapper_t type = MEMACC_MAP_GLOBAL);
// ...
ocsd_err_t addBufferMemAcc(const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const uint8_t *p_mem_buffer, const uint32_t mem_length);
ocsd_err_t addBinFileMemAcc(const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const std::string &filepath);
ocsd_err_t addBinFileRegionMemAcc(const ocsd_file_mem_region_t *region_array, const int num_regions, const ocsd_mem_space_acc_t mem_space, const std::string &filepath); */
ocsd_err_t addCallbackMemAcc(const ocsd_vaddr_t st_address, const ocsd_vaddr_t en_address, const ocsd_mem_space_acc_t mem_space, Fn_MemAcc_CB p_cb_func, const void *p_context);
// ...
}
~~~
The `createMemAccMapper()` function must be called to create the mapper, before the `add...MemAcc()` calls are used.
It is further possible to differentiate between memory image access objects by the memory space for which they are valid. If it is known that a certain code image
is present in secure EL3, then an image can be associated with the @ref ocsd_mem_space_acc_t type value @ref OCSD_MEM_SPACE_EL3, which will allow another image to be
present at the same address but a different exception level. However, for the majority of systems, such detailed knowledge of the code is not available, or
overlaps across memory spaces do not occur. In these cases, and for general use (including Linux trace decode), @ref OCSD_MEM_SPACE_ANY should be used.
The C-API contains a similar set of calls to set up memory access objects:-
~~~{.c}
OCSD_C_API ocsd_err_t ocsd_dt_add_buffer_mem_acc(const dcd_tree_handle_t handle, const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const uint8_t *p_mem_buffer, const uint32_t mem_length);
OCSD_C_API ocsd_err_t ocsd_dt_add_binfile_mem_acc(const dcd_tree_handle_t handle, const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const char *filepath);
OCSD_C_API ocsd_err_t ocsd_dt_add_binfile_region_mem_acc(const dcd_tree_handle_t handle, const ocsd_file_mem_region_t *region_array, const int num_regions, const ocsd_mem_space_acc_t mem_space, const char *filepath);
OCSD_C_API ocsd_err_t ocsd_dt_add_callback_mem_acc(const dcd_tree_handle_t handle, const ocsd_vaddr_t st_address, const ocsd_vaddr_t en_address, const ocsd_mem_space_acc_t mem_space, Fn_MemAcc_CB p_cb_func, const void *p_context);
~~~
Note that the C-API will automatically create a default mapper when the first memory access object is added.
### Adding the output callbacks ###
The decoded trace output ia collect by the client application through callback functions registered with the library.
Depending on the decode configuration chosen, this can be in the form of the fully decoded trace output as generic trace
packets, or discrete trace packets for each trace stream ID.
__Full Decode__
When full decode is chosen then all output is via the generic packet interface:
~~~{.cpp}
class ITrcGenElemIn
{
///...
virtual ocsd_datapath_resp_t TraceElemIn(const ocsd_trc_index_t index_sop,
const uint8_t trc_chan_id,
const OcsdTraceElement &el);
}
~~~
The client application registers a callback class or function with this signature.
For each output packet the libary calls the registered function, providing the byte index into the raw trace for the first
byte of the trace protocol packet that resulted in its generation, plus the CoreSight trace ID of the source stream,
#and the output packet itself.
The client callback must process the packet before returning the call - the reference to the packet data is only
valid for the duration of the call. This means that the client will either have to copy and buffer packets for later
processing if required, process immediately, or use an appropriate combination, dependent on the requirements of the
client.
The client callback provides a ocsd_datapath_resp_t response code to indicate to the input side of the library if decoding is to continue.
~~~{.cpp}
DecodeTree *pTree;
TrcGenericElementPrinter genElemPrinter; // derived from ITrcGenElemIn, overrides TraceElemIn() to print incoming packet to logger.
///...
pTree->setGenTraceElemOutI(genElemPrinter);
~~~
Alternatively in C-API, the callback function pointer type is defined:-
~~~{.c}
typedef ocsd_datapath_resp_t (* FnTraceElemIn)( const void *p_context,
const ocsd_trc_index_t index_sop,
const uint8_t trc_chan_id,
const ocsd_generic_trace_elem *elem);
~~~
giving API calls to set up:-
~~~{.c}
FnTraceElemIn gen_pkt_fn = &gen_trace_elem_analyze; // set to function matching signature.
dcd_tree_handle_t dcdtree_handle;
// ...
ret = ocsd_dt_set_gen_elem_outfn(dcdtree_handle, gen_pkt_fn, 0);
~~~
The output packets and their intepretatation are described here [prog_guide_generic_pkts.md](@ref generic_pkts).
__Packet Process only, or Monitor packets in Full Decode__
The client can set up the library for packet processing only, in which case the library output is
the trace packets only, so these packets need a sink callback for each channel being output.
When full decode is in operation, then the principle output is the generic packets that are output for
all channels in operation to the single callback mentioned above. Additional callbacks can be added to
each of the trace channels to monitor the packet processing stage as it happens at point that the packets
are passed to the full decoder.
Both methods of processing the discrete trace packets require callbacks to be registered on a
per Trace ID / channel basis. The specifics of the callback and the resulting packet will vary according to
the protocol of the trace source.
The .cpp interface registers a packet sink / packet monitor object with the relevant decoder object.
This sink object is based on the tempated IPktDataIn interface.
~~~{.cpp}
template<class P> class IPktDataIn : public ITrcTypedBase {
// ...
virtual ocsd_datapath_resp_t PacketDataIn( const ocsd_datapath_op_t op,
const ocsd_trc_index_t index_sop,
const P *p_packet_in) = 0;
}
~~~
The template type parameter will be the protocol type for the trace source in question - e.g. EtmV4ITrcPacket.
This interface contains a method that will be called with trace packets.
The monitor object must be based on the IPktRawDataMon class, with a similarly typed template parameter and callback
function.
~~~{.cpp}
template<class P> class IPktRawDataMon : public ITrcTypedBase {
// ...
virtual void RawPacketDataMon( const ocsd_datapath_op_t op,
const ocsd_trc_index_t index_sop,
const P *pkt,
const uint32_t size,
const uint8_t *p_data) = 0;
}
~~~
Given a suitable callback object the process for attaching to the decode is as follows:-
~~~{.cpp}
// client custom packet sink for ETMv4 - derived from IPktDataIn
class MyTracePacketSinkETMv4 : public IPktDataIn<EtmV4ITrcPacket> {
// ...
};
uint8_t CSID;
DecodeTree *pTree; // pointer to decode tree
MyTracePacketSinkETMv4 *pSink;
// ... obtain CSID and decode tree object
// decode trees manage decode elements using a tree element object, registered against CSID.
DecodeTreeElement *pElement = pTree->getDecoderElement(CSID);
pSink = new MyTracePacketSinkETMv4();
if (pElement && pSink)
err = pElement->getDecoderMngr()->attachPktSink(pElement->getDecoderHandle(), pSink);
~~~
The decode tree object is used to obtain the decode tree element associated with the Coresight trace ID.
The IDecoderMngr interface on this object is used to attach the packet sink object to the required decoder.
For monitor objects use an attachPktMonitor() call with a suitably derived monitor sink object.
The key difference between the packet sink, and the packet monitor is that the monitor is not in the trace decode
data path, so does not return ocsd_datapath_resp_t values. The monitor callback also provides the raw trace byte
data for the packet.
Device tree call for registering a callback in C-API and the function signatures for each type of shown below..
The C-API code contains underlying managment code that connects the callback with the correct packet decoder object.
~~~{.c}
OCSD_C_API ocsd_err_t ocsd_dt_attach_packet_callback( const dcd_tree_handle_t handle, // decode tree handle
const unsigned char CSID, // trace channel ID
const ocsd_c_api_cb_types callback_type, // defines packet only processing sink or monitor function signature.
void *p_fn_callback_data, // pointer to the callback function for the packet data.
const void *p_context); // opaque context to use inside the callback.
~~~
Callback definition for packet only sink callback type:
~~~{.c}
/** function pointer type for packet processor packet output sink, packet analyser/decoder input - generic declaration */
typedef ocsd_datapath_resp_t (* FnDefPktDataIn)(const void *p_context,
const ocsd_datapath_op_t op,
const ocsd_trc_index_t index_sop,
const void *p_packet_in
);
~~~
Callback definition for packet monitor callback type
~~~{.c}
/** function pointer type for packet processor packet monitor sink, raw packet monitor / display input - generic declaration */
typedef void (* FnDefPktDataMon)(const void *p_context,
const ocsd_datapath_op_t op,
const ocsd_trc_index_t index_sop,
const void *p_packet_in,
const uint32_t size,
const uint8_t *p_data
);
~~~
As with the `.cpp` code, the monitor callback does not have a return value, but also has the raw trace bytes for the packet as part of
the monitor.
In both cases in the C-API, the `void *p_packet_in` must be cast to packet structure appropriate to the trace protocol associated with the
CSID value. e.g. for ETMv4 this would be @ref ocsd_etmv4_i_pkt.
Programming Examples - using the configured Decode Tree.
--------------------------------------------------------
Once the decode tree has been configured then data raw trace data can be processed through the decode tree.
The client program will require two functions to use the library. The first is on the input side of the library
which must be driven with raw data, until the data is complete, or an error occurs. This processing routine must
check the library returns and respond appropriately.
The second consists of output callback(s) which process the decoded generic packets, or trace packets.
This routine will return response codes according to the needs of the client.
![Trace Data call and response path](decode_data_path_resp.jpg)
The diagram shows the data input and response path. The data is driven into the decoding library by the client raw data input
routine on the left. Processed packets are received by the client packet callback(s) on the right, and push response codes back
through the library.
The raw data input routine calls the standard ITrcDataIn interface with an operation code, and if appropriate some raw
trace data. The input operation code will define how the library treats the input parameters.
| Operation | Description | Trace Data provided |
|:-------------------|:-----------------------------------------------------------------|:--------------------|
| @ref OCSD_OP_DATA | Process data provided by data pointer parameters. | Yes |
| @ref OCSD_OP_FLUSH | Call after prior wait response - finish processing previous data | No |
| @ref OCSD_OP_EOT | End of trace data. Library will complete any pending decode. | No |
| @ref OCSD_OP_RESET | Hard reset of decoder state - use current config for new data | No |
A set of standard responses is used to indicate to the raw data input whether it should continue to push data through the library,
pause and then flush, or if a fatal processing error has occurred.
The response codes can come from the internal library decoder, or from the part of the client that is handling the processing of the
output packets on the right of the diagram.
_Response Codes_: The are contained in the @ref _ocsd_datapath_resp_t enum.
- __OCSD_RESP_CONT, OCSD_RESP_CONT_xxx__: Indicates that processing is to continue. Generated either internally by the library if more data
is needed to generate an output packet, or by the output packet processors to indicate processing
is to continue.
- __OCSD_RESP_WAIT, OCSD_RESP_WAIT_xxx:__ Sent by the client processors to pause processing. This will freeze the internal state of the library
and cause the WAIT response to be propogated through to the input side, with an indication of the number
of bytes processed. After a WAIT, the input side must respond with flush operations, until a CONT is
seen again and further data can then be input into the library.
- __OCSR_RESP_FATAL_xxx__: Fatal processing error. No further processing can take place. See error response logger for reason.
Normally the result of corrupt or incorrect trace data.
The user should note that the client program controls routines on both the input and output side of the library. The output routine may be buffering
output packets, and when the buffer is full, returns a WAIT ressponse. This will be propgated through to the input routine. This should now terminate
data processing, saving state and the client will run a routine to empty / process the full packet buffer. Once the necessary processing is done,
then the input routine can be restarted, but __must__ follow the FLUSH operational rule described above.
Excerpts from the data input routine used by the `trc_pkt_lister` program are shown below:
~~~{.cpp}
// process the current buffer load until buffer done, or fatal error occurs
while((nBuffProcessed < nBuffRead) && !OCSD_DATA_RESP_IS_FATAL(dataPathResp))
{
if(OCSD_DATA_RESP_IS_CONT(dataPathResp))
{
dataPathResp = dcd_tree->TraceDataIn(
OCSD_OP_DATA,
trace_index,
(uint32_t)(nBuffRead - nBuffProcessed),
&(trace_buffer[0])+nBuffProcessed,
&nUsedThisTime);
nBuffProcessed += nUsedThisTime;
trace_index += nUsedThisTime;
}
else // last response was _WAIT
{
// may need to acknowledge a wait from the gen elem printer
if(genElemPrinter->needAckWait())
genElemPrinter->ackWait();
// dataPathResp not continue or fatal so must be wait...
dataPathResp = dcd_tree->TraceDataIn(OCSD_OP_FLUSH,0,0,0,0);
}
}
~~~
_Note_: in this test program, the WAIT response is an artificial test condition, so the input routine does not terminate on seeing it - it is cleared down
and FLUSH is immediately sent. Normal client routines would most likely drop out of the processing loop, take actions to clear the WAIT condition, then
resume processing with a FLUSH.
See the `trc_pkt_lister` and `c_api_pkt_print_test` test program source code for further examples of driving data through the library.

213
decoder/docs/test_progs.md Normal file
View File

@ -0,0 +1,213 @@
Test Programs {#test_progs}
=============
@brief A description of the test programs used with the library.
The Programs
------------
There are currently two test programs built alongside the library.
1. `trc_pkt_lister` : This test the C++ library by taking a trace "snapshot" directory as an input
and decodes all or a chosen set of trace sources from within the trace data buffers in the library. Command
line parameters allow the test program to be controlled.
2. `c_api_pkt_print_test` : This program tests the "C" API functions, using hardcoded tests
based on the same "snapshots" used for the C++ library. Limited user control for this program.
This can also run tests using the external test decoder to validate the external decoder API.
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.
----------------------------
The `.\tests\snapshots` directory contains a number of trace snapshots used for testing the library.
Trace snapshots are dumps of captured binary trace data, CoreSight component configurations and memory
dumps to allow trace decode.
Snapshots are generated on ARM targets and can then be analysed offline. The snapshot format is available
in a separate document.
The `trc_pkt_lister` program.
-----------------------------
This will take a snapshot directory as an input, and list and/or decode all the trace packets for a
single source, for any currently supported protocol.
The output will be a list of discrete packets, generic output packets and any error messages
to file and/or screen as selected by the input command line options.
By default the program will list packets only (no decode), for the first discovered trace sink
(ETB, ETF, ETR) in the snapshot directory, with all streams output.
__Command Line Options__
*Snapshot selection*
- `-ss_dir <dir>` : Set the directory path to a trace snapshot.
- `-ss_verbose` : Verbose output when reading the snapshot.
*Decode options*
- `-id <n>` : Set an ID to list (may be used multiple times) - default if no id set is for all IDs to be printed.
- `-src_name <name>` : List packets from a given snapshot source name (defaults to first source found).
- `-tpiu` : Input data is from a TPIU source that has TPIU FSYNC packets present.
- `-tpiu_hsync` : Input data is from a TPIU source that has both TPIU FSYNC and HSYNC packets present.
- `-decode` : Full decode of the packets from the trace snapshot (default is to list undecoded packets only.
- `-decode_only` : Does not list the undecoded packets, just the trace decode.
- `-src_addr_n` : ETE protocol; Indicate skipped N atoms in source address packet ranges by breaking the decode
range into multiple ranges on N atoms.
- `-o_raw_packed` : Output raw packed trace frames.
- `-o_raw_unpacked` : Output raw unpacked trace data per ID.
*Output options*
Default is to output to file and stdout. Setting any option overrides and limits to only
the options set.
- `-logstdout` : output to stdout.
- `-logstderr` : output to stderr.
- `-logfile` : output to file using the default log file name.
- `-logfilename <name>` : change the name of the output log file.
__Test output examples__
Example command lines with short output excerpts.
*TC2, ETMv3 packet processor output, raw packet output.*
Command line:-
`trc_pkt_lister -ss_dir ..\..\..\snapshots\TC2 -o_raw_unpacked`
~~~~~~~~~~~~~~~~
Frame Data; Index 17958; ID_DATA[0x11]; 16 04 c0 86 42 97 e1 c4
Idx:17945; ID:11; I_SYNC : Instruction Packet synchronisation.; (Periodic); Addr=0xc00416e2; S; ISA=Thumb2;
Idx:17961; ID:11; P_HDR : Atom P-header.; WEN; Cycles=1
Frame Data; Index 17968; ID_DATA[0x11]; ce af 90 80 80 00 a4 84 a0 84 a4 88
Idx:17962; ID:11; TIMESTAMP : Timestamp Value.; TS=0x82f9d13097 (562536984727)
Idx:17974; ID:11; P_HDR : Atom P-header.; WW; Cycles=2
Idx:17975; ID:11; P_HDR : Atom P-header.; WE; Cycles=1
Idx:17976; ID:11; P_HDR : Atom P-header.; W; Cycles=1
Idx:17977; ID:11; P_HDR : Atom P-header.; WE; Cycles=1
Idx:17978; ID:11; P_HDR : Atom P-header.; WW; Cycles=2
Idx:17979; ID:11; P_HDR : Atom P-header.; WEWE; Cycles=2
Frame Data; Index 17980; ID_DATA[0x10]; a0 82
Idx:17980; ID:10; P_HDR : Atom P-header.; W; Cycles=1
Idx:17981; ID:10; P_HDR : Atom P-header.; WEE; Cycles=1
Frame Data; Index 17984; ID_DATA[0x10]; b8 84 a4 88 a0 82
Idx:17984; ID:10; P_HDR : Atom P-header.; WWWWWWW; Cycles=7
Idx:17985; ID:10; P_HDR : Atom P-header.; WE; Cycles=1
Idx:17986; ID:10; P_HDR : Atom P-header.; WW; Cycles=2
Idx:17987; ID:10; P_HDR : Atom P-header.; WEWE; Cycles=2
Idx:17988; ID:10; P_HDR : Atom P-header.; W; Cycles=1
Idx:17989; ID:10; P_HDR : Atom P-header.; WEE; Cycles=1
~~~~~~~~~~~~~~~~
*Juno - ETB_1 selected for STM packet output, raw packet output*
Command line:-
`trc_pkt_lister -ss_dir ..\..\..\snapshots\juno_r1_1 -o_raw_unpacked -src_name ETB_1`
~~~~~~~~~~~~~~~~
Trace Packet Lister: CS Decode library testing
-----------------------------------------------
Trace Packet Lister : reading snapshot from path ..\..\..\snapshots\juno_r1_1
Using ETB_1 as trace source
Trace Packet Lister : STM Protocol on Trace ID 0x20
Frame Data; Index 0; ID_DATA[0x20]; ff ff ff ff ff ff ff ff ff ff 0f 0f 30 41
Idx:0; ID:20; ASYNC:Alignment synchronisation packet.
Idx:11; ID:20; VERSION:Version packet.; Ver=3
Frame Data; Index 16; ID_DATA[0x20]; f1 1a 00 00 00 30 10 af 01 00 00 10 03 f2 1a
Idx:13; ID:20; M8:Set current master.; Master=0x41
Idx:17; ID:20; D32M:32 bit data; with marker.; Data=0x10000000
Idx:22; ID:20; C8:Set current channel.; Chan=0x0001
Idx:23; ID:20; D32M:32 bit data; with marker.; Data=0x10000001
Idx:28; ID:20; C8:Set current channel.; Chan=0x0002
Frame Data; Index 32; ID_DATA[0x20]; 00 00 00 32 30 af 01 00 00 30 03 f4 1a 00 00
Idx:30; ID:20; D32M:32 bit data; with marker.; Data=0x10000002
Idx:36; ID:20; C8:Set current channel.; Chan=0x0003
Idx:37; ID:20; D32M:32 bit data; with marker.; Data=0x10000003
Idx:42; ID:20; C8:Set current channel.; Chan=0x0004
Frame Data; Index 48; ID_DATA[0x20]; 00 f4 ff ff ff ff ff ff ff ff ff ff f0 00 13
Idx:44; ID:20; D32M:32 bit data; with marker.; Data=0x10000004
Idx:50; ID:20; ASYNC:Alignment synchronisation packet.
Idx:61; ID:20; VERSION:Version packet.; Ver=3
~~~~~~~~~~~~~~~~
*Juno - ETMv4 full trace decode + packet monitor, source trace ID 0x10 only.*
Command line:-
`trc_pkt_lister -ss_dir ..\..\..\snapshots\juno_r1_1 -decode -id 0x10`
~~~~~~~~~~~~~~~~
Idx:17204; ID:10; [0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 ]; I_ASYNC : Alignment Synchronisation.
Idx:17218; ID:10; [0x01 0x01 0x00 ]; I_TRACE_INFO : Trace Info.; INFO=0x0
Idx:17221; ID:10; [0x9d 0x00 0x35 0x09 0x00 0xc0 0xff 0xff 0xff ]; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFFFFC000096A00;
Idx:17230; ID:10; [0x04 ]; I_TRACE_ON : Trace On.
Idx:17232; ID:10; [0x85 0x00 0x35 0x09 0x00 0xc0 0xff 0xff 0xff 0xf1 0x00 0x00 0x00 0x00 0x00 ]; I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0xFFFFFFC000096A00; Ctxt: AArch64,EL1, NS; CID=0x00000000; VMID=0x0000;
Idx:17248; ID:10; [0xf7 ]; I_ATOM_F1 : Atom format 1.; E
Idx:17230; ID:10; OCSD_GEN_TRC_ELEM_TRACE_ON( [begin or filter])
Idx:17232; ID:10; OCSD_GEN_TRC_ELEM_PE_CONTEXT((ISA=A64) EL1N; 64-bit; VMID=0x0; CTXTID=0x0; )
Idx:17248; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000096a00:[0xffffffc000096a10] num_i(4) last_sz(4) (ISA=A64) E ISB )
Idx:17249; ID:10; [0x9d 0x30 0x25 0x59 0x00 0xc0 0xff 0xff 0xff ]; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFFFFC000594AC0;
Idx:17258; ID:10; [0xf7 ]; I_ATOM_F1 : Atom format 1.; E
Idx:17258; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000594ac0 )
Idx:17259; ID:10; [0x95 0xd6 0x95 ]; I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC000592B58 ~[0x12B58]
Idx:17262; ID:10; [0xf9 ]; I_ATOM_F3 : Atom format 3.; ENN
Idx:17262; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000592b58 )
Idx:17264; ID:10; [0xf7 ]; I_ATOM_F1 : Atom format 1.; E
Idx:17265; ID:10; [0x9a 0x32 0x62 0x5a 0x00 ]; I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC0005AC4C8;
Idx:17270; ID:10; [0xdb ]; I_ATOM_F2 : Atom format 2.; EE
Idx:17270; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc0005ac4c8 )
Idx:17271; ID:10; [0x9a 0x62 0x52 0x0e 0x00 ]; I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC0000EA588;
Idx:17276; ID:10; [0xfc ]; I_ATOM_F3 : Atom format 3.; NNE
Idx:17276; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc0000ea588 )
Idx:17277; ID:10; [0x9a 0x58 0x15 0x59 0x00 ]; I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC000592B60;
Idx:17283; ID:10; [0x06 0x1d ]; I_EXCEPT : Exception.; IRQ; Ret Addr Follows;
Idx:17285; ID:10; [0x95 0x59 ]; I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC000592B64 ~[0x164]
Idx:17283; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000592b60 )
Idx:17283; ID:10; OCSD_GEN_TRC_ELEM_EXCEPTION(pref ret addr:0xffffffc000592b64; excep num (0x0e) )
Idx:17287; ID:10; [0x9a 0x20 0x19 0x08 0x00 ]; I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC000083280;
Idx:17292; ID:10; [0xfd ]; I_ATOM_F3 : Atom format 3.; ENE
Idx:17292; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000083280:[0xffffffc000083284] num_i(1) last_sz(4) (ISA=A64) E BR )
Idx:17292; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000083d40:[0xffffffc000083d9c] num_i(23) last_sz(4) (ISA=A64) N BR <cond>)
Idx:17292; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000083d9c:[0xffffffc000083dac] num_i(4) last_sz(4) (ISA=A64) E iBR b+link )
Idx:17293; ID:10; [0x95 0xf7 0x09 ]; I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC0000813DC ~[0x13DC]
Idx:17297; ID:10; [0xdb ]; I_ATOM_F2 : Atom format 2.; EE
Idx:17297; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc0000813dc:[0xffffffc0000813f0] num_i(5) last_sz(4) (ISA=A64) E BR b+link )
Idx:17297; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc00008f2e0:[0xffffffc00008f2e4] num_i(1) last_sz(4) (ISA=A64) E iBR A64:ret )
Idx:17298; ID:10; [0x95 0x7e ]; I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC0000813F8 ~[0x1F8]
Idx:17300; ID:10; [0xe0 ]; I_ATOM_F6 : Atom format 6.; EEEN
Idx:17300; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc0000813f8:[0xffffffc00008140c] num_i(5) last_sz(4) (ISA=A64) E BR )
Idx:17300; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc00008141c:[0xffffffc000081434] num_i(6) last_sz(4) (ISA=A64) E BR <cond>)
Idx:17300; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc00008140c:[0xffffffc000081414] num_i(2) last_sz(4) (ISA=A64) E BR b+link )
Idx:17300; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000117cf0 )
~~~~~~~~~~~~~~~~
The `c_api_pkt_print_test` program.
-----------------------------------
Program tests the C-API infrastructure, including as an option the external decoder support.
Limited to decoding trace from a single CoreSight ID. Uses the same "snapshots" as the C++ test program, but using hardcoded path values.
__Command Line Options__
By default the program will run the single CoreSight ID of 0x10 in packet processing output mode using the ETMv4 decoder on the Juno snapshot.
- `-id <n>` : Change the ID used for the test.
- `-etmv3` : Test the ETMv3 decoder - uses the TC2 snapshot.
- `-ptm` : Test the PTM decoder - uses the TC2 snapshot.
- `-stm` : Test the STM decoder - uses juno STM only snapshot.
- `-extern` : Use the 'echo_test' external decoder to test the custom decoder API.
- `-decode` : Output trace protocol packets and full decode generic packets.
- `-decode_only` : Output full decode generic packets only.

View File

@ -0,0 +1,47 @@
/*
* \file ete_decoder.h
* \brief OpenCSD : Top level header file for ETE decoder.
*
* \copyright Copyright (c) 2019, 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.
*/
#ifndef ARM_ETE_DECODER_H_INCLUDED
#define ARM_ETE_DECODER_H_INCLUDED
// ETE actually uses extended ETMv4 packet processor and decode
// ETE specifics limited to configuration
//
#include "trc_cmp_cfg_ete.h"
#include "trc_pkt_types_ete.h"
#endif // ARM_ETE_DECODER_H_INCLUDED
/* End of File ete_decoder.h */

View File

@ -0,0 +1,81 @@
/*
* \file trc_cmp_cfg_ete.h
* \brief OpenCSD : ETE configuration
*
* \copyright Copyright (c) 2019, 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.
*/
#ifndef ARM_TRC_CMP_CFG_ETE_H_INCLUDED
#define ARM_TRC_CMP_CFG_ETE_H_INCLUDED
#include "trc_pkt_types_ete.h"
#include "opencsd/etmv4/trc_cmp_cfg_etmv4.h"
/** @addtogroup ocsd_protocol_cfg
@{*/
/** @name ETE configuration
@{*/
/*!
* @class ETEConfig
* @brief Interpreter class for ETE config structure
*
* ETE trace and config are a superset of ETMv4 trace and config - hence
* use the EtmV4Config class as a base.
*/
class ETEConfig : public EtmV4Config
{
public:
ETEConfig();
ETEConfig(const ocsd_ete_cfg *cfg_regs);
~ETEConfig();
//! copy assignment operator for base structure into class.
ETEConfig & operator=(const ocsd_ete_cfg *p_cfg);
//! cast operator returning struct const reference
operator const ocsd_ete_cfg &() const { return m_ete_cfg; };
//! cast operator returning struct const pointer
operator const ocsd_ete_cfg *() const { return &m_ete_cfg; };
private:
void copyV4(); // copy relevent config to underlying structure.
ocsd_ete_cfg m_ete_cfg;
};
/** @}*/
/** @}*/
#endif // ARM_TRC_CMP_CFG_ETE_H_INCLUDED
/* End of File trc_cmp_cfg_ete.h */

View File

@ -0,0 +1,58 @@
/*
* \file trc_dcd_mngr_ete.h
* \brief OpenCSD : ETE decoder creation.
*
* \copyright Copyright (c) 2019, 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.
*/
#ifndef ARM_TRC_DCD_MNGR_ETE_H_INCLUDED
#define ARM_TRC_DCD_MNGR_ETE_H_INCLUDED
#include "common/ocsd_dcd_mngr.h"
#include "trc_cmp_cfg_ete.h"
#include "opencsd/etmv4/trc_pkt_decode_etmv4i.h"
#include "opencsd/etmv4/trc_pkt_proc_etmv4.h"
class DecoderMngrETE : public DecodeMngrFullDcdExCfg< EtmV4ITrcPacket,
ocsd_etmv4_i_pkt_type,
EtmV4Config,
ETEConfig,
ocsd_ete_cfg,
TrcPktProcEtmV4I,
TrcPktDecodeEtmV4I>
{
public:
DecoderMngrETE(const std::string &name) : DecodeMngrFullDcdExCfg(name, OCSD_PROTOCOL_ETE) {};
virtual ~DecoderMngrETE() {};
};
#endif // ARM_TRC_DCD_MNGR_ETE_H_INCLUDED
/* End of File trc_dcd_mngr_ete.h */

View File

@ -0,0 +1,66 @@
/*
* \file trc_pkt_types_ete.h
* \brief OpenCSD : ETE types
*
* \copyright Copyright (c) 2019, 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.
*/
#ifndef ARM_TRC_PKT_TYPES_ETE_H_INCLUDED
#define ARM_TRC_PKT_TYPES_ETE_H_INCLUDED
#include "opencsd/trc_pkt_types.h"
#include "opencsd/etmv4/trc_pkt_types_etmv4.h"
/** @addtogroup trc_pkts
@{*/
/** @name ETE config Types
@{*/
typedef struct _ocsd_ete_cfg
{
uint32_t reg_idr0; /**< ID0 register */
uint32_t reg_idr1; /**< ID1 register */
uint32_t reg_idr2; /**< ID2 register */
uint32_t reg_idr8; /**< ID8 - maxspec */
uint32_t reg_devarch; /**< DevArch register */
uint32_t reg_configr; /**< Config Register */
uint32_t reg_traceidr; /**< Trace Stream ID register */
ocsd_arch_version_t arch_ver; /**< Architecture version */
ocsd_core_profile_t core_prof; /**< Core Profile */
} ocsd_ete_cfg;
/** @}*/
/** @}*/
#endif // ARM_TRC_PKT_TYPES_ETE_H_INCLUDED
/* End of File trc_pkt_types_ete.h */

View File

@ -0,0 +1,98 @@
/*
* \file trc_cmp_cfg_ete.cpp
* \brief OpenCSD : ETE config class
*
* \copyright Copyright (c) 2019, 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 "opencsd/ete/trc_cmp_cfg_ete.h"
ETEConfig::ETEConfig() : EtmV4Config()
{
m_ete_cfg.reg_idr0 = 0x28000EA1;
m_ete_cfg.reg_idr1 = 0x4100FFF3;
m_ete_cfg.reg_idr2 = 0x00000488;
m_ete_cfg.reg_idr8 = 0;
m_ete_cfg.reg_configr = 0xC1;
m_ete_cfg.reg_traceidr = 0;
m_ete_cfg.arch_ver = ARCH_AA64;
m_ete_cfg.core_prof = profile_CortexA;
m_ete_cfg.reg_devarch = 0x47705A13;
copyV4();
}
ETEConfig::ETEConfig(const ocsd_ete_cfg *cfg_regs) : EtmV4Config()
{
m_ete_cfg = *cfg_regs;
copyV4();
}
ETEConfig::~ETEConfig()
{
}
//! copy assignment operator for base structure into class.
ETEConfig & ETEConfig::operator=(const ocsd_ete_cfg *p_cfg)
{
m_ete_cfg = *p_cfg;
copyV4();
return *this;
}
//! cast operator returning struct const reference
//operator const ocsd_ete_cfg &() const { return m_ete_cfg; };
//! cast operator returning struct const pointer
//operator const ocsd_ete_cfg *() const { return &m_ete_cfg; };
// ete superset of etmv4 - move info to underlying structure.
void ETEConfig::copyV4()
{
// copy over 1:1 regs
m_cfg.reg_idr0 = m_ete_cfg.reg_idr0;
m_cfg.reg_idr1 = m_ete_cfg.reg_idr1;
m_cfg.reg_idr2 = m_ete_cfg.reg_idr2;
m_cfg.reg_idr8 = m_ete_cfg.reg_idr8;
m_cfg.reg_idr9 = 0;
m_cfg.reg_idr10 = 0;
m_cfg.reg_idr11 = 0;
m_cfg.reg_idr12 = 0;
m_cfg.reg_idr13 = 0;
m_cfg.reg_configr = m_ete_cfg.reg_configr;
m_cfg.reg_traceidr = m_ete_cfg.reg_traceidr;
m_cfg.core_prof = m_ete_cfg.core_prof;
m_cfg.arch_ver = m_ete_cfg.arch_ver;
// override major / minor version as part of devarch
m_MajVer = (uint8_t)((m_ete_cfg.reg_devarch & 0xF000) >> 12);
m_MinVer = (uint8_t)((m_ete_cfg.reg_devarch & 0xF0000) >> 16);
}
/* End of File trc_cmp_cfg_ete.cpp */

View File

@ -0,0 +1,600 @@
AutoFDO and ARM Trace {#AutoFDO}
=====================
@brief Using CoreSight trace and perf with OpenCSD for AutoFDO.
## Introduction
Feedback directed optimization (FDO, also know as profile guided
optimization - PGO) uses a profile of a program's execution to guide the
optmizations performed by the compiler. Traditionally, this involves
building an instrumented version of the program, which records a profile of
execution as it runs. The instrumentation adds significant runtime
overhead, possibly changing the behaviour of the program and it may not be
possible to run the instrumented program in a production environment
(e.g. where performance criteria must be met).
AutoFDO uses facilities in the hardware to sample the behaviour of the
program in the production environment and generate the execution profile.
An improved profile can be obtained by including the branch history
(i.e. a record of the last branches taken) when generating an instruction
samples. On Arm systems, the ETM can be used to generate such records.
The process can be broken down into the following steps:
* Record execution trace of the program
* Convert the execution trace to instruction samples with branch histories
* Convert the instruction samples to source level profiles
* Use the source level profile with the compiler
This article describes how to enable ETM trace on Arm targets running Linux
and use the ETM trace to generate AutoFDO profiles and compile an optimized
program.
## Execution trace on Arm targets
Debug and trace of Arm targets is provided by CoreSight. This consists of
a set of components that allow access to debug logic, record (trace) the
execution of a processor and route this data through the system, collecting
it into a store.
To record the execution of a processor, we require the following
components:
* A trace source. The core contains a trace unit, called an ETM that emits
data describing the instructions executed by the core.
* Trace links. The trace data generated by the ETM must be moved through
the system to the component that collects the data (sink). Links
include:
* Funnels: merge multiple streams of data
* FIFOs: buffer data to smooth out bursts
* Replicators: send a stream of data to multiple components
* Sinks. These receive the trace data and store it or send it to an
external device:
* ETB: A small circular buffer (64-128 kilobytes) that stores the most
recent data
* ETR: A larger (several megabytes) buffer that uses system RAM to
store data
* TPIU: Sends data to an off-chip capture device (e.g. Arm DSTREAM)
Each Arm SoC design may have a different layout (topology) of components.
This topology is described to the OS drivers by the platform's devicetree
or (in future) ACPI firmware.
For application profiling, we need to store several megabytes of data
within the system, so will use ETR with the capture tool (perf)
periodically draining the buffer to a file.
Even though we have a large capture buffer, the ETM can still generate a
lot of data very quickly - typically an ETM will generate ~1 bit of data
per instruction (depending on the workload), which results in 256Mbytes per
second for a core running at 2GHz. This leads to problems storing and
decoding such large volumes of data. AutoFDO uses samples of program
execution, so we can avoid this problem by using the ETM's features to
only record small slices of execution - e.g. collect ~5000 cycles of data
every 50M cycles. This reduces the data rate to a manageable level - a few
megabytes per minute. This technique is known as 'strobing'.
## Enabling trace
### Driver support
To collect ETM trace, the CoreSight drivers must be included in the
kernel. Some of the driver support is not yet included in the mainline
kernel and many targets are using older kernels. To enable CoreSight trace
on these targets, Arm have provided backports of the latest CoreSight
drivers and ETM strobing patch at:
<https://gitlab.arm.com/linux-arm/linux-coresight-backports>
This repository can be cloned with:
```
git clone https://git.gitlab.arm.com/linux-arm/linux-coresight-backports.git
```
You can include these backports in your kernel by either merging the
appropriate branch using git or generating patches (using `git
format-patch`).
For 5.x based kernel onwards, the only patch which needs to be applied is the one enabling strobing - etm4x: `Enable strobing of ETM`.
For 4.9 based kernels, use the `coresight-4.9-etr-etm_strobe` branch:
```
git merge coresight-4.9-etr-etm_strobe
```
or
```
git format-patch --output-directory /output/dir v4.9..coresight-4.9-etr-etm_strobe
cd my_kernel
git am /output/dir/*.patch # or patch -p1 /output/dir/*.patch if not using git
```
For 4.14 based kernels, use the `coresight-4.14-etm_strobe` branch:
```
git merge coresight-4.14-etm_strobe
```
or
```
git format-patch --output-directory /output/dir v4.14..coresight-4.14-etm_strobe
cd my_kernel
git am /output/dir/*.patch # or patch -p1 /output/dir/*.patch if not using git
```
The CoreSight trace drivers must also be enabled in the kernel
configuration. This can be done using the configuration menu (`make
menuconfig`), selecting `Kernel hacking` / `arm64 Debugging` /`CoreSight Tracing Support` and
enabling all options, or by setting the following in the configuration
file:
```
CONFIG_CORESIGHT=y
CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y
CONFIG_CORESIGHT_SINK_TPIU=y
CONFIG_CORESIGHT_SOURCE_ETM4X=y
CONFIG_CORESIGHT_DYNAMIC_REPLICATOR=y
CONFIG_CORESIGHT_STM=y
CONFIG_CORESIGHT_CATU=y
```
Compile the kernel for your target in the usual way, e.g.
```
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
```
Each target may have a different layout of CoreSight components. To
collect trace into a sink, the kernel drivers need to know which other
devices need to be configured to route data from the source to the sink.
This is described in the devicetree (and in future, the ACPI tables). The
device tree will define which CoreSight devices are present in the system,
where they are located and how they are connected together. The devicetree
for some platforms includes a description of the platform's CoreSight
components, but in other cases you may have to ask the platform/SoC vendor
to supply it or create it yourself (see Appendix: Describing CoreSight in
Devicetree).
Once the target has been booted with the devicetree describing the
CoreSight devices, you should find the devices in sysfs:
```
# ls /sys/bus/coresight/devices/
etm0 etm2 etm4 etm6 funnel0 funnel2 funnel4 stm0 tmc_etr0
etm1 etm3 etm5 etm7 funnel1 funnel3 replicator0 tmc_etf0
```
The naming convention for etm devices can be different according to the kernel version you're using.
For more information about the naming scheme, please check out the [Linux Kernel Documentation](https://www.kernel.org/doc/html/latest/trace/coresight/coresight.html#device-naming-scheme)
If `/sys/bus/coresight/devices/` is empty, you may want to check out your Kernel configuration to make sure your .config file is including CoreSight dependencies, such as the clock.
### Perf tools
The perf tool is used to capture execution trace, configuring the trace
sources to generate trace, routing the data to the sink and collecting the
data from the sink.
Arm recommends to use the perf version corresponding to the kernel running
on the target. This can be built from the same kernel sources with
```
make -C tools/perf CORESIGHT=1 VF=1 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
```
When specifying CORESIGHT=1, perf will be built using the installed OpenCSD library.
If you are cross compiling, then additional setup is required to ensure the build process links against the correct version of the library.
If the post-processing (`perf inject`) of the captured data is not being
done on the target, then the OpenCSD library is not required for this build
of perf.
Trace is captured by collecting the `cs_etm` event from perf. The sink
to collect data into is specified as a parameter of this event. Trace can
also be restricted to user space or kernel space with 'u' or 'k'
parameters. For example:
```
perf record -e cs_etm/@tmc_etr0/u --per-thread -- /bin/ls
```
Will record the userspace execution of '/bin/ls' using tmc_etr0 as sink.
## Capturing modes
You can trace a single-threaded program in two different ways:
1. By specifying `--per-thread`, and in this case the CoreSight subsystem will
record only a trace relative to the given program.
2. By NOT specifying `--per-thread`, and in this case CPU-wide tracing will
be enabled. In this scenario the trace will contain both the target program trace
and other workloads that were executing on the same CPU
## Processing trace and profiles
perf is also used to convert the execution trace an instruction profile.
This requires a different build of perf, using the version of perf from
Linux v4.17 or later, as the trace processing code isn't included in the
driver backports. Trace decode is provided by the OpenCSD library
(<https://github.com/Linaro/OpenCSD>), v0.9.1 or later. This is packaged
for debian testing (install the libopencsd0, libopencsd-dev packages) or
can be compiled from source and installed.
The autoFDO tool <https://github.com/google/autofdo> is used to convert the
instruction profiles to source profiles for the GCC and clang/llvm
compilers.
## Recording and profiling
Once trace collection using perf is working, we can now use it to profile
an application.
The application must be compiled to include sufficient debug information to
map instructions back to source lines. For GCC, use the `-g1` or `-gmlt`
options. For clang/llvm, also add the `-fdebug-info-for-profiling` option.
perf identifies the active program or library using the build identifier
stored in the elf file. This should be added at link time with the compiler
flag `-Wl,--build-id=sha1`.
The next step is to record the execution trace of the application using the
perf tool. The ETM strobing should be configured before running the perf
tool. There are two parameters:
* window size: A number of CPU cycles (W)
* period: Trace is enabled for W cycle every _period_ * W cycles.
For example, a typical configuration is to use a window size of 5000 cycles
and a period of 10000 - this will collect 5000 cycles of trace every 50M
cycles. With these proof-of-concept patches, the strobe parameters are
configured via sysfs - each ETM will have `strobe_window` and
`strobe_period` parameters in `/sys/bus/coresight/devices/<sink>` and
these values will have to be written to each (In a future version, this
will be integrated into the drivers and perf tool).
The `set_strobing.sh` script in this directory [`<opencsd>/decoder/tests/auto-fdo`] automates this process.
To collect trace from an application using ETM strobing, run:
```
sudo ./set_strobing.sh 5000 10000
perf record -e cs_etm/@tmc_etr0/u --per-thread -- <your app>"
```
The raw trace can be examined using the `perf report` command:
```
perf report -D -i perf.data --stdio
```
Perf needs to be built from your linux kernel version souce code repository against the OpenCSD library in order to be able to properly read ETM-gathered samples and post-process them.
If running `perf report` produces an error like:
```
0x1f8 [0x268]: failed to process type: 70 [Operation not permitted]
Error:
failed to process sample
```
or
```
"file uses a more recent and unsupported ABI (8 bytes extra). incompatible file format".
```
You are probably using a perf version which is not using this library: please make sure to install this project in your system by either compiling it from [Source Code]( <https://github.com/Linaro/OpenCSD>) from v0.9.1 or later and compile perf using this library.
Otherwise, this project is packaged for debian (install the libopencsd0, libopencsd-dev packages).
For example:
```
0x1d370 [0x30]: PERF_RECORD_AUXTRACE size: 0x2003c0 offset: 0 ref: 0x39ba881d145f8639 idx: 0 tid: 4551 cpu: -1
. ... CoreSight ETM Trace data: size 2098112 bytes
Idx:0; ID:12; I_ASYNC : Alignment Synchronisation.
Idx:12; ID:12; I_TRACE_INFO : Trace Info.; INFO=0x0
Idx:17; ID:12; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFF000008A4991C;
Idx:48; ID:14; I_ASYNC : Alignment Synchronisation.
Idx:60; ID:14; I_TRACE_INFO : Trace Info.; INFO=0x0
Idx:65; ID:14; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFF000008A4991C;
Idx:96; ID:14; I_ASYNC : Alignment Synchronisation.
Idx:108; ID:14; I_TRACE_INFO : Trace Info.; INFO=0x0
Idx:113; ID:14; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFF000008A4991C;
Idx:122; ID:14; I_TRACE_ON : Trace On.
Idx:123; ID:14; I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0x0000000000407B00; Ctxt: AArch64,EL0, NS;
Idx:134; ID:14; I_ATOM_F3 : Atom format 3.; ENN
Idx:135; ID:14; I_ATOM_F5 : Atom format 5.; NENEN
Idx:136; ID:14; I_ATOM_F5 : Atom format 5.; ENENE
Idx:137; ID:14; I_ATOM_F5 : Atom format 5.; NENEN
Idx:138; ID:14; I_ATOM_F3 : Atom format 3.; ENN
Idx:139; ID:14; I_ATOM_F3 : Atom format 3.; NNE
Idx:140; ID:14; I_ATOM_F1 : Atom format 1.; E
.....
```
The execution trace is then converted to an instruction profile using
the perf build with trace decode support. This may be done on a different
machine than that which collected the trace (e.g. when cross compiling for
an embedded target). The `perf inject` command
decodes the execution trace and generates periodic instruction samples,
with branch histories:
!! Careful: if you are using a device different than the one used to collect the profiling data,
you'll need to run `perf buildid-cache` as described below.
```
perf inject -i perf.data -o inj.data --itrace=i100000il
```
The `--itrace` option configures the instruction sample behaviour:
* `i100000i` generates an instruction sample every 100000 instructions
(only instruction count periods are currently supported, future versions
may support time or cycle count periods)
* `l` includes the branch histories on each sample
* `b` generates a sample on each branch (not used here)
Perf requires the original program binaries to decode the execution trace.
If running the `inject` command on a different system than the trace was
captured on, then the binary and any shared libraries must be added to
perf's cache with:
```
perf buildid-cache -a /path/to/binary_or_library
```
`perf report` can also be used to show the instruction samples:
```
perf report -D -i inj.data --stdio
.......
0x1528 [0x630]: PERF_RECORD_SAMPLE(IP, 0x2): 4551/4551: 0x434b98 period: 3093 addr: 0
... branch stack: nr:64
..... 0: 0000000000434b58 -> 0000000000434b68 0 cycles P 0
..... 1: 0000000000436a88 -> 0000000000434b4c 0 cycles P 0
..... 2: 0000000000436a64 -> 0000000000436a78 0 cycles P 0
..... 3: 00000000004369d0 -> 0000000000436a60 0 cycles P 0
..... 4: 000000000043693c -> 00000000004369cc 0 cycles P 0
..... 5: 00000000004368a8 -> 0000000000436928 0 cycles P 0
..... 6: 000000000042d070 -> 00000000004368a8 0 cycles P 0
..... 7: 000000000042d108 -> 000000000042d070 0 cycles P 0
.......
..... 57: 0000000000448ee0 -> 0000000000448f24 0 cycles P 0
..... 58: 0000000000448ea4 -> 0000000000448ebc 0 cycles P 0
..... 59: 0000000000448e20 -> 0000000000448e94 0 cycles P 0
..... 60: 0000000000448da8 -> 0000000000448ddc 0 cycles P 0
..... 61: 00000000004486f4 -> 0000000000448da8 0 cycles P 0
..... 62: 00000000004480fc -> 00000000004486d4 0 cycles P 0
..... 63: 0000000000448658 -> 00000000004480ec 0 cycles P 0
... thread: program1:4551
...... dso: /home/root/program1
.......
```
The instruction samples produced by `perf inject` is then passed to the
autofdo tool to generate source level profiles for the compiler. For
clang/LLVM:
```
create_llvm_prof -binary=/path/to/binary -profile=inj.data -out=program.llvmprof
```
And for GCC:
```
create_gcov -binary=/path/to/binary -profile=inj.data -gcov_version=1 -gcov=program.gcov
```
The profiles can be viewed with:
```
llvm-profdata show -sample program.llvmprof
```
Or, for GCC:
```
dump_gcov -gcov_version=1 program.gcov
```
## Using profile in the compiler
The profile produced by the above steps can then be passed to the compiler
to optimize the next build of the program.
For GCC, use the `-fauto-profile` option:
```
gcc -O2 -fauto-profile=program.gcov -o program program.c
```
For Clang, use the `-fprofile-sample-use` option:
```
clang -O2 -fprofile-sample-use=program.llvmprof -o program program.c
```
## Summary
The basic commands to run an application and create a compiler profile are:
```
sudo ./set_strobing.sh 5000 10000
perf record -e cs_etm/@tmc_etr0/u --per-thread -- <your app>"
perf inject -i perf.data -o inj.data --itrace=i100000il
create_llvm_prof -binary=/path/to/binary -profile=inj.data -out=program.llvmprof
clang -O2 -fprofile-sample-use=program.llvmprof -o program program.c
```
Use `create_gcov` for gcc.
## High Level Summary for recoding on Arm board and decoding on different host
1. (on Arm board)
sudo ./set_strobing.sh 5000 10000
perf record -e cs_etm/@tmc_etr0/u --per-thread -- <your app>.
If you specify `-N, --no-buildid-cache`, perf will just take care of recording the target binary and nothing will be copied.<br> If you don't specify it, any recorded dynamic library will be copied to ~/.debug in the board.
2. (on Arm board) `perf archive` which saves all the found libraries in a tar (internally, it looks into perf.data file and performs a lookup using perf-buildid-list --with-hits)
3. (on host) `scp` to copy perf.data and the .tar file generated from `perf archive`.
4. (on host) Run `tar xvf perf_data.tar.bz2 -C ~/.debug` to populate the buildid-cache
5. (on host) Double check the setup is correct:
a. `perf buildid-list -i perf.data` gives you the list of dynamic libraries buildids whose trace has been recorded and saved in perf.data.
b. `perf buildid-cache --list` lists the dynamic libraries in the buildid cache that will be used by `perf inject`.
Make sure the output of (a) and (b) overlaps as in buildid value for those binaries you are interested into optimizing with afdo.
6. (on host) `perf inject -i perf.data -o inj.data --itrace=i100000il` will check for the dynamic libraries using the buildid inside the buildid-cache and post-process the trace.<br> buildids have to be the same, otherwise it won't be possible to post-process the trace.
7. (on host) `create_llvm_prof -binary=/path/to/binary -profile=inj.data -out=program.llvmprof` takes the output from perf-inject and tranforms it into a format that the compiler can read.
8. (on host) `clang -O2 -fprofile-sample-use=program.llvmprof -o program program.c` to make clang use the produced profile.<br>
If you are confident enough that your profile is accurate, you can add the `-fprofile-sample-accurate` flag, which will penalize all the callsites without corresponding profile, marking them as cold.
If you are using the same host for both building the binary to be traced and re-building it with afdo:
1. You won't need to copy back any dynamic libraries from the board (since you already have them), and can use `--no-buildid-cache` when recording
2. You have to make sure the relevant dynamic libraries to be optimized are present in the buildid-cache.
You can easily add a dynamic library manually into the build-id cache by running:
`perf buildid-cache --add <path/to/library/or/binary> -vvv`
You can easily check what is currently contained in you buildid-cache by running:
`perf buildid-cache --list`
You can check the buildid of a given binary/dynamic library:
`file <path/to/dynamic/library>`
## References
* AutoFDO tool: <https://github.com/google/autofdo>
* GCC's wiki on autofdo: <https://gcc.gnu.org/wiki/AutoFDO>, <https://gcc.gnu.org/wiki/AutoFDO/Tutorial>
* Google paper: <https://ai.google/research/pubs/pub45290>
* CoreSight kernel docs: Documentation/trace/coresight.txt
## Appendix: Describing CoreSight in Devicetree
Each component has an entry in the device tree that describes its:
* type: The `compatible` field defines which driver to use
* location: A `reg` defines the component's address and size on the bus
* clocks: The `clocks` and `clock-names` fields state which clock provides
the `apb_pclk` clock.
* connections to other components: `port` and `ports` field link the
component to ports of other components
To create the device tree, some information about the platform is required:
* The memory address of the CoreSight components. This is the address in
the CPU's address space where the CPU can access each CoreSight
component.
* The connections between the components.
This information can be found in the SoC's reference manual or you may need
to ask the platform/SoC vendor to supply it.
An ETMv4 source is declared with a section like this:
```
etm0: etm@22040000 {
compatible = "arm,coresight-etm4x", "arm,primecell";
reg = <0 0x22040000 0 0x1000>;
cpu = <&A72_0>;
clocks = <&soc_smc50mhz>;
clock-names = "apb_pclk";
port {
cluster0_etm0_out_port: endpoint {
remote-endpoint = <&cluster0_funnel_in_port0>;
};
};
};
```
This describes an ETMv4 attached to core A72_0, located at 0x22040000, with
its output linked to port 0 of a funnel. The funnel is described with:
```
funnel@220c0000 { /* cluster0 funnel */
compatible = "arm,coresight-funnel", "arm,primecell";
reg = <0 0x220c0000 0 0x1000>;
clocks = <&soc_smc50mhz>;
clock-names = "apb_pclk";
power-domains = <&scpi_devpd 0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
cluster0_funnel_out_port: endpoint {
remote-endpoint = <&main_funnel_in_port0>;
};
};
port@1 {
reg = <0>;
cluster0_funnel_in_port0: endpoint {
slave-mode;
remote-endpoint = <&cluster0_etm0_out_port>;
};
};
port@2 {
reg = <1>;
cluster0_funnel_in_port1: endpoint {
slave-mode;
remote-endpoint = <&cluster0_etm1_out_port>;
};
};
};
};
```
This describes a funnel located at 0x220c0000, receiving data from 2 ETMs
and sending the merged data to another funnel. We continue describing
components with similar blocks until we reach the sink (an ETR):
```
etr@20070000 {
compatible = "arm,coresight-tmc", "arm,primecell";
reg = <0 0x20070000 0 0x1000>;
iommus = <&smmu_etr 0>;
clocks = <&soc_smc50mhz>;
clock-names = "apb_pclk";
power-domains = <&scpi_devpd 0>;
port {
etr_in_port: endpoint {
slave-mode;
remote-endpoint = <&replicator_out_port1>;
};
};
};
```
Full descriptions of the properties of each component can be found in the
Linux source at Documentation/devicetree/bindings/arm/coresight.txt.
The Arm Juno platform's devicetree (arch/arm64/boot/dts/arm) provides an example
description of CoreSight description.
Many systems include a TPIU for off-chip trace. While this isn't required
for self-hosted trace, it should still be included in the devicetree. This
allows the drivers to access it to ensure it is put into a disabled state,
otherwise it may limit the trace bandwidth causing data loss.

View File

@ -0,0 +1,91 @@
########################################################
# Copyright 2015 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.
#
#################################################################################
########
# RCTDL - test makefile for simple c api packet list test.
#
CC := $(MASTER_CC)
LINKER := $(MASTER_LINKER)
PROG = c_api_pkt_print_test
BUILD_DIR=./$(PLAT_DIR)
VPATH = $(OCSD_TESTS)/source
CC_INCLUDES = \
-I$(OCSD_TESTS)/source \
-I$(OCSD_TESTS)/ext_dcd_test_eg/c_api_echo_test \
-I$(OCSD_INCLUDE)
OBJECTS = $(BUILD_DIR)/c_api_pkt_print_test.o
LIBS = -L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME) -l$(LIB_CAPI_NAME) \
-L$(LIB_TEST_TARGET_DIR) -l_echo_test_dcd
all: copy_libs
test_app: $(BIN_TEST_TARGET_DIR)/$(PROG)
$(BIN_TEST_TARGET_DIR)/$(PROG): $(OBJECTS) | build_dir
mkdir -p $(BIN_TEST_TARGET_DIR)
$(LINKER) $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG)
cp $(LIB_TARGET_DIR)/*.so .
build_dir:
mkdir -p $(BUILD_DIR)
.PHONY: copy_libs
copy_libs: $(BIN_TEST_TARGET_DIR)/$(PROG)
cp $(LIB_TARGET_DIR)/*.so $(BIN_TEST_TARGET_DIR)/.
#### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.c | build_dir
$(CC) $(CFLAGS) $(CC_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean :
-rm $(BIN_TEST_TARGET_DIR)/$(PROG) $(OBJECTS)
-rm $(DEPS)
-rm ./*.so
-rmdir $(BUILD_DIR)
# end of file makefile

View File

@ -0,0 +1,78 @@
########################################################
# Copyright 2016 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.
#
#################################################################################
# OpenCSD - makefile for external echo_test decoder.
#
CC := $(MASTER_CC)
LIB := $(MASTER_LIB)
LIB_NAME = lib_echo_test_dcd
BUILD_DIR=./$(PLAT_DIR)
ECHO_TEST_PATH=$(OCSD_TESTS)/ext_dcd_test_eg/c_api_echo_test
VPATH = $(ECHO_TEST_PATH)
CC_INCLUDES = \
-I$(ECHO_TEST_PATH) \
-I$(OCSD_INCLUDE)
OBJECTS = $(BUILD_DIR)/ext_dcd_echo_test.o \
$(BUILD_DIR)/ext_dcd_echo_test_fact.o
all: $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a
$(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a: $(OBJECTS) | build_dir
mkdir -p $(LIB_TEST_TARGET_DIR)
$(LIB) $(ARFLAGS) $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a $(OBJECTS)
build_dir:
mkdir -p $(BUILD_DIR)
#### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.c | build_dir
$(CC) $(CFLAGS) $(CC_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean:
-rm $(OBJECTS)
-rm $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a
-rm $(DEPS)
-rmdir $(BUILD_DIR) $(LIB_TEST_TARGET_DIR)
# end of file makefile

View File

@ -0,0 +1,88 @@
########################################################
# Copyright 2022 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.
#
#################################################################################
########
# opencsd: makefile for the frame demux test program
#
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
PROG = frame-demux-test
BUILD_DIR=./$(PLAT_DIR)
VPATH = $(OCSD_TESTS)/source
CXX_INCLUDES = \
-I$(OCSD_TESTS)/source \
-I$(OCSD_INCLUDE)
OBJECTS = $(BUILD_DIR)/frame_demux_test.o
LIBS = -L$(LIB_TEST_TARGET_DIR) -L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME)
all: copy_libs
test_app: $(BIN_TEST_TARGET_DIR)/$(PROG)
$(BIN_TEST_TARGET_DIR)/$(PROG): $(OBJECTS) | build_dir
mkdir -p $(BIN_TEST_TARGET_DIR)
$(LINKER) $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG)
build_dir:
mkdir -p $(BUILD_DIR)
.PHONY: copy_libs
copy_libs: $(BIN_TEST_TARGET_DIR)/$(PROG)
cp $(LIB_TARGET_DIR)/*.so* $(BIN_TEST_TARGET_DIR)/.
#### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | build_dir
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean :
-rm $(BIN_TEST_TARGET_DIR)/$(PROG) $(OBJECTS)
-rm $(DEPS)
-rm $(BIN_TEST_TARGET_DIR)/*.so*
-rmdir $(BUILD_DIR)
# end of file makefile

View File

@ -0,0 +1,90 @@
########################################################
# Copyright 2019 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.
#
#################################################################################
########
# RCTDL - test makefile for snapshot lister test.
#
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
PROG = mem-buffer-eg
BUILD_DIR=./$(PLAT_DIR)
VPATH = $(OCSD_TESTS)/source
CXX_INCLUDES = \
-I$(OCSD_TESTS)/source \
-I$(OCSD_INCLUDE) \
-I$(OCSD_TESTS)/snapshot_parser_lib/include
OBJECTS = $(BUILD_DIR)/mem_buff_demo.o
LIBS = -L$(LIB_TEST_TARGET_DIR) -lsnapshot_parser \
-L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME)
all: copy_libs
test_app: $(BIN_TEST_TARGET_DIR)/$(PROG)
$(BIN_TEST_TARGET_DIR)/$(PROG): $(OBJECTS) | build_dir
mkdir -p $(BIN_TEST_TARGET_DIR)
$(LINKER) $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG)
build_dir:
mkdir -p $(BUILD_DIR)
.PHONY: copy_libs
copy_libs: $(BIN_TEST_TARGET_DIR)/$(PROG)
cp $(LIB_TARGET_DIR)/*.so* $(BIN_TEST_TARGET_DIR)/.
#### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | build_dir
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean :
-rm $(BIN_TEST_TARGET_DIR)/$(PROG) $(OBJECTS)
-rm $(DEPS)
-rm $(BIN_TEST_TARGET_DIR)/*.so*
-rmdir $(BUILD_DIR)
# end of file makefile

View File

@ -0,0 +1,92 @@
########################################################
# Copyright 2015 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.
#
########################################################################
#
# Make file for snapshot parser library.
#
########################################################################
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
LIB := $(MASTER_LIB)
# avoid build warnings in donated test code
WSUPPRESS= -Wno-deprecated-declarations -Wno-unused-variable -Wno-reorder
CXXFLAGS += $(WSUPPRESS)
LIB_NAME = libsnapshot_parser
BUILD_DIR=./$(PLAT_DIR)
PARSER_ROOT=$(OCSD_TESTS)/snapshot_parser_lib
PARSER_SOURCE=$(PARSER_ROOT)/source
PARSER_INCLUDE=$(PARSER_ROOT)/include
VPATH= $(PARSER_SOURCE)
CXX_INCLUDES= \
-I$(PARSER_INCLUDE) \
-I$(OCSD_INCLUDE)
OBJECTS=$(BUILD_DIR)/device_info.o \
$(BUILD_DIR)/device_parser.o \
$(BUILD_DIR)/snapshot_parser.o \
$(BUILD_DIR)/snapshot_parser_util.o \
$(BUILD_DIR)/snapshot_reader.o \
$(BUILD_DIR)/ss_to_dcdtree.o
all: $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a
$(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a: $(OBJECTS) | build_dir
mkdir -p $(LIB_TEST_TARGET_DIR)
$(LIB) $(ARFLAGS) $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a $(OBJECTS)
build_dir:
mkdir -p $(BUILD_DIR)
##### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | build_dir
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
### clean
.PHONY: clean
clean:
-rm $(OBJECTS)
-rm $(DEPS)
-rm $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a
-rmdir $(BUILD_DIR) $(LIB_TEST_TARGET_DIR)

View File

@ -0,0 +1,103 @@
########################################################
# Copyright 2015 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.
#
#################################################################################
########
# RCTDL - test makefile for snapshot lister test.
#
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
PROG = trc_pkt_lister
PROG_S = trc_pkt_lister_s
BUILD_DIR=./$(PLAT_DIR)
VPATH = $(OCSD_TESTS)/source
CXX_INCLUDES = \
-I$(OCSD_TESTS)/source \
-I$(OCSD_INCLUDE) \
-I$(OCSD_TESTS)/snapshot_parser_lib/include
OBJECTS = $(BUILD_DIR)/trc_pkt_lister.o
LIBS = -L$(LIB_TEST_TARGET_DIR) -lsnapshot_parser \
-L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME)
all: copy_libs
test_app: $(BIN_TEST_TARGET_DIR)/$(PROG)
$(BIN_TEST_TARGET_DIR)/$(PROG): $(OBJECTS) | build_dir
mkdir -p $(BIN_TEST_TARGET_DIR)
$(LINKER) $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG)
$(BIN_TEST_TARGET_DIR)/$(PROG_S): $(OBJECTS) | build_dir
mkdir -p $(BIN_TEST_TARGET_DIR)
$(LINKER) -static $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG_S)
build_dir:
mkdir -p $(BUILD_DIR)
.PHONY: copy_libs
ifdef TEST_STATIC_LINKING
copy_libs: $(BIN_TEST_TARGET_DIR)/$(PROG_S)
endif
copy_libs: $(BIN_TEST_TARGET_DIR)/$(PROG)
cp $(LIB_TARGET_DIR)/*.so* $(BIN_TEST_TARGET_DIR)/.
#### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | build_dir
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean :
-rm $(BIN_TEST_TARGET_DIR)/$(PROG) $(OBJECTS)
ifdef TEST_STATIC_LINKING
-rm $(BIN_TEST_TARGET_DIR)/$(PROG_S)
endif
-rm $(DEPS)
-rm $(BIN_TEST_TARGET_DIR)/*.so*
-rmdir $(BUILD_DIR)
# end of file makefile

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win32\rel\c_api_pkt_print_test-dl.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win32\rel\c_api_pkt_print_test.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

Some files were not shown because too many files have changed in this diff Show More