-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6d0115
commit 970f779
Showing
4 changed files
with
19 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
# Timestamp | ||
|
||
In the current implementation timestamps are absolute (time elapsed since the start of the program) and in microseconds. | ||
Timestamps are LEB128 encoded before serialization. | ||
`defmt::timestamp!` needs to be as efficient as possible, because it is implicitly invoked on every single log invocation. | ||
|
||
> TODO we may want to consider using delta encoding in the future | ||
The timestamp format string index is not transmitted over the wire. | ||
Instead, it is marked with a `defmt_timestamp` tag and the decoder loads it from the ELF file. | ||
Linker magic is used to make sure that it doesn't get defined twice, and that the symbol doesn't get discarded (which can happen since its address is never used). | ||
|
||
The `µs` format specifier was introduced to allow replicating the timestamp format of previous defmt versions, which always used a LEB128-encoded `u64` timestamp and treated it as a number of microseconds. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters