Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(mme): Remove unused trace defines #12055

Merged
merged 5 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions lte/gateway/c/core/oai/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,9 @@ set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBIN
################################################################
set(STATE_PROTO_DIR $ENV{MAGMA_ROOT}/lte/protos/oai)

################################################################
# S1AP LAYER OPTIONS
################################################################
add_boolean_option(S1AP_DEBUG_LIST False "Traces, option to be removed soon")

################################################################
# SCTP LAYER OPTIONS
################################################################
add_boolean_option(SCTP_DUMP_LIST False "Traces, option to be removed soon")
add_boolean_option(TRACE_HASHTABLE False "Trace hashtables operations ")
add_boolean_option(TRACE_3GPP_SPEC True "Log hits of 3GPP specifications requirements")
add_boolean_option(LINK_GCOV False "Whether to link gcov")

if (EMBEDDED_SGW)
Expand Down
4 changes: 0 additions & 4 deletions lte/gateway/c/core/oai/lib/3gpp/3gpp_requirements.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,5 @@
#ifndef FILE_REQUIREMENTS_SEEN
#define FILE_REQUIREMENTS_SEEN

#if TRACE_3GPP_SPEC
#define REQUIREMENT_3GPP_SPEC(pRoTo, sTr) OAILOG_SPEC(pRoTo, sTr)
#else
#define REQUIREMENT_3GPP_SPEC(...)
themarwhal marked this conversation as resolved.
Show resolved Hide resolved
#endif
#endif /* FILE_REQUIREMENTS_SEEN */
7 changes: 0 additions & 7 deletions lte/gateway/c/core/oai/lib/hashtable/hashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,7 @@
#include "lte/gateway/c/core/oai/common/dynamic_memory_check.h"
#include "lte/gateway/c/core/oai/lib/hashtable/hashtable.h"

