Commit 4a0bdd16 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/fix-regression-asn1c-debug' into integration_2023_w31

parents 1eb683f6 31f9dff9
...@@ -256,8 +256,11 @@ add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"") ...@@ -256,8 +256,11 @@ add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
# Debug related options # Debug related options
######################################### #########################################
add_boolean_option(DEBUG_ASN1 False "ASN1 coder/decoder Debug" OFF) add_boolean_option(DEBUG_ASN1 False "Enable ASN1 debug logs" OFF)
#add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace, not found in code, commented out, to be removed # asn1c skeletons have hardcoded this flag to make customized debug logs
# OAI uses this feature to re-use OAI LOG_I(ASN1, ...)
# see common/utils/config.h
add_boolean_option(TRACE_ASN1C_ENC_DEC OFF "Enable ASN1 encoder/decoder debug traces via OAI logging system" ON)
add_boolean_option(T_TRACER True "Activate the T tracer, a debugging/monitoring framework" ON) add_boolean_option(T_TRACER True "Activate the T tracer, a debugging/monitoring framework" ON)
add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs" ON) add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs" ON)
add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace" ON) add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace" ON)
...@@ -267,12 +270,6 @@ set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti) ...@@ -267,12 +270,6 @@ set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti)
add_library(ITTI ${OCP_ITTI}/intertask_interface.cpp) add_library(ITTI ${OCP_ITTI}/intertask_interface.cpp)
target_link_libraries(ITTI PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) target_link_libraries(ITTI PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
# asn1c skeletons have hardcoded this flag to make customized debug logs
# OAI uses this feature to re-use OAI LOG_I(ASN1, ...)
if (DEBUG_ASN1C)
add_definitions(-DHAVE_CONFIG_H)
endif()
# asn1c skeletons need this # asn1c skeletons need this
add_definitions(-DHAVE_NETINET_IN_H) add_definitions(-DHAVE_NETINET_IN_H)
......
...@@ -120,6 +120,8 @@ Options: ...@@ -120,6 +120,8 @@ Options:
Builds Coverity-Scan objects for upload Builds Coverity-Scan objects for upload
--disable-deadline --disable-deadline
Disables deadline scheduler of Linux kernel (>=3.14.x). Disables deadline scheduler of Linux kernel (>=3.14.x).
--trace-asn1c-enc-dec
Output asn1c logging traces via OAI logging system.
--enable-deadline --enable-deadline
Enable deadline scheduler of Linux kernel (>=3.14.x). Enable deadline scheduler of Linux kernel (>=3.14.x).
--disable-cpu-affinity --disable-cpu-affinity
...@@ -416,6 +418,10 @@ function main() { ...@@ -416,6 +418,10 @@ function main() {
sleep 2 sleep 2
CMAKE_CMD="$CMAKE_CMD -DSANITIZE_MEMORY=ON -DSANITIZE_ADDRESS=OFF -DSANITIZE_UNDEFINED=OFF" CMAKE_CMD="$CMAKE_CMD -DSANITIZE_MEMORY=ON -DSANITIZE_ADDRESS=OFF -DSANITIZE_UNDEFINED=OFF"
shift;; shift;;
--trace-asn1c-enc-dec)
CMAKE_CMD="$CMAKE_CMD -DTRACE_ASN1C_ENC_DEC=ON"
echo_info "Enabling asn1c internal traces via OAI logging system"
shift 1;;
-h | --help) -h | --help)
print_help print_help
exit 1;; exit 1;;
......
...@@ -969,25 +969,25 @@ ID = LEGACY_OSA_TRACE ...@@ -969,25 +969,25 @@ ID = LEGACY_OSA_TRACE
GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_TRACE:LEGACY GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_ASN_INFO ID = LEGACY_ASN1_INFO
DESC = ASN legacy logs - info level DESC = ASN1 legacy logs - info level
GROUP = ALL:LEGACY_ASN:LEGACY_GROUP_INFO:LEGACY GROUP = ALL:LEGACY_ASN1:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_ASN_ERROR ID = LEGACY_ASN1_ERROR
DESC = ASN legacy logs - error level DESC = ASN1 legacy logs - error level
GROUP = ALL:LEGACY_ASN:LEGACY_GROUP_ERROR:LEGACY GROUP = ALL:LEGACY_ASN1:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_ASN_WARNING ID = LEGACY_ASN1_WARNING
DESC = ASN legacy logs - warning level DESC = ASN1 legacy logs - warning level
GROUP = ALL:LEGACY_ASN:LEGACY_GROUP_WARNING:LEGACY GROUP = ALL:LEGACY_ASN1:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_ASN_DEBUG ID = LEGACY_ASN1_DEBUG
DESC = ASN legacy logs - debug level DESC = ASN1 legacy logs - debug level
GROUP = ALL:LEGACY_ASN:LEGACY_GROUP_DEBUG:LEGACY GROUP = ALL:LEGACY_ASN1:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_ASN_TRACE ID = LEGACY_ASN1_TRACE
DESC = ASN legacy logs - trace level DESC = ASN1 legacy logs - trace level
GROUP = ALL:LEGACY_ASN:LEGACY_GROUP_TRACE:LEGACY GROUP = ALL:LEGACY_ASN1:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_SIM_INFO ID = LEGACY_SIM_INFO
......
add_library(tracer_utils OBJECT config.c database.c event.c handler.c utils.c) add_library(tracer_utils OBJECT configuration.c database.c event.c handler.c utils.c)
target_link_libraries(tracer_utils PUBLIC m pthread) target_link_libraries(tracer_utils PUBLIC m pthread)
add_library(tracer_events OBJECT event_selector.c) add_library(tracer_events OBJECT event_selector.c)
......
...@@ -10,7 +10,7 @@ all: record replay extract_config textlog enb ue vcd macpdu2wireshark \ ...@@ -10,7 +10,7 @@ all: record replay extract_config textlog enb ue vcd macpdu2wireshark \
extract_input_subframe extract_output_subframe to_vcd extract multi \ extract_input_subframe extract_output_subframe to_vcd extract multi \
gnb gnb
record: utils.o record.o database.o config.o record: utils.o record.o database.o configuration.o
$(CC) $(CFLAGS) -o record $^ $(LIBS) $(CC) $(CFLAGS) -o record $^ $(LIBS)
replay: utils.o replay.o replay: utils.o replay.o
...@@ -20,48 +20,48 @@ extract_config: extract_config.o ...@@ -20,48 +20,48 @@ extract_config: extract_config.o
$(CC) $(CFLAGS) -o extract_config $^ $(LIBS) $(CC) $(CFLAGS) -o extract_config $^ $(LIBS)
extract_input_subframe: extract_input_subframe.o database.o event.o utils.o \ extract_input_subframe: extract_input_subframe.o database.o event.o utils.o \
config.o configuration.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
extract_output_subframe: extract_output_subframe.o database.o event.o utils.o \ extract_output_subframe: extract_output_subframe.o database.o event.o utils.o \
config.o configuration.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
extract: extract.o database.o event.o utils.o config.o extract: extract.o database.o event.o utils.o configuration.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
textlog: utils.o textlog.o database.o event.o handler.o config.o \ textlog: utils.o textlog.o database.o event.o handler.o configuration.o \
event_selector.o view/view.a gui/gui.a logger/logger.a \ event_selector.o view/view.a gui/gui.a logger/logger.a \
filter/filter.a filter/filter.a
$(CC) $(CFLAGS) -o textlog $^ $(LIBS) $(XLIBS) $(CC) $(CFLAGS) -o textlog $^ $(LIBS) $(XLIBS)
enb: utils.o enb.o database.o event.o handler.o config.o \ enb: utils.o enb.o database.o event.o handler.o configuration.o \
event_selector.o view/view.a gui/gui.a logger/logger.a \ event_selector.o view/view.a gui/gui.a logger/logger.a \
filter/filter.a filter/filter.a
$(CC) $(CFLAGS) -o enb $^ $(LIBS) $(XLIBS) $(CC) $(CFLAGS) -o enb $^ $(LIBS) $(XLIBS)
ue: utils.o ue.o database.o event.o handler.o config.o \ ue: utils.o ue.o database.o event.o handler.o configuration.o \
event_selector.o view/view.a gui/gui.a logger/logger.a \ event_selector.o view/view.a gui/gui.a logger/logger.a \
filter/filter.a filter/filter.a
$(CC) $(CFLAGS) -o ue $^ $(LIBS) $(XLIBS) $(CC) $(CFLAGS) -o ue $^ $(LIBS) $(XLIBS)
vcd: utils.o vcd.o database.o event.o handler.o config.o \ vcd: utils.o vcd.o database.o event.o handler.o configuration.o \
event_selector.o view/view.a gui/gui.a logger/logger.a \ event_selector.o view/view.a gui/gui.a logger/logger.a \
filter/filter.a filter/filter.a
$(CC) $(CFLAGS) -o vcd $^ $(LIBS) $(XLIBS) $(CC) $(CFLAGS) -o vcd $^ $(LIBS) $(XLIBS)
to_vcd: to_vcd.o database.o event.o handler.o utils.o config.o \ to_vcd: to_vcd.o database.o event.o handler.o utils.o configuration.o \
logger/logger.a filter/filter.a logger/logger.a filter/filter.a
$(CC) $(CFLAGS) -o to_vcd $^ $(LIBS) $(CC) $(CFLAGS) -o to_vcd $^ $(LIBS)
macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \ macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \
config.o configuration.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
multi: multi.o utils.o database.o config.o multi: multi.o utils.o database.o configuration.o
$(CC) $(CFLAGS) -o multi $^ $(LIBS) $(CC) $(CFLAGS) -o multi $^ $(LIBS)
gnb: utils.o gnb.o database.o event.o handler.o config.o \ gnb: utils.o gnb.o database.o event.o handler.o configuration.o \
view/view.a gui/gui.a logger/logger.a \ view/view.a gui/gui.a logger/logger.a \
filter/filter.a filter/filter.a
$(CC) $(CFLAGS) -o gnb $^ $(LIBS) $(XLIBS) $(CC) $(CFLAGS) -o gnb $^ $(LIBS) $(XLIBS)
......
#include "config.h" #include "configuration.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "utils.h" #include "utils.h"
#include "event_selector.h" #include "event_selector.h"
#include "openair_logo.h" #include "openair_logo.h"
#include "config.h" #include "configuration.h"
/****************************************************************************/ /****************************************************************************/
/* conversion from rnti to "ue_id" (which does not really exists) */ /* conversion from rnti to "ue_id" (which does not really exists) */
......
#include "event.h" #include "event.h"
#include "database.h" #include "database.h"
#include "utils.h" #include "utils.h"
#include "config.h" #include "configuration.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <fcntl.h> #include <fcntl.h>
#include "database.h" #include "database.h"
#include "event.h" #include "event.h"
#include "config.h" #include "configuration.h"
void usage(void) void usage(void)
{ {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <fcntl.h> #include <fcntl.h>
#include "database.h" #include "database.h"
#include "event.h" #include "event.h"
#include "config.h" #include "configuration.h"
void usage(void) void usage(void)
{ {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <fcntl.h> #include <fcntl.h>
#include "database.h" #include "database.h"
#include "event.h" #include "event.h"
#include "config.h" #include "configuration.h"
void usage(void) void usage(void)
{ {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "database.h" #include "database.h"
#include "event.h" #include "event.h"
#include "handler.h" #include "handler.h"
#include "config.h" #include "configuration.h"
#include "logger/logger.h" #include "logger/logger.h"
#include "gui/gui.h" #include "gui/gui.h"
#include "utils.h" #include "utils.h"
......
...@@ -5,18 +5,18 @@ LIBS=-lX11 -lm -lpng -lXft ...@@ -5,18 +5,18 @@ LIBS=-lX11 -lm -lpng -lXft
all: dump_nack_signal time_meas timeplot multi-rru-clean all: dump_nack_signal time_meas timeplot multi-rru-clean
dump_nack_signal: ../utils.o ../database.o ../config.o ../event.o \ dump_nack_signal: ../utils.o ../database.o ../configuration.o ../event.o \
dump_nack_signal.o dump_nack_signal.o
$(CC) $(CFLAGS) -o dump_nack_signal $^ $(LIBS) $(CC) $(CFLAGS) -o dump_nack_signal $^ $(LIBS)
time_meas: ../utils.o ../database.o ../config.o ../event.o \ time_meas: ../utils.o ../database.o ../configuration.o ../event.o \
time_meas.o time_meas.o
$(CC) $(CFLAGS) -o time_meas $^ $(LIBS) $(CC) $(CFLAGS) -o time_meas $^ $(LIBS)
timplot: timeplot.o timplot: timeplot.o
$(CC) $(CFLAGS) -o timeplot $^ $(LIBS) $(CC) $(CFLAGS) -o timeplot $^ $(LIBS)
multi-rru-clean: ../utils.o ../database.o ../event.o ../config.o multi-rru-clean.o multi-rru-clean: ../utils.o ../database.o ../event.o ../configuration.o multi-rru-clean.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
.PHONY: all .PHONY: all
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "database.h" #include "database.h"
#include "event.h" #include "event.h"
#include "handler.h" #include "handler.h"
#include "config.h" #include "configuration.h"
#include "utils.h" #include "utils.h"
#include "packet-mac-lte.h" #include "packet-mac-lte.h"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "database.h" #include "database.h"
#include "utils.h" #include "utils.h"
#include "../T.h" #include "../T.h"
#include "config.h" #include "configuration.h"
#define DEFAULT_LOCAL_PORT 2022 #define DEFAULT_LOCAL_PORT 2022
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "database.h" #include "database.h"
#include "utils.h" #include "utils.h"
#include "../T_defs.h" #include "../T_defs.h"
#include "config.h" #include "configuration.h"
void usage(void) void usage(void)
{ {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "gui/gui.h" #include "gui/gui.h"
#include "utils.h" #include "utils.h"
#include "event_selector.h" #include "event_selector.h"
#include "config.h" #include "configuration.h"
typedef struct { typedef struct {
int socket; int socket;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "database.h" #include "database.h"
#include "utils.h" #include "utils.h"
#include "handler.h" #include "handler.h"
#include "config.h" #include "configuration.h"
#include "logger/logger.h" #include "logger/logger.h"
#include "view/view.h" #include "view/view.h"
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "utils.h" #include "utils.h"
#include "event_selector.h" #include "event_selector.h"
#include "openair_logo.h" #include "openair_logo.h"
#include "config.h" #include "configuration.h"
typedef struct { typedef struct {
view *phyview; view *phyview;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "gui/gui.h" #include "gui/gui.h"
#include "utils.h" #include "utils.h"
#include "event_selector.h" #include "event_selector.h"
#include "config.h" #include "configuration.h"
typedef struct { typedef struct {
int socket; int socket;
......
...@@ -22,12 +22,15 @@ ...@@ -22,12 +22,15 @@
#ifndef UTILS_CONFIG_H_ASN1 #ifndef UTILS_CONFIG_H_ASN1
#define UTILS_CONFIG_H_ASN1 #define UTILS_CONFIG_H_ASN1
// This is hard coded file name "config.h" and HAVE_CONFIG_H_ in asn1c skeletons // This is hard coded file name "config.h" in asn1c skeletons
/* /*
* This file "config.h" will be used by asn1c if HAVE_CONFIG_H_ is defined and * This file "config.h" will be used by asn1c if HAVE_CONFIG_H_ is defined and
* included. This logs asn1c encoder and decoder traces at execution time using * included (this is the case for OAI).
* the regular OAI logging system, i.e., LOG_I(ASN1...); * This allows to trace the asn1c encoder and decoder at execution time using
* the regular OAI logging system, i.e., LOG_I(ASN1, ...);
*
* to enable it, at compilation time, see ./build_oai --enable-asn1c-debug
* *
* As it is very verbose, note that you can change the log level per module in * As it is very verbose, note that you can change the log level per module in
* source or in gdb, e.g., to only activate it for a short time. * source or in gdb, e.g., to only activate it for a short time.
...@@ -47,7 +50,7 @@ ...@@ -47,7 +50,7 @@
*/ */
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#if DEBUG_ASN1C #if TRACE_ASN1C_ENC_DEC
#define ASN_DEBUG(x...) do{ LOG_I(ASN1,x);LOG_I(ASN1,"\n"); } while(false) #define ASN_DEBUG(x...) do{ LOG_I(ASN1,x);LOG_I(ASN1,"\n"); } while(false)
#else #else
#define ASN_DEBUG(x...) #define ASN_DEBUG(x...)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment