Skip to content

Commit 07f8706

Browse files
authored
Merge pull request #14 from IBM/jo5ta/dev
fix typos
2 parents 8b06da9 + c15038b commit 07f8706

File tree

34 files changed

+108
-154
lines changed

34 files changed

+108
-154
lines changed

README.md

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -42,54 +42,6 @@ The tracepoints `CLLTK_TRACEPOINT` defines first the target tracebuffer, than th
4242
`decoder_tool/python/clltk_decoder.py <path to tracebuffers>`
4343
8. View your traces in `output.csv`
4444
45-
## Build Requirements
46-
### Base Library build
47-
- cmake (>=3.18)
48-
- gcc (>=10.0)
49-
- g++ (>=10.0)
50-
- git
51-
- file
52-
- rsync
53-
- gettext
54-
- libtar-dev
55-
56-
### CLI tool build
57-
- libcli11-dev
58-
- nlohmann-json3-dev
59-
60-
### Library Unit tests
61-
- valgrind
62-
- openjdk-17-jdk
63-
- openssl
64-
- lcov
65-
- gcovr
66-
67-
### Kernel module build
68-
- make
69-
- curl
70-
- rpm
71-
- elfutils
72-
- clang
73-
- ll
74-
- llvm
75-
- libelf-dev
76-
- build-essential
77-
- flex
78-
- bison
79-
- bc
80-
- libncurses-dev
81-
- libssl-dev
82-
- kmod
83-
84-
### Kernel module tests
85-
- busybox-static
86-
- strace
87-
- cpio
88-
- qemu-system
89-
90-
## Runtime Requirements
91-
- non
92-
9345
## Security Considerations
9446
**Tampering with Trace Files**: Any modification or tampering with the trace files can cause the library to **crash or potentially freeze** the system. Ensure the integrity of these files is maintained to avoid instability.
9547
@@ -159,15 +111,15 @@ It is also possible to cross compile with the container env by using of example:
159111
To build this repository for test purposes or development run:
160112

161113
```bash
162-
./scripts/ci-cd/build_userspace.shs
114+
./scripts/ci-cd/build_userspace.sh
163115
```
164116

165117
### Tests tracing standalone
166118

167119
To run all test build the whole project with cmake and than run:
168120

169121
```bash
170-
./scripts/ci-cd/test_userspace.shs
122+
./scripts/ci-cd/test_userspace.sh
171123
```
172124

173125
This will run all c++ and python tests.

VERSION.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
1.2.48
1+
1.2.49
22

33
# Change log
4+
## 1.2.49
5+
- fix typos
46
## 1.2.48
57
refactor: reorganize include structure and improve project layout
68
- Renamed project from CommoneLowLevelTracingKit to CommonLowLevelTracingKit (correcting typo).

decoder_tool/cpp/include/CommonLowLevelTracingKit/decoder/Tracebuffer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace CommonLowLevelTracingKit::decoder {
3535
const std::filesystem::path m_path;
3636
};
3737

38-
// Synchonous Tracebuffer
38+
// Synchronous Tracebuffer
3939
struct SyncTracebuffer;
4040
using SyncTracebufferPtr = std::unique_ptr<SyncTracebuffer>;
4141
struct EXPORT SyncTracebuffer : Tracebuffer {

decoder_tool/cpp/source/low_level/formatter.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include "inline.hpp"
1414

15-
namespace formater = CommonLowLevelTracingKit::decoder::source::formatter;
15+
namespace formatter = CommonLowLevelTracingKit::decoder::source::formatter;
1616
using namespace CommonLowLevelTracingKit::decoder::exception;
1717
using namespace std::string_literals;
1818

@@ -39,7 +39,7 @@ CONST_INLINE static constexpr ffi_type *clltk_type_to_ffi_type(const char clltk_
3939
case 's': return &ffi_type_pointer;
4040
case 'p': return &ffi_type_pointer;
4141
case InvalidStringArgType: return &ffi_type_pointer;
42-
default: CLLTK_DECODER_THROW(FormattingFailed, "unkown type");
42+
default: CLLTK_DECODER_THROW(FormattingFailed, "unknown type");
4343
}
4444
}
4545
CONST_INLINE static constexpr size_t
@@ -71,13 +71,13 @@ clltk_arg_to_size(const char clltk_type, const uintptr_t clltk_arg, size_t remai
7171
}
7272
case 'p': return sizeof(void *);
7373
case InvalidStringArgType: return sizeof(void *);
74-
default: CLLTK_DECODER_THROW(FormattingFailed, "unkown type");
74+
default: CLLTK_DECODER_THROW(FormattingFailed, "unknown type");
7575
}
7676
}
7777
template <typename T, typename ProxyT = T>
7878
static INLINE const any get_native(uintptr_t p, size_t remaining) {
7979
if (sizeof(T) > remaining) [[unlikely]]
80-
CLLTK_DECODER_THROW(FormattingFailed, "out of range access for formater");
80+
CLLTK_DECODER_THROW(FormattingFailed, "out of range access for formatter");
8181
T value{};
8282
memcpy(&value, std::bit_cast<void *>(p), sizeof(T));
8383
static_assert(sizeof(ProxyT) == sizeof(void *));
@@ -105,7 +105,7 @@ INLINE static constexpr any clltk_arg_to_native(const char clltk_type, const uin
105105
// the value in clltk_arg is a pointer to a now invalid/unusable memory address.
106106
// replace it with a dummy arg string
107107
return std::bit_cast<uint64_t>(&InvalidStringArg);
108-
default: CLLTK_DECODER_THROW(FormattingFailed, "unkown type");
108+
default: CLLTK_DECODER_THROW(FormattingFailed, "unknown type");
109109
}
110110
}
111111

