Commit 31f9dff9 authored by Robert Schmidt's avatar Robert Schmidt

Fix regression for tracing asn1c enc/dec tracing

As described in common/utils/config.h, it is possible to hook into the
asn1c tracing mechanism to print logs.

This commit fixes a regression to print theses traces properly in OAI.
Above-mentioned file explains also how to reduce the amount of logs,
e.g., for single code blocks.
parent f099ff59
...@@ -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;;
......
...@@ -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