• Stars
    star
    140
  • Rank 261,473 (Top 6 %)
  • Language
    C++
  • License
    Other
  • Created over 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CoreSight trace stream decoder developed openly

OpenCSD - An open source CoreSight(tm) Trace Decode library {#mainpage}

This library provides an API suitable for the decode of ARM(r) CoreSight(tm) trace streams.

The library will decode formatted trace in three stages:

  1. Frame Deformatting : Removal CoreSight frame formatting from individual trace streams.
  2. Packet Processing : Separate individual trace streams into discrete packets.
  3. Packet Decode : Convert the packets into fully decoded trace describing the program flow on a core.

The library is implemented in C++ with an optional "C" API.

Library Versioning

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).
    • 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.

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: [email protected]

More Repositories

1

vixl

AArch32 and AArch64 Runtime Code Generation Library
C
126
star
2

lava

Read only mirror https://gitlab.com/lava/lava
Python
72
star
3

meta-qcom

OpenEmbedded/Yocto Project BSP layer for Qualcomm based platforms
BitBake
62
star
4

squad

Software Quality Dashboard
Python
59
star
5

documentation

43
star
6

uadk

UADK (User space Accelerator Development Kit), is a user space framework for using accelerators. Active branch is 'master'.
C
41
star
7

test-definitions

Test definitions work with and without LAVA
Shell
36
star
8

works-on-woa

Website repository for worksonwoa.com
TypeScript
36
star
9

lava-server

Python
32
star
10

website

This repository stores the content used in our static Jekyll based website. If you need to make a change to the website please submit a PR to this repository with your changes.
HTML
25
star
11

ansible-playbook-for-ohpc

Ansible playbook for OpenHPC
Shell
24
star
12

openstack-exporter

Prometheus openstack exporter written in Golang.
Go
22
star
13

aerology

Inspect Zephyr and TFM applications, post mortem
Rust
18
star
14

msm

Qualcomm mainline status
Python
18
star
15

lava-dispatcher

Merged into a single codebase with lava-server
Python
15
star
16

zephyr_confidential_ai

Confidential AI sample application for Zephyr RTOS
C++
14
star
17

odp-thunderx

Cavium ThunderX implimentation of ODP
C
13
star
18

step

Secure data pipeline proof of concept module for Zephyr RTOS
C
11
star
19

tinyBLAS

A fork of OpenBLAS with Armv8-A SVE (Scalable Vector Extension) support
Fortran
11
star
20

freertos-pkcs11-psa

FreeRTOS PSA PKCS11
C
10
star
21

lite_bootstrap_server

Proof of concept certificate authority and bootstrap server
Go
10
star
22

hcqc

hcqc - HPC compiler quality checker
C
9
star
23

linux-kernel-uadk

linux kernel for UADK (also known as 'warpdrive')
C
8
star
24

meta-ledge

Shell
7
star
25

ecosystemlandscape

JavaScript
7
star
26

Connect

The static Jekyll site for Linaro Connect Event
HTML
7
star
27

squad-client

squad-client is a tool to ease fetching api data from a SQUAD instance
Python
6
star
28

jipdate

Linaro JIRA Update Tool
Python
6
star
29

django-crowd-rest-backend

Fork of https://bitbucket.org/manuelkoch/django-crowd-rest-backend with fixes and improvements.
Python
6
star
30

uadk_engine

OpenSSL engine for uadk.
C
6
star
31

git-gpgcrypt

Transparent git content encryption backed by GPG public key infrastructure
Shell
6
star
32

vmspec-tools

Tools for verifying vmspec compliance
Python
5
star
33

hpc_lab_setup

Jenkins Jobs for HPC Lab
Python
5
star
34

freertos-ota-pal-psa

C
5
star
35

lite-lava-docker-compose

LITE Team LAVA docker dispatcher
Python
5
star
36

poplar-tools

4
star
37

OpenPlatformPkg

Development tree. Check https://git.linaro.org/uefi/OpenPlatformPkg.git for the upstream tree.
C
4
star
38

poplar-linux

Linux Kernel for Poplar
4
star
39

hpc_lustreci

HPC-SIG Lustre CI
Shell
3
star
40

erp-test-automation

Tools and scripts to automate hardware for the purposes of ERP testing.
Python
3
star
41

lkft-website

Linaro's Linux Kernel Functional Testing Website
JavaScript
3
star
42

lava-test-plans

Jinja
3
star
43

pkg-lava-tool

Debian and Ubuntu packaging for the lava-tool component of LAVA
3
star
44

lava-functional-tests

Shell
3
star
45

qemu

This is a fork from Official QEMU source repository. What's added is the support of vSVA: sharing guest application address space with passthrough devices. It's part of UADK (WarpDrive) ecosystem.
C
3
star
46

kir

Shell
2
star
47

hpc_benchmark_analysis

Random scripts to interpret benchmark / profiling results
Python
2
star
48

cloud

An open cloud for development in the ARMv8 server ecosystem (static Jekyll website files)
JavaScript
2
star
49

qa-reports-known-issues

Python
2
star
50

benchmark_harness

Harness to run benchmarks with options for different machines and different compilers
Python
2
star
51

magnum

Python
2
star
52

mr-provisioner-client

Python library to use Mr-Provisioner's API
Python
2
star
53

smartnic

SmartNIC Project
2
star
54

hpc_tensorflowci

HPC-SIG Tensorflow CI
Shell
2
star
55

qa-reports.linaro.org

ansible code for deploying qa-reports.linaro.org
HCL
2
star
56

mcumux

Muxer for mcumgr and debug messages over same port.
Go
2
star
57

lkft-tools

Tools for LKFT developers
Python
2
star
58

test-kernel-public

Repo for public test
C
2
star
59

lite-jailhouse

Example of using Jailhouse as a hypervisor with Zephyr RTOS and QEMU
C
2
star
60

lite-lava

Fork of LAVA repo with LITE changes
Python
2
star
61

lite-cornea

A command line shim to interact with the Iris Debug server of an ARM FVP
Rust
1
star
62

lustretest

Python
1
star
63

pkg-lava-dispatcher

Debian and Ubuntu packaging for the lava-dispatcher component of LAVA
1
star
64

ledge-uboot

C
1
star
65

poplar-l-loader

l-loader for Poplar
1
star
66

lite-flow

LITE Cryptographic Workflow Demonstration
Rust
1
star
67

pkg-lava-coordinator

Debian and Ubuntu packaging for the lava-coordinator component of LAVA
1
star
68

jira-metadata

JIRA metadata schemas used for Linaro JIRA instances
1
star
69

ai_security_courseware

A detailed course to introduce aspects of AI on Security
1
star
70

pkg-lavacli

Debian and Ubuntu packaging for the lavacli component of LAVA
1
star
71

poplar-u-boot

U-Boot for Poplar
1
star
72

rpms-kernel

Kernel Source RPM repository Edit Add topics
1
star
73

linux-canaries

Various Linux kernel branches that fail in specific ways; Used to validate CI services and infrastructure.
1
star
74

ledge-oe-manifest

Shell
1
star
75

aionservers

Aspiring code to enable expanding novel approaches to using ML Frameworks for the broader topic of AI
1
star
76

poplar-arm-trusted-firmware

ATF for Poplar
1
star
77

iotboot

Bootloader for IOT
C
1
star
78

trs

Trusted Reference Stack by Linaro
Makefile
1
star
79

mr-provisioner-kea-dhcp4-role

Ansible role for installing/upgrade a kea-dhcp4 server required for a Mr. Provisioner installation.
1
star
80

ansible-role-mr-provisioner

Provision a host using Mr. Provisioner
Python
1
star
81

hwpack_arndale

Arndale (Exynos 5250) hardware pack
1
star
82

ansible-role-erp-get-build

Download an Enterprise Reference Platform (ERP) release
1
star
83

lavasoftware

Repository for the https://lavasoftware.org/ static website.
SCSS
1
star
84

squadplugins

Python
1
star
85

zephyr-ivshmem

IVSHMEM dual test bed sample app for Zephyr RTOS
C
1
star