Skip to content
Snippets Groups Projects
Commit ee8781f7 authored by Michael Cook's avatar Michael Cook
Browse files

Support for using gprof profiling

parent 7d0497ca
No related branches found
No related tags found
6 merge requests!1757Draft: Use pMAX value in configuration file, instead of hardcoded '23' in asn1_msg.c,!1493fix DL arq errors in UE,!1381integration_2021_wk51_d_2,!1362WIP: integration_2021_wk50_a,!1271Draft: L2 Emulator for NSA Mode,!1059Multi-UE scalability with L2 Emulator
......@@ -177,9 +177,13 @@ set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -std=c++11 -D${MKVER}"
)
#set(SANITIZER "-fsanitize=address")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER}")
# Uncomment these lines to enable the address sanitizer
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
# Uncomment these lines to enable gprof profiling
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg -DUSING_GPROF")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg -DUSING_GPROF")
add_definitions("-DASN_DISABLE_OER_SUPPORT")
......
......@@ -95,6 +95,9 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "NB_IoT_interface.h"
#include <executables/split_headers.h>
#if USING_GPROF
# include "sys/gmon.h"
#endif
pthread_cond_t nfapi_sync_cond;
pthread_mutex_t nfapi_sync_mutex;
......@@ -738,6 +741,14 @@ int main ( int argc, char **argv )
if(IS_SOFTMODEM_DOFORMS)
load_softscope("enb");
itti_wait_tasks_end();
#if USING_GPROF
// Save the gprof data now (rather than via atexit) in case we crash while shutting down
fprintf(stderr, "Recording gprof data...\n");
_mcleanup();
fprintf(stderr, "Recording gprof data...done\n");
#endif // USING_GPROF
oai_exit=1;
LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit);
// stop threads
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment