diff --git a/README.md b/README.md index e58f111..6391db5 100644 --- a/README.md +++ b/README.md @@ -42,54 +42,6 @@ The tracepoints `CLLTK_TRACEPOINT` defines first the target tracebuffer, than th `decoder_tool/python/clltk_decoder.py ` 8. View your traces in `output.csv` -## Build Requirements -### Base Library build -- cmake (>=3.18) -- gcc (>=10.0) -- g++ (>=10.0) -- git -- file -- rsync -- gettext -- libtar-dev - -### CLI tool build -- libcli11-dev -- nlohmann-json3-dev - -### Library Unit tests -- valgrind -- openjdk-17-jdk -- openssl -- lcov -- gcovr - -### Kernel module build -- make -- curl -- rpm -- elfutils -- clang -- ll -- llvm -- libelf-dev -- build-essential -- flex -- bison -- bc -- libncurses-dev -- libssl-dev -- kmod - -### Kernel module tests -- busybox-static -- strace -- cpio -- qemu-system - -## Runtime Requirements -- non - ## Security Considerations **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. @@ -159,7 +111,7 @@ It is also possible to cross compile with the container env by using of example: To build this repository for test purposes or development run: ```bash -./scripts/ci-cd/build_userspace.shs +./scripts/ci-cd/build_userspace.sh ``` ### Tests tracing standalone @@ -167,7 +119,7 @@ To build this repository for test purposes or development run: To run all test build the whole project with cmake and than run: ```bash -./scripts/ci-cd/test_userspace.shs +./scripts/ci-cd/test_userspace.sh ``` This will run all c++ and python tests. diff --git a/VERSION.md b/VERSION.md index f55ad5c..ee60f0f 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,6 +1,8 @@ -1.2.48 +1.2.49 # Change log +## 1.2.49 +- fix typos ## 1.2.48 refactor: reorganize include structure and improve project layout - Renamed project from CommoneLowLevelTracingKit to CommonLowLevelTracingKit (correcting typo). diff --git a/decoder_tool/cpp/include/CommonLowLevelTracingKit/decoder/Tracebuffer.hpp b/decoder_tool/cpp/include/CommonLowLevelTracingKit/decoder/Tracebuffer.hpp index 7fa31f8..2bb970c 100644 --- a/decoder_tool/cpp/include/CommonLowLevelTracingKit/decoder/Tracebuffer.hpp +++ b/decoder_tool/cpp/include/CommonLowLevelTracingKit/decoder/Tracebuffer.hpp @@ -35,7 +35,7 @@ namespace CommonLowLevelTracingKit::decoder { const std::filesystem::path m_path; }; - // Synchonous Tracebuffer + // Synchronous Tracebuffer struct SyncTracebuffer; using SyncTracebufferPtr = std::unique_ptr; struct EXPORT SyncTracebuffer : Tracebuffer { diff --git a/decoder_tool/cpp/source/low_level/formatter.cpp b/decoder_tool/cpp/source/low_level/formatter.cpp index 7514fad..2c0561f 100644 --- a/decoder_tool/cpp/source/low_level/formatter.cpp +++ b/decoder_tool/cpp/source/low_level/formatter.cpp @@ -12,7 +12,7 @@ #include "inline.hpp" -namespace formater = CommonLowLevelTracingKit::decoder::source::formatter; +namespace formatter = CommonLowLevelTracingKit::decoder::source::formatter; using namespace CommonLowLevelTracingKit::decoder::exception; using namespace std::string_literals; @@ -39,7 +39,7 @@ CONST_INLINE static constexpr ffi_type *clltk_type_to_ffi_type(const char clltk_ case 's': return &ffi_type_pointer; case 'p': return &ffi_type_pointer; case InvalidStringArgType: return &ffi_type_pointer; - default: CLLTK_DECODER_THROW(FormattingFailed, "unkown type"); + default: CLLTK_DECODER_THROW(FormattingFailed, "unknown type"); } } 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 } case 'p': return sizeof(void *); case InvalidStringArgType: return sizeof(void *); - default: CLLTK_DECODER_THROW(FormattingFailed, "unkown type"); + default: CLLTK_DECODER_THROW(FormattingFailed, "unknown type"); } } template static INLINE const any get_native(uintptr_t p, size_t remaining) { if (sizeof(T) > remaining) [[unlikely]] - CLLTK_DECODER_THROW(FormattingFailed, "out of range access for formater"); + CLLTK_DECODER_THROW(FormattingFailed, "out of range access for formatter"); T value{}; memcpy(&value, std::bit_cast(p), sizeof(T)); static_assert(sizeof(ProxyT) == sizeof(void *)); @@ -105,7 +105,7 @@ INLINE static constexpr any clltk_arg_to_native(const char clltk_type, const uin // the value in clltk_arg is a pointer to a now invalid/unusable memory address. // replace it with a dummy arg string return std::bit_cast(&InvalidStringArg); - default: CLLTK_DECODER_THROW(FormattingFailed, "unkown type"); + default: CLLTK_DECODER_THROW(FormattingFailed, "unknown type"); } } @@ -120,7 +120,7 @@ clltk_args_to_native_args(const std::string_view format, const std::span= raw_clltk_args.size()) [[unlikely]] - CLLTK_DECODER_THROW(FormattingFailed, "out of range access for formater"); + CLLTK_DECODER_THROW(FormattingFailed, "out of range access for formatter"); const uintptr_t current = std::bit_cast(&raw_clltk_args[raw_arg_offset]); const size_t remaining = raw_clltk_args.size() - raw_arg_offset; 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, } } if (arg_count != raw_types.size()) [[unlikely]] - CLLTK_DECODER_THROW(FormattingFailed, "invalid format secifier"); + CLLTK_DECODER_THROW(FormattingFailed, "invalid format specifier"); return out; } @@ -244,8 +244,8 @@ static INLINE std::string clean_up_str_view(const std::string_view str) { } // call snprintf with ffi -std::string formater::printf(const std::string_view format, const std::span &types_raw, - const std::span &args_raw) { +std::string formatter::printf(const std::string_view format, const std::span &types_raw, + const std::span &args_raw) { if (format.empty()) return ""; if (*format.end() != '\0') CLLTK_DECODER_THROW(FormattingFailed, "missing format termination"); 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 &types_raw, - const std::span &args_raw) { +std::string formatter::dump(const std::string_view format, const std::span &types_raw, + const std::span &args_raw) { if (types_raw.size() != 1 || types_raw[0] != 'x') CLLTK_DECODER_THROW(InvalidMeta, "wrong meta for drump tracepoint"); const size_t format_size = format.size(); diff --git a/decoder_tool/python/clltk_decoder.py b/decoder_tool/python/clltk_decoder.py index 56c0296..8b363b2 100755 --- a/decoder_tool/python/clltk_decoder.py +++ b/decoder_tool/python/clltk_decoder.py @@ -434,7 +434,7 @@ def __init__(self, entry: Ringbuffer_Entry, meta: Stack_Entry): self.line = get_int(meta.body, self.metaentry_in_metablob + 6, 4) - # get argument informations + # get argument information self.argument_count = get_int( meta.body, self.metaentry_in_metablob + 10, 1) self.argument_type_array = get(meta.body, self.metaentry_in_metablob + @@ -474,7 +474,7 @@ def __init__(self, entry: Ringbuffer_Entry, meta: Stack_Entry): assert self.argument_count == len(formats), \ f"argument types are {self.arg_types} \n"\ - + f"but formates {formats} for type {self.type} and format \"{self.format}\""\ + + f"but formats {formats} for type {self.type} and format \"{self.format}\""\ + f" at {self.file}:{self.line}" @@ -580,7 +580,7 @@ def get_arg(raw: bytes, offset: int, t: int, format: dict): value = " ".join(f"{x:02X}" for x in value) offset += string_length else: - assert 0, "type unkown" + assert 0, "type unknown" return (offset, value) @@ -666,7 +666,7 @@ def __init__(self, raw: bytes, recover_all:bool=False): continue if all(character.isspace() for character in entry.formatted): - logging.info("empty trace entry skiped") + logging.info("empty trace entry skipped") self.entries.append(entry) pass diff --git a/docs/diagrams/clltk_flow_tracebuffer.drawio b/docs/diagrams/clltk_flow_tracebuffer.drawio index 144a07c..5499860 100644 --- a/docs/diagrams/clltk_flow_tracebuffer.drawio +++ b/docs/diagrams/clltk_flow_tracebuffer.drawio @@ -171,7 +171,7 @@ - + @@ -247,7 +247,7 @@ - + diff --git a/docs/diagrams/clltk_flow_tracepoint_compilation.drawio b/docs/diagrams/clltk_flow_tracepoint_compilation.drawio index 689298b..c8dd2ae 100644 --- a/docs/diagrams/clltk_flow_tracepoint_compilation.drawio +++ b/docs/diagrams/clltk_flow_tracepoint_compilation.drawio @@ -145,7 +145,7 @@ - + @@ -178,7 +178,7 @@ - + diff --git a/docs/diagrams/clltk_flow_tracepoint_runtime.drawio b/docs/diagrams/clltk_flow_tracepoint_runtime.drawio index 7177cdd..c96e571 100644 --- a/docs/diagrams/clltk_flow_tracepoint_runtime.drawio +++ b/docs/diagrams/clltk_flow_tracepoint_runtime.drawio @@ -76,7 +76,7 @@ - + @@ -97,7 +97,7 @@ - + diff --git a/docs/diagrams/clltk_simple_overview.drawio b/docs/diagrams/clltk_simple_overview.drawio index 6c27c1a..e049be9 100644 --- a/docs/diagrams/clltk_simple_overview.drawio +++ b/docs/diagrams/clltk_simple_overview.drawio @@ -151,7 +151,7 @@ - + @@ -201,7 +201,7 @@ - + diff --git a/docs/file_specification.asciidoc b/docs/file_specification.asciidoc index 7ab30ee..b6133ef 100644 --- a/docs/file_specification.asciidoc +++ b/docs/file_specification.asciidoc @@ -62,7 +62,7 @@ The following table shows the structure of the ringbuffer head, with all offsets 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. + 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. -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. + +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. + 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. 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: |==== 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. -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. +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. The body size enables the extraction of a entry as a single entity. @@ -142,7 +142,7 @@ The layout for the traceentry header is shown in the following table: >h| 22 >| flex | body (second part of traceentry) |==== -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. +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. 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`. All argument values are stored, ordered by there placement inside the tracepoint call, without any gapes. 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. diff --git a/docs/readme.asciidoc b/docs/readme.asciidoc index 621b6d0..63c5fc9 100644 --- a/docs/readme.asciidoc +++ b/docs/readme.asciidoc @@ -40,7 +40,7 @@ A *Tracebuffer* actually refers to two parts: NOTE: The `clltk` library does not manage buffer memory itself. Instead you will need a data store backend which can allocate buffer memory and provide access to it. === Tracepoint creation -In the application code you can create *Tracepoints* whose entries and metadata will be sent into the asociated *Tracebuffer*. This is done by using the line +In the application code you can create *Tracepoints* whose entries and metadata will be sent into the associated *Tracebuffer*. This is done by using the line `CLLTK_TRACEPOINT(MyFirstTracebuffer, "Hello %s, you are %d years old", name, age);` diff --git a/docs/technical_documentation.asciidoc b/docs/technical_documentation.asciidoc index f4637ff..ad17b0e 100644 --- a/docs/technical_documentation.asciidoc +++ b/docs/technical_documentation.asciidoc @@ -72,7 +72,7 @@ printf_like_function(receiver, "%d", (long)1); // gcc warning [-Wformat] ---- === Type safe access to variable arguments -1. get argument count and array with argument-types as enums, trough link:https://stackoverflow.com/a/11920694[c-macro-magic], at compile-time. Use `_Generic` macro to map types to enum and use meta programing for c++. +1. get argument count and array with argument-types as enums, through link:https://stackoverflow.com/a/11920694[c-macro-magic], at compile-time. Use `_Generic` macro to map types to enum and use meta programming for c++. 2. use argument type array to access var_list with with valid type --- @@ -80,7 +80,7 @@ printf_like_function(receiver, "%d", (long)1); // gcc warning [-Wformat] === Gathering meta data at compile-time To get all meta data for one tracebuffer, all relevant information are stored in to a custom elf-section. This is possible due to a link:https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Function-Attributes.html#:~:text=section%20(%22section%2Dname%22)[gcc section attribute]. -By defining all meta data strings and data structures as `static const` and appling the section attribute, gcc will gathering all meta data into the same section. +By defining all meta data strings and data structures as `static const` and applying the section attribute, gcc will gathering all meta data into the same section. [source,C,linenums] ---- diff --git a/examples/process_threads/process_threads.cpp b/examples/process_threads/process_threads.cpp index a4b4c16..e8e5403 100644 --- a/examples/process_threads/process_threads.cpp +++ b/examples/process_threads/process_threads.cpp @@ -33,14 +33,14 @@ static int func(char const *msg) constexpr size_t t_n = 10; void run_threads(std::string str) { - std::array ths; + std::array threads; std::array strings; for (size_t thread_counter = 0; thread_counter < t_n; thread_counter++) { strings.at(thread_counter) = str + "_" + std::to_string(thread_counter); - ths.at(thread_counter) = std::thread(&func, strings.at(thread_counter).data()); + threads.at(thread_counter) = std::thread(&func, strings.at(thread_counter).data()); } func(str.data()); - for (auto &th : ths) + for (auto &th : threads) th.join(); } diff --git a/examples/simple_kernel_module/kthreadtest.c b/examples/simple_kernel_module/kthreadtest.c index f56d253..db18dd0 100644 --- a/examples/simple_kernel_module/kthreadtest.c +++ b/examples/simple_kernel_module/kthreadtest.c @@ -54,7 +54,7 @@ static void run_threads(void) complete_all(&start_signal); for (size_t i = 0; i < 2; i++) { ssleep(1); - printk("sleeped for %lus\n", (i + 1)); + printk("slept for %lus\n", (i + 1)); } uint64_t total_tp_count = 0; diff --git a/kernel_tracing_library/src/Kbuild b/kernel_tracing_library/src/Kbuild index 54d31c0..0e84882 100644 --- a/kernel_tracing_library/src/Kbuild +++ b/kernel_tracing_library/src/Kbuild @@ -10,7 +10,7 @@ ccflags-y := \ # kernel module obj-m := clltk_kernel_tracing.o -# abstaction +# abstraction ccflags-y += -I$(src)/../../tracing_library/source/ -I$(src)/../../tracing_library/source/abstraction/include/ clltk_kernel_tracing-y += $(addprefix abstraction/, \ error.o \ diff --git a/kernel_tracing_library/src/initialization.c b/kernel_tracing_library/src/initialization.c index 85a3315..2ad440b 100644 --- a/kernel_tracing_library/src/initialization.c +++ b/kernel_tracing_library/src/initialization.c @@ -95,7 +95,7 @@ void _clltk_init_tracing_for_this_module(const struct mod_kallsyms *const allsym { tmp_elf_section_t **sectionstable = vector_create(); - // search throuh all symbols to get all tracebuffers handlers and tracepoint meta data + // search through all symbols to get all tracebuffers handlers and tracepoint meta data for (unsigned int i = 0; i < allsyms->num_symtab; i++) { const Elf_Sym *const ksym = &allsyms->symtab[i]; const char *const name = &allsyms->strtab[ksym->st_name]; diff --git a/scripts/ci-cd/build_kernelspace.sh b/scripts/ci-cd/build_kernelspace.sh index 4f55f1b..0fb2ed5 100755 --- a/scripts/ci-cd/build_kernelspace.sh +++ b/scripts/ci-cd/build_kernelspace.sh @@ -7,7 +7,7 @@ ROOT_PATH=$(git rev-parse --show-toplevel) cd ${ROOT_PATH} kernel_latest_query_version () { - echo "=> querry linux kernel version" >&2 + echo "=> query linux kernel version" >&2 local version=$(curl https://www.kernel.org/ 2>/dev/null | grep -A 1 "latest_link" 2>/dev/null ) version=${version##*.tar.xz\">} version=${version%} @@ -25,7 +25,7 @@ kernel_query_server_prefix () { prefix="https://kernel.org/pub/linux/kernel/v6.x/" ;; *) - echo "EE kernel version $version unsuported" >&2 + echo "EE kernel version $version unsupported" >&2 exit 1 ;; esac @@ -34,7 +34,7 @@ kernel_query_server_prefix () { kernel_latest_query_link () { version=$1 - echo "=> querry linux kernel download link" >&2 + echo "=> query linux kernel download link" >&2 prefix=$(kernel_query_server_prefix $version) local download_link=$(curl -L $prefix 2>/dev/null | grep -A 1 "linux-$version.tar.xz") if [ -z "$download_link" ]; then diff --git a/scripts/development_helper/clltk_trace.hexpat b/scripts/development_helper/clltk_trace.hexpat index 0af915d..d71473a 100644 --- a/scripts/development_helper/clltk_trace.hexpat +++ b/scripts/development_helper/clltk_trace.hexpat @@ -3,8 +3,8 @@ import std.io; import std.hash; import std.sys; -fn crc8(ref auto patter){ - return std::hash::crc8(patter, 0, 0x7, 0, false, false); +fn crc8(ref auto pattern){ + return std::hash::crc8(pattern, 0, 0x7, 0, false, false); }; struct MutexType { @@ -38,7 +38,7 @@ struct DefinitionSectionType { u64 size; char name[size]; }; -DefinitionSectionType Defnition @FileHead.defintion_offset; +DefinitionSectionType Definition @FileHead.defintion_offset; enum MetaType : u8 { printf = 1, @@ -120,7 +120,7 @@ struct RingbufferSectionType { const u64 expected_entry_count = (entries_count - dropped) [[export]]; current = last_valid; u64 end = (last_valid <= next_free) ? next_free : (next_free + body_size); - RingbufferEntry entires[while(current < end)] [[no_uniqe_address]]; + RingbufferEntry entries[while(current < end)] [[no_uniqe_address]]; }; RingbufferSectionType Ringbuffer @FileHead.ringbuffer_offset; @@ -139,6 +139,6 @@ struct StackSectionType{ MutexType mutext; padding[40]; // future use u64 body_size; - StackSectionEntryType entires[while(!std::mem::eof())]; + StackSectionEntryType entries[while(!std::mem::eof())]; }[[fixed_size(120+body_size)]]; StackSectionType Stack @FileHead.stack_offset; \ No newline at end of file diff --git a/scripts/development_helper/format_everything.sh b/scripts/development_helper/format_everything.sh index 86f48f6..74fb997 100755 --- a/scripts/development_helper/format_everything.sh +++ b/scripts/development_helper/format_everything.sh @@ -9,7 +9,7 @@ format() { local -r file="$1" clang-format -style=file -i "$file" if [ $? -ne 0 ]; then - echo "formating failed for $file" + echo "formatting failed for $file" exit 1 fi } diff --git a/snapshot_library/source/file.cpp b/snapshot_library/source/file.cpp index a9e10be..a3c306e 100644 --- a/snapshot_library/source/file.cpp +++ b/snapshot_library/source/file.cpp @@ -116,11 +116,11 @@ std::string CommonLowLevelTracingKit::snapshot::VirtualFile::to_file_content( { std::stringstream file_content_buffer; file_content_buffer << "["; - bool frist = true; + bool first = true; for (const auto &formatted : additional_tracepoints) { - if (!frist) + if (!first) file_content_buffer << ","; - frist = false; + first = false; file_content_buffer << "{\"timestamp\":" << ns << ",\"formatted\":\"" << formatted << "\"}"; } file_content_buffer << "]"; diff --git a/tests/python_tests/helper/build_temp_target.py b/tests/python_tests/helper/build_temp_target.py index 2dd52dc..bafc408 100644 --- a/tests/python_tests/helper/build_temp_target.py +++ b/tests/python_tests/helper/build_temp_target.py @@ -13,7 +13,7 @@ import pandas as pd from enum import Enum -class Langauge(Enum): +class Language(Enum): C = 0 CPP = 1 @@ -45,9 +45,9 @@ def _run(*args, env=os.environ): stdout = out.stdout.decode() return stdout -def process(file_content, build_musst_fail=False, run_musst_fail=False, runs=1, language=Langauge.C, check_callback = None): - target = {Langauge.C:"main_c", Langauge.CPP :"main_cpp"}[language] - file = {Langauge.C:"main.gen.c", Langauge.CPP :"main.gen.cpp"}[language] +def process(file_content, build_musst_fail=False, run_musst_fail=False, runs=1, language=Language.C, check_callback = None): + target = {Language.C:"main_c", Language.CPP :"main_cpp"}[language] + file = {Language.C:"main.gen.c", Language.CPP :"main.gen.cpp"}[language] tmp = tempfile.TemporaryDirectory() env ={str(key):value for key,value in os.environ.items() if "CLLTK" not in str(key)} diff --git a/tests/python_tests/snapshot_tests.py b/tests/python_tests/snapshot_tests.py index 5764d1c..3a51dc5 100644 --- a/tests/python_tests/snapshot_tests.py +++ b/tests/python_tests/snapshot_tests.py @@ -7,7 +7,7 @@ sys.path.append(os.path.dirname(os.path.realpath(__file__))) import unittest -from helper.build_temp_target import process, Langauge +from helper.build_temp_target import process, Language import tempfile import os import tarfile @@ -19,7 +19,7 @@ class snapshot_tests(unittest.TestCase): def test_snapshot_with_info(self: unittest.TestCase): - language = Langauge.CPP + language = Language.CPP file_content = \ ''' #include "CommonLowLevelTracingKit/tracing/tracing.h" @@ -67,7 +67,7 @@ def test_snapshot_with_info(self: unittest.TestCase): pass def test_snapshot_without_info(self: unittest.TestCase): - language = Langauge.CPP + language = Language.CPP file_content = \ ''' #include "CommonLowLevelTracingKit/tracing/tracing.h" @@ -120,7 +120,7 @@ def callback(tmp : tempfile.TemporaryDirectory): pass def test_snapshot_without_anything(self: unittest.TestCase): - language = Langauge.CPP + language = Language.CPP file_content = \ ''' #include "CommonLowLevelTracingKit/snapshot/snapshot.hpp" @@ -168,7 +168,7 @@ def callback(tmp : tempfile.TemporaryDirectory): pass def test_snapshot_with_data_after(self: unittest.TestCase): - language = Langauge.CPP + language = Language.CPP file_content = \ ''' #include "CommonLowLevelTracingKit/tracing/tracing.h" @@ -219,7 +219,7 @@ def test_snapshot_with_data_after(self: unittest.TestCase): class snapshot_compressed_tests(unittest.TestCase): def test_snapshot_with_info(self: unittest.TestCase): - language = Langauge.CPP + language = Language.CPP file_content = \ ''' #include "CommonLowLevelTracingKit/tracing/tracing.h" @@ -269,7 +269,7 @@ def test_snapshot_with_info(self: unittest.TestCase): pass def test_snapshot_without_info(self: unittest.TestCase): - language = Langauge.CPP + language = Language.CPP file_content = \ ''' #include "CommonLowLevelTracingKit/tracing/tracing.h" @@ -311,7 +311,7 @@ def test_snapshot_without_info(self: unittest.TestCase): pass def test_snapshot_without_anything(self: unittest.TestCase): - language = Langauge.CPP + language = Language.CPP file_content = \ ''' #include "CommonLowLevelTracingKit/snapshot/snapshot.hpp" @@ -348,7 +348,7 @@ def test_snapshot_without_anything(self: unittest.TestCase): pass def test_snapshot_with_data_after(self: unittest.TestCase): - language = Langauge.CPP + language = Language.CPP file_content = \ ''' #include "CommonLowLevelTracingKit/tracing/tracing.h" diff --git a/tests/python_tests/system_tests.py b/tests/python_tests/system_tests.py index 78f92ef..e14495a 100644 --- a/tests/python_tests/system_tests.py +++ b/tests/python_tests/system_tests.py @@ -7,7 +7,7 @@ sys.path.append(os.path.dirname(os.path.realpath(__file__))) import unittest -from helper.build_temp_target import process, Langauge +from helper.build_temp_target import process, Language TRACEBUFFER_INFO_COUNT = 7 @@ -16,7 +16,7 @@ class system_tests(unittest.TestCase): def test_random_constructor(self: unittest.TestCase): - for language in [Langauge.C, Langauge.CPP]: + for language in [Language.C, Language.CPP]: with self.subTest(language=language): file_content = \ ''' @@ -40,7 +40,7 @@ def test_random_constructor(self: unittest.TestCase): pass def test_misuse_of_tracebuffer(self: unittest.TestCase): - for language in [Langauge.C, Langauge.CPP]: + for language in [Language.C, Language.CPP]: with self.subTest(language=language): file_content = \ ''' diff --git a/tests/python_tests/valid_build_test.py b/tests/python_tests/valid_build_test.py index a8eec5e..2c0edcc 100644 --- a/tests/python_tests/valid_build_test.py +++ b/tests/python_tests/valid_build_test.py @@ -7,7 +7,7 @@ sys.path.append(os.path.dirname(os.path.realpath(__file__))) import unittest -from helper.build_temp_target import process, Langauge +from helper.build_temp_target import process, Language TRACEBUFFER_INFO_COUNT = 7 @@ -16,7 +16,7 @@ class valid_build_tests(unittest.TestCase): def test_valid_file(self: unittest.TestCase): - for language in [Langauge.C, Langauge.CPP]: + for language in [Language.C, Language.CPP]: with self.subTest(language=language): file_content = \ ''' @@ -36,7 +36,7 @@ def test_valid_file(self: unittest.TestCase): def test_run_twice_same_language(self: unittest.TestCase): - for language in [Langauge.C, Langauge.CPP]: + for language in [Language.C, Language.CPP]: with self.subTest(language=language): file_content = \ ''' @@ -54,7 +54,7 @@ def test_run_twice_same_language(self: unittest.TestCase): pass def test_wrapp(self: unittest.TestCase): - for language in [Langauge.C, Langauge.CPP]: + for language in [Language.C, Language.CPP]: with self.subTest(language=language): file_content = \ ''' @@ -72,7 +72,7 @@ def test_wrapp(self: unittest.TestCase): pass def test_empty(self: unittest.TestCase): - for language in [Langauge.C, Langauge.CPP]: + for language in [Language.C, Language.CPP]: with self.subTest(language=language): file_content = \ ''' diff --git a/tests/robot.tests/robot_resources/build.resource b/tests/robot.tests/robot_resources/build.resource index cd02a7a..7623ac0 100644 --- a/tests/robot.tests/robot_resources/build.resource +++ b/tests/robot.tests/robot_resources/build.resource @@ -4,7 +4,7 @@ Library build.py *** Keywords *** -source ${content} for ${language} failes with +source ${content} for ${language} fails with [Arguments] ${expected_error} Write To main.gen.c int main(){ return 0; } diff --git a/tests/robot.tests/tracing/invalid_source.robot b/tests/robot.tests/tracing/invalid_source.robot index c9ffb67..1ceeadc 100644 --- a/tests/robot.tests/tracing/invalid_source.robot +++ b/tests/robot.tests/tracing/invalid_source.robot @@ -5,13 +5,13 @@ Suite Setup configure cmake and build default *** Test Cases *** -detect build failes +detect build fails ${content}= catenate SEPARATOR=\n ... \#error \"error\" ... int main(void){return 0;} ${error}= Set Variable \#error "error" - source ${content} for C failes with ${error} - source ${content} for CPP failes with ${error} + source ${content} for C fails with ${error} + source ${content} for CPP fails with ${error} twice same buffer definition ${content}= catenate SEPARATOR=\n @@ -19,8 +19,8 @@ twice same buffer definition ... CLLTK_TRACEBUFFER(BUFFER, 4096) ... CLLTK_TRACEBUFFER(BUFFER, 4096) ... int main(void){} - source ${content} for C failes with redefinition of - source ${content} for CPP failes with redefinition of + source ${content} for C fails with redefinition of + source ${content} for CPP fails with redefinition of missing buffer size ${content}= catenate SEPARATOR=\n @@ -28,8 +28,8 @@ missing buffer size ... CLLTK_TRACEBUFFER(BUFFER) ... int main(void){} ${error}= Set Variable requires 2 arguments, but only 1 given - source ${content} for C failes with ${error} - source ${content} for CPP failes with ${error} + source ${content} for C fails with ${error} + source ${content} for CPP fails with ${error} tracebuffer name as a string ${content}= catenate SEPARATOR=\n @@ -37,15 +37,15 @@ tracebuffer name as a string ... CLLTK_TRACEBUFFER("BUFFER", 1024) ... int main(void){} ${error}= Set Variable pasting "_clltk_" and ""BUFFER"" does not give a valid preprocessing token - source ${content} for C failes with ${error} - source ${content} for CPP failes with ${error} + source ${content} for C fails with ${error} + source ${content} for CPP fails with ${error} missing buffer definition ${content}= catenate SEPARATOR=\n ... \#include "CommonLowLevelTracingKit/tracing/tracing.h" ... int main(void){CLLTK_TRACEPOINT(BUFFER, "should be in tracebuffer for c");} - source ${content} for C failes with ‘_clltk_BUFFER’ undeclared - source ${content} for CPP failes with ‘_clltk_BUFFER’ was not declared in this scope + source ${content} for C fails with ‘_clltk_BUFFER’ undeclared + source ${content} for CPP fails with ‘_clltk_BUFFER’ was not declared in this scope 11 arguments ${content}= catenate SEPARATOR=\n @@ -56,8 +56,8 @@ missing buffer definition ... 0,1,2,3,4,5,6,7,8,9,10); ... } ${error}= Set Variable only supporting up to 10 arguments - source ${content} for C failes with ${error} - source ${content} for CPP failes with ${error} + source ${content} for C fails with ${error} + source ${content} for CPP fails with ${error} 20 arguments ${content}= catenate SEPARATOR=\n @@ -72,8 +72,8 @@ missing buffer definition ... ); ... } ${error}= Set Variable only supporting up to 10 arguments - source ${content} for C failes with ${error} - source ${content} for CPP failes with ${error} + source ${content} for C fails with ${error} + source ${content} for CPP fails with ${error} 40 arguments ${content}= catenate SEPARATOR=\n @@ -92,8 +92,8 @@ missing buffer definition ... ); ... } ${error}= Set Variable only supporting up to 10 arguments - source ${content} for C failes with ${error} - source ${content} for CPP failes with ${error} + source ${content} for C fails with ${error} + source ${content} for CPP fails with ${error} more arguments than formats ${content}= catenate SEPARATOR=\n @@ -104,8 +104,8 @@ more arguments than formats ... 0,1,2,3,4,5,6); ... } ${error}= Set Variable -Werror=format-extra-args - source ${content} for C failes with ${error} - source ${content} for CPP failes with ${error} + source ${content} for C fails with ${error} + source ${content} for CPP fails with ${error} more formats than arguments ${content}= catenate SEPARATOR=\n @@ -116,6 +116,6 @@ more formats than arguments ... 0,1,2,3,4); ... } ${error}= Set Variable -Werror=format= - source ${content} for C failes with ${error} - source ${content} for CPP failes with ${error} + source ${content} for C fails with ${error} + source ${content} for CPP fails with ${error} diff --git a/tests/tracing.tests/abstraction.tests/sync.tests.cpp b/tests/tracing.tests/abstraction.tests/sync.tests.cpp index c309c3d..5f76610 100644 --- a/tests/tracing.tests/abstraction.tests/sync.tests.cpp +++ b/tests/tracing.tests/abstraction.tests/sync.tests.cpp @@ -153,7 +153,7 @@ TEST(sync, memory_mutex_in_killed_process) CaptureStderr(); { // try to get locked mutex with dead owner, should be recovered SYNC_MEMORY_LOCK(lock, mutex); - EXPECT_TRUE(lock.locked) << " could not get mutex afte owner died"; + EXPECT_TRUE(lock.locked) << " could not get mutex after owner died"; EXPECT_EQ(lock.error_msg, "mutex recovered from dead owner"s); } const std::string output = GetCapturedStderr(); @@ -197,7 +197,7 @@ TEST(sync, memory_mutex_in_exit_process) CaptureStderr(); { // try to get locked mutex with dead owner, should be recovered SYNC_MEMORY_LOCK(lock, mutex); - EXPECT_TRUE(lock.locked) << " could not get mutex afte owner died"; + EXPECT_TRUE(lock.locked) << " could not get mutex after owner died"; EXPECT_EQ(lock.error_msg, "mutex recovered from dead owner"s); } const std::string output = GetCapturedStderr(); @@ -269,7 +269,7 @@ TEST(sync, memory_mutex_in_exit_process_during_recovery) CaptureStderr(); { // try to get locked mutex with dead owner, should be recovered SYNC_MEMORY_LOCK(lock, mutex); - EXPECT_TRUE(lock.locked) << " could not get mutex afte owner died"; + EXPECT_TRUE(lock.locked) << " could not get mutex after owner died"; EXPECT_EQ(lock.error_msg, "mutex recovered from dead owner"s); } const std::string output = GetCapturedStderr(); @@ -306,7 +306,7 @@ TEST(sync, signal_in_same_process_same_thread) sync_memory_mutex_release(&lock); EXPECT_FALSE(lock.locked); - // try agian to lock + // try again to lock lock = sync_memory_mutex_get(&mutex); EXPECT_TRUE(lock.locked); sync_memory_mutex_release(&lock); diff --git a/tests/tracing.tests/md5.tests/md5.test.cpp b/tests/tracing.tests/md5.tests/md5.test.cpp index eec3f24..dcf4182 100644 --- a/tests/tracing.tests/md5.tests/md5.test.cpp +++ b/tests/tracing.tests/md5.tests/md5.test.cpp @@ -37,7 +37,7 @@ TEST_P(with_parameter, md5) hash_string << "\\x" << std::hex << std::setw(2) << std::setfill('0') << (static_cast(c) & 0xff); - ADD_FAILURE() << "hash shoud be: " << hash_string.str(); + ADD_FAILURE() << "hash should be: " << hash_string.str(); } type make(std::string data, const char *const hash) diff --git a/tracing_library/include/CommonLowLevelTracingKit/tracing/_arguments.h b/tracing_library/include/CommonLowLevelTracingKit/tracing/_arguments.h index 90773c2..e9f6488 100644 --- a/tracing_library/include/CommonLowLevelTracingKit/tracing/_arguments.h +++ b/tracing_library/include/CommonLowLevelTracingKit/tracing/_arguments.h @@ -228,7 +228,7 @@ static CONST_INLINE constexpr bool _CLLTK_TYPE_IS_FLEX_TEMP(void) #define _CLLTK_ARG_TYPES_ARE_FLEX(...) \ __VA_OPT__(_CLLTK_APPLY(_CLLTK_TYPE_IS_FLEX, _CLLTK_OR, __VA_ARGS__)) + 0 -// create struct with type informations +// create struct with type information #define _CLLTK_CREATE_TYPES(...) \ { \ /* .count = */ _CLLTK_NARGS(__VA_ARGS__), \ diff --git a/tracing_library/include/CommonLowLevelTracingKit/tracing/_macros.h b/tracing_library/include/CommonLowLevelTracingKit/tracing/_macros.h index 941c8cc..f623278 100644 --- a/tracing_library/include/CommonLowLevelTracingKit/tracing/_macros.h +++ b/tracing_library/include/CommonLowLevelTracingKit/tracing/_macros.h @@ -74,7 +74,7 @@ __attribute__((always_inline)) static inline constexpr auto _clltk_cast(T value) _CLLTK_NARGS_SEQ(__VA_OPT__(__VA_ARGS__, ) 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, \ 7, 6, 5, 4, 3, 2, 1, 0) -/* This will let macros expand before concating them */ +/* This will let macros expand before concatenating them */ #define _CLLTK_PRIMITIVE_CAT(x, y) x##y #define _CLLTK_CAT(x, y) _CLLTK_PRIMITIVE_CAT(x, y) diff --git a/tracing_library/source/abstraction/linux_user_space/file.c b/tracing_library/source/abstraction/linux_user_space/file.c index 3d29c7e..ee2b8f5 100644 --- a/tracing_library/source/abstraction/linux_user_space/file.c +++ b/tracing_library/source/abstraction/linux_user_space/file.c @@ -54,7 +54,7 @@ static const char *get_root_path(void) static pthread_mutex_t lock; if (pthread_mutex_lock(&lock) != 0) - ERROR_AND_EXIT("failed to aquire lock"); + ERROR_AND_EXIT("failed to acquire lock"); root_path = getenv("CLLTK_TRACING_PATH"); if (root_path == NULL) { diff --git a/tracing_library/source/abstraction/linux_user_space/sync.c b/tracing_library/source/abstraction/linux_user_space/sync.c index 93cccde..e99cbd5 100644 --- a/tracing_library/source/abstraction/linux_user_space/sync.c +++ b/tracing_library/source/abstraction/linux_user_space/sync.c @@ -82,7 +82,7 @@ syn_lock_object_t sync_memory_mutex_get(sync_mutex_t *const ptr) // if no error occurred than return valid lock object return CREATE_SYN_LOCK_OBJECT(ptr, true, ""); } else if (status == EOWNERDEAD) { - // dead owner therefor we recover the state + // dead owner therefore we recover the state // we also got the lock if (pthread_mutex_consistent(mutex) == 0) { return CREATE_SYN_LOCK_OBJECT(ptr, true, "mutex recovered from dead owner"); diff --git a/tracing_library/source/arguments.c b/tracing_library/source/arguments.c index fe8656a..4bb5fbc 100644 --- a/tracing_library/source/arguments.c +++ b/tracing_library/source/arguments.c @@ -85,7 +85,7 @@ uint32_t get_argument_sizes(const char *const format, uint32_t sizes_out[], size += fix_arg_size; } } else { - // get sizes of strings, therefor access va_list + // get sizes of strings, therefore access va_list va_list args_copy; va_copy(args_copy, args); for (size_t arg_index = 0; arg_index < types->count; arg_index++) { diff --git a/tracing_library/source/unique_stack/unique_stack.h b/tracing_library/source/unique_stack/unique_stack.h index 6dbe2d2..5bd2025 100644 --- a/tracing_library/source/unique_stack/unique_stack.h +++ b/tracing_library/source/unique_stack/unique_stack.h @@ -23,7 +23,7 @@ struct __attribute__((packed, aligned(8))) unique_stack_header_t { sync_mutex_t mutex; uint8_t _reserved_for_future_use[40]; uint64_t body_size; - // body is not mmapped, therefor not defined here + // body is not mmapped, therefore not defined here }; struct unique_stack_handler_t; @@ -61,7 +61,7 @@ unique_stack_handler_t unique_stack_open(file_t *fh, uint64_t file_offset); void unique_stack_close(unique_stack_handler_t *handler); /** - * check if stack is valid and therefor usable + * check if stack is valid and therefore usable */ bool unique_stack_valid(const unique_stack_handler_t *handler);