#if TRACE_HASHTABLE
#define PRINT_HASHTABLE(hTbLe, ...) \
do { \
if (hTbLe->log_enabled) OAILOG_TRACE(LOG_UTIL, ##__VA_ARGS__); \
} while (0)
#else
#define PRINT_HASHTABLE(...)
#endif
//------------------------------------------------------------------------------
char* hashtable_rc_code2string(hashtable_rc_t rcP) {
switch (rcP) {
Expand Down
7 changes: 0 additions & 7 deletions lte/gateway/c/core/oai/lib/hashtable/hashtable_uint64.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@
#include "lte/gateway/c/core/oai/common/dynamic_memory_check.h"
#include "lte/gateway/c/core/oai/lib/hashtable/hashtable.h"

#if TRACE_HASHTABLE
#define PRINT_HASHTABLE(hTbLe, ...) \
do { \
if (hTbLe->log_enabled) OAILOG_TRACE(LOG_UTIL, ##__VA_ARGS__); \
} while (0)
#else
#define PRINT_HASHTABLE(...)
#endif

//------------------------------------------------------------------------------
/*
Expand Down
8 changes: 0 additions & 8 deletions lte/gateway/c/core/oai/lib/hashtable/obj_hashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,7 @@
#include "lte/gateway/c/core/oai/lib/hashtable/obj_hashtable.h"
#include "lte/gateway/c/core/oai/common/dynamic_memory_check.h"

#if TRACE_HASHTABLE
#define PRINT_HASHTABLE(hTbLe, ...) \
do { \
if (hTbLe->log_enabled) OAILOG_TRACE(LOG_UTIL, ##__VA_ARGS__); \
} while (0)
#else
#define PRINT_HASHTABLE(...)
#endif

//------------------------------------------------------------------------------
/*
Default hash function
Expand Down
8 changes: 0 additions & 8 deletions lte/gateway/c/core/oai/lib/hashtable/obj_hashtable_uint64.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,7 @@
#include "lte/gateway/c/core/oai/common/dynamic_memory_check.h"
#include "lte/gateway/c/core/oai/lib/hashtable/hashtable.h"

#if TRACE_HASHTABLE
#define PRINT_HASHTABLE(hTbLe, ...) \
do { \
if (hTbLe->log_enabled) OAILOG_TRACE(LOG_UTIL, ##__VA_ARGS__); \
} while (0)
#else
#define PRINT_HASHTABLE(...)
themarwhal marked this conversation as resolved.
Show resolved Hide resolved
#endif

//------------------------------------------------------------------------------
/*
Default hash function
Expand Down
5 changes: 0 additions & 5 deletions lte/gateway/c/core/oai/oai_mme/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Override options for MME
set(BYTE_ORDER=LITTLE_ENDIAN)
set(S1AP_DEBUG_LIST False)
set(SCTP_DUMP_LIST False)
set(TRACE_HASHTABLE False)
set(TRACE_3GPP_SPEC False)


# Dependencies
pkg_search_module(LIBXML2 libxml-2.0 REQUIRED)
Expand Down
8 changes: 0 additions & 8 deletions lte/gateway/c/core/oai/tasks/mme_app/mme_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1821,14 +1821,6 @@ void mme_config_display(mme_config_t* config_pP) {
CMAKE_BUILD_TYPE);
OAILOG_DEBUG(LOG_CONFIG, "Built with PACKAGE_NAME ....................: %s\n",
PACKAGE_NAME);
OAILOG_DEBUG(LOG_CONFIG, "Built with S1AP_DEBUG_LIST .................: %d\n",
S1AP_DEBUG_LIST);
OAILOG_DEBUG(LOG_CONFIG, "Built with SCTP_DUMP_LIST ..................: %d\n",
SCTP_DUMP_LIST);
OAILOG_DEBUG(LOG_CONFIG, "Built with TRACE_HASHTABLE .................: %d\n",
TRACE_HASHTABLE);
OAILOG_DEBUG(LOG_CONFIG, "Built with TRACE_3GPP_SPEC .................: %d\n",
TRACE_3GPP_SPEC);

OAILOG_INFO(LOG_CONFIG, "Configuration:\n");
OAILOG_INFO(LOG_CONFIG, "- File .................................: %s\n",
Expand Down
73 changes: 0 additions & 73 deletions lte/gateway/c/core/oai/tasks/s1ap/s1ap_mme.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,6 @@
#include "lte/gateway/c/core/oai/include/s1ap_messages_types.h"
#include "lte/gateway/c/core/oai/include/sctp_messages_types.h"

#if S1AP_DEBUG_LIST
#define eNB_LIST_OUT(x, args...) \
(LOG_S1AP, "[eNB]%*s" x "\n", 4 * indent, "", ##args)
#define UE_LIST_OUT(x, args...) \
OAILOG_DEBUG(LOG_S1AP, "[UE] %*s" x "\n", 4 * indent, "", ##args)
#else
#define eNB_LIST_OUT(x, args...)
#define UE_LIST_OUT(x, args...)
#endif

bool s1ap_dump_ue_hash_cb(hash_key_t keyP, void* ue_void, void* parameter,
void** unused_res);
static void start_stats_timer(void);
static int handle_stats_timer(zloop_t* loop, int id, void* arg);
static long epc_stats_timer_id;
Expand Down Expand Up @@ -375,67 +363,6 @@ void s1ap_mme_exit(void) {
pthread_exit(NULL);
}

//------------------------------------------------------------------------------
void s1ap_dump_enb(const enb_description_t* const enb_ref) {
#ifdef S1AP_DEBUG_LIST
// Reset indentation
indent = 0;

if (enb_ref == NULL) {
return;
}

eNB_LIST_OUT("");
eNB_LIST_OUT("eNB name: %s",
enb_ref->enb_name == NULL ? "not present" : enb_ref->enb_name);
eNB_LIST_OUT("eNB ID: %07x", enb_ref->enb_id);
eNB_LIST_OUT("SCTP assoc id: %d", enb_ref->sctp_assoc_id);
eNB_LIST_OUT("SCTP instreams: %d", enb_ref->instreams);
eNB_LIST_OUT("SCTP outstreams: %d", enb_ref->outstreams);
eNB_LIST_OUT("UEs attached to eNB: %d", enb_ref->nb_ue_associated);
indent++;
sctp_assoc_id_t sctp_assoc_id = enb_ref->sctp_assoc_id;

hash_table_ts_t* state_ue_ht = get_s1ap_ue_state();
hashtable_ts_apply_callback_on_elements((hash_table_ts_t* const)state_ue_ht,
s1ap_dump_ue_hash_cb, &sctp_assoc_id,
NULL);
indent--;
eNB_LIST_OUT("");
#else
s1ap_dump_ue(NULL);
#endif
}

//------------------------------------------------------------------------------
bool s1ap_dump_ue_hash_cb(__attribute__((unused)) const hash_key_t keyP,
void* const ue_void, void* parameter,
void __attribute__((unused)) * *unused_resultP) {
ue_description_t* ue_ref = (ue_description_t*)ue_void;
sctp_assoc_id_t* sctp_assoc_id = (sctp_assoc_id_t*)parameter;
if (ue_ref == NULL) {
return false;
}

if (ue_ref->sctp_assoc_id == *sctp_assoc_id) {
s1ap_dump_ue(ue_ref);
}
return false;
}

//------------------------------------------------------------------------------
void s1ap_dump_ue(const ue_description_t* const ue_ref) {
#ifdef S1AP_DEBUG_LIST

if (ue_ref == NULL) return;

UE_LIST_OUT("eNB UE s1ap id: 0x%06x", ue_ref->enb_ue_s1ap_id);
UE_LIST_OUT("MME UE s1ap id: 0x%08x", ue_ref->mme_ue_s1ap_id);
UE_LIST_OUT("SCTP stream recv: 0x%04x", ue_ref->sctp_stream_recv);
UE_LIST_OUT("SCTP stream send: 0x%04x", ue_ref->sctp_stream_send);
#endif
}

//------------------------------------------------------------------------------
enb_description_t* s1ap_new_enb(void) {
enb_description_t* enb_ref = NULL;
Expand Down
11 changes: 0 additions & 11 deletions lte/gateway/c/core/oai/tasks/s1ap/s1ap_mme.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ status_code_e s1ap_mme_init(const mme_config_t* mme_config);
**/
void s1ap_mme_exit(void);

/** \brief Dump eNB related information.
* Calls dump_ue for each UE in list
* \param enb_ref eNB structure reference to dump
**/
void s1ap_dump_enb(const enb_description_t* enb_ref);

/** \brief Dump UE related information.
* \param ue_ref ue structure reference to dump
**/
void s1ap_dump_ue(const ue_description_t* ue_ref);

/** \brief Allocate and add to the list a new eNB descriptor
* @returns Reference to the new eNB element in list
**/
Expand Down
5 changes: 0 additions & 5 deletions lte/gateway/c/core/oai/tasks/s1ap/s1ap_mme_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@ status_code_e s1ap_mme_handle_s1_setup_request(s1ap_state_t* state,
// Clean any stale eNB association (from Redis) for this enb_id
clean_stale_enb_state(state, enb_association);

s1ap_dump_enb(enb_association);
rc = s1ap_generate_s1_setup_response(state, enb_association);
if (rc == RETURNok) {
state->num_enbs++;
Expand Down Expand Up @@ -3157,8 +3156,6 @@ status_code_e s1ap_mme_handle_handover_notify(s1ap_state_t* state,
", mme_ue_s1ap_id " MME_UE_S1AP_ID_FMT ":%s \n",
assoc_id, new_ue_ref_p->enb_ue_s1ap_id, new_ue_ref_p->mme_ue_s1ap_id,
hashtable_rc_code2string(h_rc));

s1ap_dump_enb(target_enb);
}

OAILOG_FUNC_RETURN(LOG_S1AP, RETURNok);
Expand Down Expand Up @@ -3407,8 +3404,6 @@ status_code_e s1ap_mme_handle_path_switch_request(
assoc_id, new_ue_ref_p->enb_ue_s1ap_id, new_ue_ref_p->mme_ue_s1ap_id,
hashtable_rc_code2string(h_rc));

s1ap_dump_enb(enb_association);

S1AP_FIND_PROTOCOLIE_BY_ID(S1ap_PathSwitchRequestIEs_t, ie, container,
S1ap_ProtocolIE_ID_id_E_RABToBeSwitchedDLList,
true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ status_code_e s1ap_mme_handle_initial_ue_message(s1ap_state_t* state,
if (eNB_ref->next_sctp_stream >= eNB_ref->instreams) {
eNB_ref->next_sctp_stream = 1;
}
s1ap_dump_enb(eNB_ref);
// TAI mandatory IE
S1AP_FIND_PROTOCOLIE_BY_ID(S1ap_InitialUEMessage_IEs_t, ie, container,
S1ap_ProtocolIE_ID_id_TAI, true);
Expand Down