@@ -120,7 +120,7 @@ clltk_args_to_native_args(const std::string_view format, const std::span<const c
120120
for (size_t i = 0; i < clltk_types.size(); i++) {
121121
const char type = clltk_types[i];
122122
if (raw_arg_offset >= raw_clltk_args.size()) [[unlikely]]
123-
CLLTK_DECODER_THROW(FormattingFailed, "out of range access for formater");
123+
CLLTK_DECODER_THROW(FormattingFailed, "out of range access for formatter");
124124
const uintptr_t current = std::bit_cast<uintptr_t>(&raw_clltk_args[raw_arg_offset]);
125125
const size_t remaining = raw_clltk_args.size() - raw_arg_offset;
126126
const any value = clltk_arg_to_native(type, current, remaining);
@@ -183,7 +183,7 @@ INLINE static auto fix_types_based_on_format(const std::string_view format,
183183
}
184184
}
185185
if (arg_count != raw_types.size()) [[unlikely]]
186-
CLLTK_DECODER_THROW(FormattingFailed, "invalid format secifier");
186+
CLLTK_DECODER_THROW(FormattingFailed, "invalid format specifier");
187187
return out;
188188
}
189189

@@ -244,8 +244,8 @@ static INLINE std::string clean_up_str_view(const std::string_view str) {
244244
}
245245

