Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 5dff051

Browse files
bors[bot]japaric
andcommitted
Merge #24
24: add support for all ITM packet types and replace Decoder with Stream parser r=therealprof a=japaric as this is a breaking change and requires a minor version bump, this commit also: - sets MSRV to 1.31.0 - changes the crate edition to 2018 - removes `itmdump` (more info below) --- The rationale for dropping the existing `Decoder` API is that it doesn't handle well streams of data that contain errors, like missing bytes (occurs in ~0.2% of packets according to my unscientific measurements). Namely, `Decoder` can't backtrack the stream because it has no internal buffer; meaning that once a byte is lost it will continue to parse packets with an offset of one (i.e. the first byte of the payload will be treated as the packet header) leading to a cascade of errors. The `Stream` API has an internal buffer so when it encounters a packet error due to a missing byte it can backtrack the stream and retry parsing from the most likely place. Also, thanks to the internal buffer `Stream` greatly reduces the number of read syscalls -- the `Decoder` API was doing 1-byte read syscalls in some places. (For historic purposes, I have pushed [the branch] where I was adding full parsing support to the `Decoder` API) [the branch]: https://github.com/rust-embedded/itm/tree/decoder With this new API and support for all the different ITM packets I have created a set of tools ([`itm-tools`]) for analyzing ITM traces. One of the tools, `port-demux`, is a more general version of `itmdump` and should be preferred over it. The other reason for removing `itmdump` and not providing tools in this crate is that it makes version management easier: breaking changes in the library don't necessarily mean breaking changes in the tool CLI. [`itm-tools`]: https://github.com/japaric/itm-tools r? @rust-embedded/tools cc @rust-embedded/cortex-m Co-authored-by: Jorge Aparicio <[email protected]>
2 parents 413b5e8 + 0d7db91 commit 5dff051

File tree

11 files changed

+1511
-1124
lines changed

11 files changed

+1511
-1124
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.rs.bk
22
.#*
3+
Cargo.lock
34
target

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ matrix:
44
include:
55
- env: TARGET=x86_64-unknown-linux-gnu
66
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
7+
# MSRV
8+
rust: 1.31.0
79

810
before_install:
911
- set -e

0 commit comments

Comments
 (0)