Skip to content

Commit daf4273

Browse files
committed
refactor: reorganize include structure and improve project layout
- Renamed project from `CommoneLowLevelTracingKit` to `CommonLowLevelTracingKit` (correcting typo). - Reorganized header paths under `CommonLowLevelTracingKit/tracing/`, `CommonLowLevelTracingKit/decoder/`, and `CommonLowLevelTracingKit/snapshot/` for better namespace clarity. - Updated all `#include` directives to use the new consistent path structure (e.g., `tracing.h` → `tracing/tracing.h`). - Updated CMake targets to use `OUTPUT_NAME` consistently and improved library linking with proper visibility and standard settings. - Restructured `decoder_tool` and `snapshot_library` to use consistent directory layout and public headers. - Fixed include paths in all examples, tests, and kernel module code to reflect new structure. - Removed redundant CMake logic and improved target properties. Signed-off-by: Jo5ta <[email protected]>
1 parent a17bcda commit daf4273

File tree

99 files changed

+662
-528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+662
-528
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
55

6-
project(CommoneLowLevelTracingKit LANGUAGES C CXX)
6+
project(CommonLowLevelTracingKit LANGUAGES C CXX)
77

88
include(cmake/Toolchain.cmake)
99
include(cmake/ToolchainVersionCheck.cmake)
@@ -16,10 +16,10 @@ include(cmake/ASAN.cmake)
1616
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
1717
# We're in the root, define additional targets for developers.
1818
message(STATUS "clltk is standalone")
19-
option(STANDALONE_PROJECT "" "ON")
19+
option(STANDALONE_PROJECT "Build as standalone project" ON)
2020
else()
2121
message(STATUS "clltk is imported")
22-
option(STANDALONE_PROJECT "" "OFF")
22+
option(STANDALONE_PROJECT "Build as standalone project" OFF)
2323
endif()
2424

2525
set(CLLTK_TRACING_LIB_TYPE "STATIC" CACHE STRING "make target clltk_tracing alias for clltk_tracing_shared with \"SHARED\" or clltk_tracing_static with \"STATIC\"")
@@ -47,7 +47,7 @@ if(CLLTK_COMMAND_LINE_TOOL)
4747
endif()
4848

4949
option(CLLTK_PYTHON_DECODER "select python decoder for packaging" ON)
50-
option(CLLTK_CPP_DECODER "select python decoder for packaging" ON)
50+
option(CLLTK_CPP_DECODER "select cpp decoder for packaging" ON)
5151
add_subdirectory(./decoder_tool)
5252

5353
option(CLLTK_KERNEL_TRACING "select kernel tracing module for build" ${STANDALONE_PROJECT})

VERSION.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
1.2.47
1+
1.2.48
22

33
# Change log
4-
## 1.2.47+
4+
## 1.2.48
5+
refactor: reorganize include structure and improve project layout
6+
- Renamed project from CommoneLowLevelTracingKit to CommonLowLevelTracingKit (correcting typo).
7+
- Reorganized header paths under CommonLowLevelTracingKit/tracing/, CommonLowLevelTracingKit/decoder/, and CommonLowLevelTracingKit/snapshot/ for better namespace clarity.
8+
- Updated all #include directives to use the new consistent path structure (e.g., tracing.h → tracing/tracing.h).
9+
- Updated CMake targets to use OUTPUT_NAME consistently and improved library linking with proper visibility and standard settings.
10+
- Restructured decoder_tool and snapshot_library to use consistent directory layout and public headers.
11+
- Fixed include paths in all examples, tests, and kernel module code to reflect new structure.
12+
- Removed redundant CMake logic and improved target properties.
13+
## 1.2.47
514
- fix macros
615
- add more cmake options
716
## 1.2.46

clltk.code-workspace

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"type": "lldb",
112112
"request": "launch",
113113
"cwd": "${workspaceFolder}",
114-
"program": "${command:cmake.buildDirectory}/command_line_tool/clltk",
114+
"program": "${workspaceFolder}/build/command_line_tool/clltk",
115115
"sourceLanguages": [
116116
"c",
117117
"c++"

cmake/CreatePackage.cmake

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,34 @@
22

33
include(GNUInstallDirs)
44

5-
set(CPACK_PACKAGE_NAME "CommonLowLevelTracingKit")
6-
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CommonLowLevelTracingKit - common low level tracing kit")
7-
set(CPACK_PACKAGE_DESCRIPTION "a fast, lightweight, binary, always-on, printf-style, file-based and flight-recorder-like tracing library")
5+
# Main package configuration
6+
set(CPACK_PACKAGE_NAME "clltk")
7+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Common Low Level Tracing Kit - High-performance binary tracing library")
8+
set(CPACK_PACKAGE_DESCRIPTION "A fast, lightweight, binary, always-on, printf-style, file-based and flight-recorder-like tracing library for C/C++ applications. Provides low-overhead tracing with binary format support, kernel-space tracing capabilities, and comprehensive debugging tools.")
89
set(CPACK_PACKAGE_VERSION_MAJOR ${CLLTK_VERSION_MAJOR})
910
set(CPACK_PACKAGE_VERSION_MINOR ${CLLTK_VERSION_MINOR})
1011
set(CPACK_PACKAGE_VERSION_PATCH ${CLLTK_VERSION_PATCH})
1112
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/IBM/CommonLowLevelTracingKit")
12-
set(CPACK_PACKAGE_VENDOR "IBM by Eduard Stefes <[email protected]> - Johannes Staib <[email protected]>")
13-
set(CPACK_PACKAGE_CHECKSUM MD5)
13+
set(CPACK_PACKAGE_VENDOR "IBM")
14+
set(CPACK_PACKAGE_CONTACT "Eduard Stefes <[email protected]>, Johannes Staib <[email protected]>")
15+
set(CPACK_PACKAGE_CHECKSUM SHA256)
16+
17+
# Component descriptions
18+
set(CPACK_COMPONENT_TRACING_DISPLAY_NAME "CLLTK Runtime Libraries")
19+
set(CPACK_COMPONENT_TRACING_DESCRIPTION "Core tracing runtime libraries (shared and static)")
20+
set(CPACK_COMPONENT_TRACING_GROUP "Runtime")
21+
22+
set(CPACK_COMPONENT_CMD_DISPLAY_NAME "CLLTK Command Line Tools")
23+
set(CPACK_COMPONENT_CMD_DESCRIPTION "Command line utilities for trace management")
24+
set(CPACK_COMPONENT_CMD_GROUP "Tools")
25+
26+
set(CPACK_COMPONENT_SNAPSHOT_DISPLAY_NAME "CLLTK Snapshot Library")
27+
set(CPACK_COMPONENT_SNAPSHOT_DESCRIPTION "Libraries for snapshot and archival functionality")
28+
set(CPACK_COMPONENT_SNAPSHOT_GROUP "Runtime")
29+
30+
set(CPACK_COMPONENT_DECODER_DISPLAY_NAME "CLLTK Decoder Libraries")
31+
set(CPACK_COMPONENT_DECODER_DESCRIPTION "Trace decoding and analysis libraries")
32+
set(CPACK_COMPONENT_DECODER_GROUP "Runtime")
1433

1534
set(CPACK_SOURCE_IGNORE_FILES
1635
"${CMAKE_BINARY_DIR}"
@@ -23,11 +42,9 @@ set(CPACK_SOURCE_IGNORE_FILES
2342
)
2443

2544
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
26-
set(CPACK_RPM_snapshot_PACKAGE_REQUIRES "tar >= 0.0.0, z >= 1.3")
2745
set(CPACK_RPM_PACKAGE_RELEASE 1)
2846
set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/clltk-debug")
2947
set(CPACK_RPM_PACKAGE_LICENSE "BSD-2-Clause-Patent")
3048
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_BINARY_DIR}/packages")
3149

32-
3350
include(CPack)

command_line_tool/CMakeLists.txt

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,36 @@ foreach(COMMAND_FOLDER IN LISTS COMMAND_FOLDERS)
2222
endforeach()
2323

2424

25-
# Check that all commands are OBJECT or SHARED libraries
26-
foreach(command_target ${CLLTK_COMMAND_LINE_COMMANDS})
27-
get_target_property(target_type ${command_target} TYPE)
28-
if( "${command_target}" STREQUAL "OBJECT_LIBRARY" OR "${command_target}" STREQUAL "SHARED_LIBRARY")
29-
message(FATAL_ERROR "To ensure that commands in the main function are detected at runtime, ${command_target} must be OBJECT or SHARED library, not ${target_type}.")
30-
endif()
31-
endforeach()
32-
3325
# create the clltk executable
3426
add_executable(clltk-cmd
3527
main/main.cpp
3628
main/validators.cpp
3729
)
3830

3931
target_link_libraries(clltk-cmd
40-
clltk-cmd-interface
41-
clltk-version
42-
${CLLTK_COMMAND_LINE_COMMANDS}
32+
PRIVATE
33+
clltk-cmd-interface
34+
clltk-version
4335
)
4436

37+
# Check that all commands are OBJECT or SHARED libraries
38+
foreach(command_target ${CLLTK_COMMAND_LINE_COMMANDS})
39+
get_target_property(target_type ${command_target} TYPE)
40+
if( "${command_target}" STREQUAL "OBJECT_LIBRARY")
41+
message(FATAL_ERROR "To ensure that commands in the main function are detected at runtime, ${command_target} must be OBJECT library, not ${target_type}.")
42+
endif()
43+
target_sources(clltk-cmd
44+
PRIVATE
45+
$<TARGET_OBJECTS:${command_target}>
46+
)
47+
48+
target_link_libraries(clltk-cmd
49+
PRIVATE
50+
${command_target}
51+
)
52+
endforeach()
53+
54+
4555
set_target_properties(clltk-cmd PROPERTIES
4656
OUTPUT_NAME clltk
4757
INTERPROCEDURAL_OPTIMIZATION TRUE
@@ -51,8 +61,11 @@ target_compile_options(clltk-cmd
5161
PRIVATE
5262
-Os
5363
)
54-
55-
install(TARGETS clltk-cmd
56-
DESTINATION ${CMAKE_INSTALL_BINDIR}
57-
COMPONENT cmd
64+
install(TARGETS
65+
clltk-cmd
66+
${CLLTK_COMMAND_LINE_COMMANDS}
67+
EXPORT CLLTKTracingTargets
68+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT cmd
69+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT cmd
70+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT cmd
5871
)

command_line_tool/commands/decode/decoder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#include <functional>
88
#include <string>
99

10-
#include "CommonLowLevelTracingKit/Decoder/Tracebuffer.hpp"
11-
#include "CommonLowLevelTracingKit/interface.hpp"
10+
#include "CommonLowLevelTracingKit/decoder/Tracebuffer.hpp"
11+
#include "commands/interface.hpp"
1212

1313
using namespace std::string_literals;
1414

command_line_tool/commands/snapshot/snapshot.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2024, International Business Machines
22
// SPDX-License-Identifier: BSD-2-Clause-Patent
33

4-
#include "CommonLowLevelTracingKit/snapshot.hpp"
5-
#include "CommonLowLevelTracingKit/interface.hpp"
4+
#include "CommonLowLevelTracingKit/snapshot/snapshot.hpp"
5+
#include "commands/interface.hpp"
66
#include <iostream>
77
#include <optional>
88
#include <stdexcept>
@@ -52,7 +52,7 @@ static void add_snapshot_command(CLI::App &app)
5252
static CommonLowLevelTracingKit::snapshot::verbose_function_t verbose{};
5353
command->add_flag_callback("--verbose,-v", [&]() { verbose = verbose_func; });
5454

55-
static std::string output_file_name{"traces.snapshot_library"};
55+
static std::string output_file_name{"snapshot.clltk"};
5656
command->add_option("--output,-f", output_file_name, "")->capture_default_str();
5757

5858
static std::vector<std::string> tracepoints;

command_line_tool/commands/trace/tracebuffer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2024, International Business Machines
22
// SPDX-License-Identifier: BSD-2-Clause-Patent
33

4-
#include "CommonLowLevelTracingKit/interface.hpp"
5-
#include "CommonLowLevelTracingKit/tracing.h"
4+
#include "CommonLowLevelTracingKit/tracing/tracing.h"
5+
#include "commands/interface.hpp"
66
#include <stddef.h>
77
#include <string>
88

command_line_tool/commands/trace/tracepipe.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2024, International Business Machines
22
// SPDX-License-Identifier: BSD-2-Clause-Patent
33

4-
#include "CommonLowLevelTracingKit/interface.hpp"
5-
#include "CommonLowLevelTracingKit/tracing.h"
4+
#include "CommonLowLevelTracingKit/tracing/tracing.h"
5+
#include "commands/interface.hpp"
66
#include <functional>
77
#include <initializer_list>
88
#include <iostream>

command_line_tool/commands/trace/tracepoint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2024, International Business Machines
22
// SPDX-License-Identifier: BSD-2-Clause-Patent
33

4-
#include "CommonLowLevelTracingKit/interface.hpp"
5-
#include "CommonLowLevelTracingKit/tracing.h"
4+
#include "CommonLowLevelTracingKit/tracing/tracing.h"
5+
#include "commands/interface.hpp"
66
#include <cstdint>
77
#include <stddef.h>
88
#include <string>

0 commit comments

Comments
 (0)