246246
// call snprintf with ffi
247-
std::string formater::printf(const std::string_view format, const std::span<const char> &types_raw,
248-
const std::span<const uint8_t> &args_raw) {
247+
std::string formatter::printf(const std::string_view format, const std::span<const char> &types_raw,
248+
const std::span<const uint8_t> &args_raw) {
249249
if (format.empty()) return "";
250250
if (*format.end() != '\0') CLLTK_DECODER_THROW(FormattingFailed, "missing format termination");
251251
const auto fixed_typ_array = fix_types_based_on_format(format, types_raw);
@@ -325,8 +325,8 @@ std::string formater::printf(const std::string_view format, const std::span<cons
325325
return msg;
326326
}
327327

328-
std::string formater::dump(const std::string_view format, const std::span<const char> &types_raw,
329-
const std::span<const uint8_t> &args_raw) {
328+
std::string formatter::dump(const std::string_view format, const std::span<const char> &types_raw,
329+
const std::span<const uint8_t> &args_raw) {
330330
if (types_raw.size() != 1 || types_raw[0] != 'x')
331331
CLLTK_DECODER_THROW(InvalidMeta, "wrong meta for drump tracepoint");
332332
const size_t format_size = format.size();

decoder_tool/python/clltk_decoder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def __init__(self, entry: Ringbuffer_Entry, meta: Stack_Entry):
434434

435435
self.line = get_int(meta.body, self.metaentry_in_metablob + 6, 4)
436436

437-
# get argument informations
437+
# get argument information
438438
self.argument_count = get_int(
439439
meta.body, self.metaentry_in_metablob + 10, 1)
440440
self.argument_type_array = get(meta.body, self.metaentry_in_metablob +
@@ -474,7 +474,7 @@ def __init__(self, entry: Ringbuffer_Entry, meta: Stack_Entry):
474474

475475
assert self.argument_count == len(formats), \
476476
f"argument types are {self.arg_types} \n"\
477-
+ f"but formates {formats} for type {self.type} and format \"{self.format}\""\
477+
+ f"but formats {formats} for type {self.type} and format \"{self.format}\""\
478478
+ f" at {self.file}:{self.line}"
479479

480480

@@ -580,7 +580,7 @@ def get_arg(raw: bytes, offset: int, t: int, format: dict):
580580
value = " ".join(f"{x:02X}" for x in value)
581581
offset += string_length
582582
else:
583-
assert 0, "type unkown"
583+
assert 0, "type unknown"
584584

585585
return (offset, value)
586586

@@ -666,7 +666,7 @@ def __init__(self, raw: bytes, recover_all:bool=False):
666666
continue
667667

668668
if all(character.isspace() for character in entry.formatted):
669-
logging.info("empty trace entry skiped")
669+
logging.info("empty trace entry skipped")
670670
self.entries.append(entry)
671671
pass
672672

docs/diagrams/clltk_flow_tracebuffer.drawio

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
<mxCell id="108" value="add meta section to stack in tracebuffer" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;" parent="103" vertex="1">
172172
<mxGeometry x="20" y="260" width="120" height="40" as="geometry"/>
173173
</mxCell>
174-
<mxCell id="107" value="return file offset&lt;br&gt;&amp;nbsp;of meta setion" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=none;" parent="103" vertex="1">
174+
<mxCell id="107" value="return file offset&lt;br&gt;&amp;nbsp;of meta section" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=none;" parent="103" vertex="1">
175175
<mxGeometry x="20" y="320" width="120" height="40" as="geometry"/>
176176
</mxCell>
177177
<mxCell id="132" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="103" source="131" target="104" edge="1">
@@ -247,7 +247,7 @@
247247
</Array>
248248
</mxGeometry>
249249
</mxCell>
250-
<mxCell id="140" value="called by c runtime&lt;br&gt;befor main" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="139" vertex="1" connectable="0">
250+
<mxCell id="140" value="called by c runtime&lt;br&gt;before main" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="139" vertex="1" connectable="0">
251251
<mxGeometry x="-0.641" y="-2" relative="1" as="geometry">
252252
<mxPoint as="offset"/>
253253
</mxGeometry>

docs/diagrams/clltk_flow_tracepoint_compilation.drawio

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
<mxCell id="71" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="48" target="69" edge="1">
146146
<mxGeometry relative="1" as="geometry"/>
147147
</mxCell>
148-
<mxCell id="48" value="creat arument type information for runtime" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
148+
<mxCell id="48" value="creat argument type information for runtime" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
149149
<mxGeometry x="120" y="750" width="120" height="60" as="geometry"/>
150150
</mxCell>
151151
<mxCell id="49" value="" style="endArrow=classic;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="10" target="3" edge="1">
@@ -178,7 +178,7 @@
178178
<mxCell id="53" value="" style="ellipse;shape=doubleEllipse;html=1;dashed=0;whitespace=wrap;aspect=fixed;" parent="1" vertex="1">
179179
<mxGeometry x="170" y="90" width="20" height="20" as="geometry"/>
180180
</mxCell>
181-
<mxCell id="55" value="artument types" style="rounded=0;whiteSpace=wrap;html=1;rotation=-90;" parent="1" vertex="1">
181+
<mxCell id="55" value="argument types" style="rounded=0;whiteSpace=wrap;html=1;rotation=-90;" parent="1" vertex="1">
182182
<mxGeometry x="260" y="760" width="80" height="40" as="geometry"/>
183183
</mxCell>
184184
<mxCell id="56" value="argument count" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">

docs/diagrams/clltk_flow_tracepoint_runtime.drawio

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<mxCell id="25" value="return" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" parent="9" vertex="1">
7777
<mxGeometry x="30" y="460" width="120" height="40" as="geometry"/>
7878
</mxCell>
79-
<mxCell id="10" value="progamm resums after tracepoint" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" parent="1" vertex="1">
79+
<mxCell id="10" value="program resums after tracepoint" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" parent="1" vertex="1">
8080
<mxGeometry x="100" y="440" width="160" height="40" as="geometry"/>
8181
</mxCell>
8282
<mxCell id="29" value="add to ringbuffer" style="swimlane;whiteSpace=wrap;html=1;startSize=40;" parent="1" vertex="1">
@@ -97,7 +97,7 @@
9797
<mxCell id="38" style="edgeStyle=none;html=1;" parent="29" source="32" target="33" edge="1">
9898
<mxGeometry relative="1" as="geometry"/>
9999
</mxCell>
100-
<mxCell id="32" value="drop old entries unitl enough space for new one" style="rounded=0;whiteSpace=wrap;html=1;" parent="29" vertex="1">
100+
<mxCell id="32" value="drop old entries until enough space for new one" style="rounded=0;whiteSpace=wrap;html=1;" parent="29" vertex="1">
101101
<mxGeometry x="20" y="160" width="120" height="60" as="geometry"/>
102102
</mxCell>
103103
<mxCell id="39" style="edgeStyle=none;html=1;" parent="29" source="33" target="34" edge="1">

docs/diagrams/clltk_simple_overview.drawio

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
<mxPoint as="offset"/>
152152
</mxGeometry>
153153
</mxCell>
154-
<mxCell id="67" value="live reader deamon" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1">
154+
<mxCell id="67" value="live reader daemon" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1">
155155
<mxGeometry x="377" y="440" width="280" height="40" as="geometry"/>
156156
</mxCell>
157157
<mxCell id="70" value="extracted" style="edgeStyle=none;html=1;fillColor=#f8cecc;strokeColor=#b85450;strokeWidth=3;" parent="1" source="67" target="74" edge="1">
@@ -201,7 +201,7 @@
201201
<mxCell id="89" value="Traced Application" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;labelBackgroundColor=none;" parent="1" vertex="1">
202202
<mxGeometry x="110" y="10" width="110" height="20" as="geometry"/>
203203
</mxCell>
204-
<mxCell id="90" value="Reader Deamon" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;labelBackgroundColor=none;" parent="1" vertex="1">
204+
<mxCell id="90" value="Reader Daemon" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;labelBackgroundColor=none;" parent="1" vertex="1">
205205
<mxGeometry x="590" y="340" width="100" height="20" as="geometry"/>
206206
</mxCell>
207207
<mxCell id="91" value="Decoder Tool" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;labelBackgroundColor=none;" parent="1" vertex="1">

docs/file_specification.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The following table shows the structure of the ringbuffer head, with all offsets
6262
All write access to a tracebuffer is only permitted after obtaining the semaphore. The valid states of the semaphore are therefore 0 and 1. With 0 meaning some process or thread obtained write access. And 1 that now one is currently writing to the tracebuffer. +
6363

6464
For adding a new traceentry, after obtaining write access, maybe some old entries are been dropped until enough space between next_free and last_valid is available to a the new traceentry. Both values are offset relative to the ringbuffer body location inside the file. And for each dropped entry, the dropped counter is incremented, up to a maximum of UINT64_MAX.
65-
If next_free gets bigger than body size, the wrapped counter is incremented, up to a maximum of UINT64_MAX. And next_free is wrapped back to the beginning of the ringbuffer body. The same is true for next_valid, but with out hte incrementation of any counter. +
65+
If next_free gets bigger than body size, the wrapped counter is incremented, up to a maximum of UINT64_MAX. And next_free is wrapped back to the beginning of the ringbuffer body. The same is true for next_valid, but with out the incrementation of any counter. +
6666
An ringbuffer is thereby empty if next_free == last_valid and full if next_free+1==last_valid. Will moving next_free or last_valid, next_free may never overtake last_valid. Instead last_valid must first be moved by dropping old entries and than next_free moved.
6767

6868
The dropping of old entries may only occur on whole traceentires.
@@ -81,7 +81,7 @@ Each of the entries is constructed like the following table shows:
8181
|====
8282
All offsets are relative to the beginning of an entry. For the oldest entry the beginning is always the last_valid offset. If the combined offset or index for an access is equal or bigger than the ringbuffer body size than the offset/index needs to be wrapped to the beginning of the ringbuffer body. This could be done by calculate the module of index for ringbuffer body size.
8383

84-
The magic is used to securely detect the start ot an ringbuffer entry while dropping old entries or, if a last_valid and next_free are damaged, to find all entries at decoding time.
84+
The magic is used to securely detect the start of an ringbuffer entry while dropping old entries or, if a last_valid and next_free are damaged, to find all entries at decoding time.
8585

8686
The body size enables the extraction of a entry as a single entity.
8787

@@ -142,7 +142,7 @@ The layout for the traceentry header is shown in the following table:
142142
>h| 22 >| flex | body (second part of traceentry)
143143
|====
144144

145-
The second part, the same as the traceentry header body, contains the user provided argument values and is therefor only present if any argument was provided.
145+
The second part, the same as the traceentry header body, contains the user provided argument values and is therefore only present if any argument was provided.
146146
If present, the layout of this part is defined by the argument information inside the metab information inside the file at offset `in_file_offset`.
147147
All argument values are stored, ordered by there placement inside the tracepoint call, without any gapes.
148148
To decode the argument values, first the argument type has to be retrieved from the argument type array inside the meta entry. Base on this type the value is access.

0 commit comments

Comments
 (0)