Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: |
git config --global --add safe.directory '*'
apt-get update
apt-get install -y build-essential cmake g++-11 g++-12 python3-pip libdw-dev libsqlite3-dev rccl-dev rccl-unittests rocjpeg-dev rocjpeg-test rocdecode-dev rocdecode-test
apt-get install -y build-essential cmake g++-11 g++-12 python3-pip libdw-dev libsqlite3-dev rccl-dev rccl-unittests rocjpeg-dev rocjpeg-test rocdecode-dev rocdecode-test liblttng-ust-dev lttng-tools
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
python3 -m pip install -U --user -r requirements.txt
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@
[submodule "external/gotcha"]
path = external/gotcha
url = https://jrmadsen@github.com/jrmadsen/GOTCHA
[submodule "external/lttng"]
path = external/lttng
url = https://github.com/lttng/lttng-ust.git
1 change: 1 addition & 0 deletions cmake/rocprofiler_interfaces.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ rocprofiler_add_interface_library(rocprofiler-sdk-cereal "Enables Cereal support
INTERNAL)
rocprofiler_add_interface_library(rocprofiler-sdk-sqlite3 "Enables SQLite3 support"
INTERNAL)
rocprofiler_add_interface_library(rocprofiler-sdk-lttng "Enables LTTng support" INTERNAL)
rocprofiler_add_interface_library(rocprofiler-sdk-pybind11 "Enables PyBind11 support"
INTERNAL)
rocprofiler_add_interface_library(rocprofiler-sdk-gotcha "Enables GOTCHA support"
Expand Down
2 changes: 2 additions & 0 deletions cmake/rocprofiler_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ rocprofiler_add_option(ROCPROFILER_BUILD_GLOG
"Enable building glog (Google logging) library internally" ON)
rocprofiler_add_option(ROCPROFILER_BUILD_SQLITE3
"Enable building sqlite3 library internally" OFF)
rocprofiler_add_option(ROCPROFILER_BUILD_LTTNG
"Enable building lttng-ust library internally" OFF)
rocprofiler_add_option(ROCPROFILER_BUILD_PYBIND11
"Enable building pybind11 library internally" ON)
rocprofiler_add_option(ROCPROFILER_BUILD_GOTCHA
Expand Down
57 changes: 57 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,63 @@ else()
target_link_libraries(rocprofiler-sdk-sqlite3 INTERFACE SQLite::SQLite3)
endif()

#
# LTTng-UST
#
if(ROCPROFILER_BUILD_LTTNG)
# checkout submodule if not already checked out or clone repo if no .gitmodules file
rocprofiler_checkout_git_submodule(
RECURSIVE
RELATIVE_PATH external/lttng
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
TEST_FILE bootstrap
REPO_URL https://github.com/lttng/lttng-ust
REPO_BRANCH "stable-2.13")

find_program(
MAKE_COMMAND
NAMES make gmake
PATH_SUFFIXES bin REQUIRED)

execute_process(
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/external/lttng
COMMAND ./bootstrap
RESULT_VARIABLE RET)

if(RET GREATER 0)
message(STATUS "Bootstrap command for LTTng-UST failed.")
message(FATAL_ERROR "Command: ./bootstrap")
endif()

include(ExternalProject)
externalproject_add(
rocprofiler-sdk-lttng-build
PREFIX ${PROJECT_BINARY_DIR}/external/lttng/build
SOURCE_DIR ${PROJECT_SOURCE_DIR}/external/lttng
BUILD_IN_SOURCE 0
CONFIGURE_COMMAND
<SOURCE_DIR>/configure --prefix=${PROJECT_BINARY_DIR}/external/lttng/install
--libdir=${PROJECT_BINARY_DIR}/external/lttng/install/lib --disable-man-pages
--with-pic CFLAGS=-O3\ -g1
BUILD_COMMAND ${MAKE_COMMAND} -j ${CMAKE_BUILD_PARALLEL_LEVEL} install -s
INSTALL_COMMAND "")

target_link_libraries(
rocprofiler-sdk-lttng
INTERFACE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/external/lttng/install/lib/liblttng-ust.so>
)
target_include_directories(
rocprofiler-sdk-lttng SYSTEM
INTERFACE $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/external/lttng/install/include>)
add_dependencies(rocprofiler-sdk-lttng rocprofiler-sdk-lttng-build)
else()
find_package(LTTngUST REQUIRED)
target_include_directories(rocprofiler-sdk-lttng SYSTEM
INTERFACE ${LTTNGUST_INCLUDE_DIRS})
target_link_libraries(rocprofiler-sdk-lttng INTERFACE ${LTTNGUST_LIBRARIES})
endif()

#
# PyBind11
#
Expand Down
1 change: 1 addition & 0 deletions external/lttng
Submodule lttng added at e8306a
4 changes: 2 additions & 2 deletions source/bin/rocprofv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ def add_parser_bool_argument(gparser, *args, **kwargs):
io_options.add_argument(
"-f",
"--output-format",
help="For adding output format (supported formats: csv, json, pftrace, otf2, rocpd)",
help="For adding output format (supported formats: csv, json, pftrace, otf2, rocpd, lttng)",
nargs="+",
default=None,
choices=("csv", "json", "pftrace", "otf2", "rocpd"),
choices=("csv", "json", "pftrace", "otf2", "rocpd", "lttng"),
type=str.lower,
)
add_parser_bool_argument(
Expand Down
3 changes: 3 additions & 0 deletions source/lib/output/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set(TOOL_OUTPUT_HEADERS
generatePerfetto.hpp
generateStats.hpp
generateRocpd.hpp
generateLTTng.hpp
generator.hpp
kernel_symbol_info.hpp
host_symbol_info.hpp
Expand All @@ -43,6 +44,7 @@ set(TOOL_OUTPUT_SOURCES
generatePerfetto.cpp
generateStats.cpp
generateRocpd.cpp
generateLTTng.cpp
metadata.cpp
node_info.cpp
output_config.cpp
Expand Down Expand Up @@ -76,3 +78,4 @@ target_compile_definitions(rocprofiler-sdk-output-library
PRIVATE PROJECT_BINARY_DIR="${PROJECT_BINARY_DIR}")

add_subdirectory(sql)
add_subdirectory(lttng)
Loading