Add T tracer to record configured events to database

This extends the functionality provided by record in that it allows
collection of data into a Clickhouse database, allowing aggregation of
data from gNB and UE for functions like channel estimation for PUSCH
transmissions that did not decode successfully at the gNB.

It is intended to be used in conjunction with Aerial Data Lake but is
not limited to it. Data access is simpler than in !3462, but could be
improved using the metadata approach from !3462.

The integration uses logfmt for fast logging, and a clickhouse DB
client, both integrated using CPM.

This change set also adds a docker-compose file for a UE on 100MHz, to
be used with Aerial configurations, and builds the tracer for Aerial and
nrUE docker files.
This commit is contained in:
Robert Schmidt
2026-03-05 14:39:28 +01:00
parent 7fa4d018d4
commit 1d69eb0e1e
12 changed files with 1492 additions and 26 deletions
+1 -1
View File
@@ -1404,7 +1404,7 @@ ID = UE_PHY_PDCCH_ENERGY
ID = UE_PHY_PDSCH_IQ
DESC = UE PDSCH received IQ data
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp
FORMAT = int,eNB_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pdsch_comp
ID = UE_PHY_PDSCH_ENERGY
DESC = UE PDSCH 1 energy and threshold
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
+54
View File
@@ -37,11 +37,65 @@ add_subdirectory(filter)
add_subdirectory(logger)
add_subdirectory(view)
# Option to enable record_db tracer tool with ClickHouse database support
add_boolean_option(T_RECORD_DB OFF "Compile record_db tracer tool with ClickHouse support" OFF)
if(T_RECORD_DB)
# Save current BUILD_SHARED_LIBS setting
set(SAVED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
# Configure options for clickhouse-cpp
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
# Save current compiler flags and disable -Werror for zstd
set(SAVED_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
# Check if system zstd library is available
find_library(ZSTD_LIBRARY NAMES zstd)
if(ZSTD_LIBRARY)
# Use system zstd library to avoid building legacy zstd code with warnings
set(WITH_SYSTEM_ZSTD ON CACHE BOOL "" FORCE)
else()
# Fall back to bundled zstd and suppress warnings from legacy code
# https://github.com/ClickHouse/clickhouse-cpp/blob/master/contrib/zstd/zstd/legacy/zstd_v01.c#L1935
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-maybe-uninitialized -Wno-uninitialized")
endif()
CPMAddPackage(
NAME clickhouse-cpp
GITHUB_REPOSITORY ClickHouse/clickhouse-cpp
GIT_TAG master
)
# Restore original compiler flags and BUILD_SHARED_LIBS
set(CMAKE_C_FLAGS "${SAVED_CMAKE_C_FLAGS}")
set(BUILD_SHARED_LIBS ${SAVED_BUILD_SHARED_LIBS} CACHE BOOL "" FORCE)
CPMAddPackage(
NAME fmtlog
GITHUB_REPOSITORY MengRao/fmtlog
GIT_TAG main
GIT_SHALLOW FALSE
)
add_executable(record_db record_db.cpp)
target_include_directories(record_db PRIVATE ${fmtlog_SOURCE_DIR} ${fmtlog_SOURCE_DIR}/fmt/include)
target_link_libraries(record_db PRIVATE tracer_utils clickhouse-cpp-lib fmtlog-shared fmt)
endif() # T_RECORD_DB
add_custom_target(T_tools)
add_dependencies(T_tools
record replay extract_config extract_input_subframe
extract_output_subframe extract macpdu2wireshark multi
textlog csv)
# Add record_db to T_tools if it was built
if(TARGET record_db)
add_dependencies(T_tools record_db)
endif()
add_dependencies(nr-softmodem T_tools)
add_dependencies(nr-uesoftmodem T_tools)
add_dependencies(lte-softmodem T_tools)
+10 -2
View File
@@ -1,18 +1,23 @@
CC=gcc
CXX=g++
CFLAGS=-Wall -g -pthread -DT_TRACER -I. -I../incgen
CXXFLAGS=-Wall -g -pthread -DT_TRACER -I. -I../incgen -std=c++11
#CFLAGS += -O3 -ffast-math -fomit-frame-pointer
LIBS=-lm
XLIBS=-lX11 -lpng -lXft
all: record replay extract_config textlog enb ue vcd macpdu2wireshark \
all: record record_db replay extract_config textlog enb ue vcd macpdu2wireshark \
extract_input_subframe extract_output_subframe to_vcd extract multi \
gnb t_tracer_app_gnb t_tracer_app_ue gnb_mac csv
record: utils.o record.o database.o configuration.o
$(CC) $(CFLAGS) -o record $^ $(LIBS)
record_db: utils.o record_db.o database.o configuration.o
$(CXX) $(CXXFLAGS) -o record_db $^ $(LIBS) -lclickhouse-cpp-lib $(FMTLOG_LIBS)
replay: utils.o replay.o
$(CC) $(CFLAGS) -o replay $^ $(LIBS)
@@ -102,8 +107,11 @@ filter/filter.a:
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
clean:
rm -f *.o core tracer_remote textlog enb ue vcd record replay
rm -f *.o core tracer_remote textlog enb ue vcd record record_db replay
rm -f extract_config macpdu2wireshark extract_input_subframe
rm -f extract_output_subframe to_vcd extract multi gnb
rm -f t_tracer_app_gnb t_tracer_app_ue gnb_mac csv
File diff suppressed because it is too large Load Diff