Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • pasolini/openairinterface5g
  • odukan/openairinterface5g
  • ewa/openairinterface5g
  • deksprime/openairinterface5g
  • jackokie/openairinterface5g
  • Srushti16/openairinterface5g
  • BRodolphe/openairinterface5g
  • kramantas/openairinterface5g
  • suraj_4g5g/openairinterface5g
  • turletti/openairinterface5g
  • anandriisc/openairinterface5g
  • lvguorong/openairinterface5g
  • dast/openairinterface5g
  • yashwanthr/openairinterface5g
  • ajiti2tb/openairinterface5g
  • qzhou/openairinterface5g
  • nickmxxx/openairinterface5g
  • bin_he4/openairinterface5g
  • delarco/openairinterface5g
  • limx1980/openairinterface5g
  • Aniq/openairinterface5g
  • yassir63/openairinterface5g
  • orc318/openairinterface5g
  • vader/openairinterface5g
  • limx59/openairinterface5g
  • nadavaati_12345/openairinterface5g
  • jenshz/openairinterface5g
  • kuldeep/openairinterface5g
  • lurker/openairinterface5g
  • shariat/openairinterface5g
  • Alireza.najafzadeh/openairinterface5g
  • Ling/openairinterface5g
  • EvanKrall/openairinterface5g
  • youyih/openairinterface5g
  • anindya/openairinterface5g
  • ahan/openairinterface5g
  • beraoud/openairinterface5g
  • obejarano/openairinterface5g
  • Monti/openairinterface5g
  • akhamsi/openairinterface5g
  • Worker.N/openairinterface5g
  • zhangtu/openairinterface5g
  • desouza/openairinterface5g
  • zhijun/openairinterface5g
  • sureshkumar/openairinterface5g
  • milan/openairinterface5g
  • bigbangbingo/openairinterface5g
  • platini/openairinterface5g
  • muralir-nv/openairinterface5g
  • Joshua_Zhang/openairinterface5g
  • siddharthmurali1/openairinterface5g
  • sorinros/openairinterface5g
  • elainecao/openairinterface5g
  • sneltved/openairinterface5g
  • aikaterini.trilyraki/openairinterface5g
  • wujunning11/openairinterface5g
  • magounak/openairinterface5g
  • ycl1729020039/openairinterface5g
  • mayukhweb/openairinterface5g
  • wataru/openairinterface5g
  • afonsoli/openairinterface5g
  • ppokar/openairinterface5g
  • emest/openairinterface5g
  • Najib/openairinterface5g
  • liqing/openairinterface5g
  • gprshome/openairinterface5g
  • Dvevgedveccc/openairinterface5g
  • Elena_Lukashova/openairinterface5g
  • imaneouss/openairinterface5g
  • yangyuan/openairinterface5g
  • ycliang/openairinterface5g
  • rohanfds/openairinterface5g
  • cong2008abc/openairinterface5g
  • Giovanni/openairinterface5g
  • willvegapunk/openairinterface5g
  • Chen/openairinterface5g
  • Ella/openairinterface5g
  • kollabalu/openairinterface5g
  • tsaichanglan/openairinterface5g
  • Artifice/openairinterface5g
  • HJR0129/openairinterface5g
  • alextp/openairinterface5g
  • Changron/openairinterface5g
  • pedosb/openairinterface5g
  • Flozzen/openairinterface5g
  • hobei/openairinterface5g
  • WP_Jing/openairinterface5g
  • reset4/openairinterface5g
  • alexjoseph/openairinterface5g
  • latuan1710/openairinterface5g
  • wynter-wang/openairinterface5g
  • stt12706/openairinterface5g
  • sy/openairinterface5g
  • dzxu/openairinterface5g
  • ptizoom/openairinterface5g
  • Thierry/openairinterface5g
  • tjamc80/openairinterface5g
  • yenmuse/openairinterface5g
  • archerling/openairinterface5g
  • grahul/openairinterface5g
  • ashish.shri/openairinterface5g
  • TianyuChen/openairinterface5g
  • cuixf1/openairinterface5g
  • Jan/openairinterface5g
  • jboatenng/openairinterface5g_gpio
  • geokal/openairinterface5g
  • johannhg/openairinterface5g
  • TofunmiA/openairinterface5g
  • razvanursu/openairinterface5g-mac-scheduling
  • Julio/openairinterface5g
  • fredrichx/openairinterface5g
  • nems/openairinterface5g
  • wb_li/openairinterface5g
  • ferrieux/openairinterface5g
  • prajna_g/openairinterface-5-g-xnap-ho
  • mtinasc/openairinterface5g
  • Hofschroeer/openairinterface5g
  • buptxiaofeng/openairinterface5g
  • fjgh_759/openairinterface5g
  • calcel/openairinterface5g
  • Reem/openairinterface5g
  • havar_mind/openairinterface5g
  • shrinish/openairinterface5g
  • YANGHELINDE/openairinterface5g
  • lool/openairinterface5g
  • raghav1900/openairinterface5g
  • allan1201/openairinterface5g
  • ferris/openairinterface5g
  • seanzw/openairinterface5g
  • emad72/openairinterface5g
  • guojilong123/openairinterface5g
  • Rony99/openairinterface5g
  • lity/openairinterface5g
  • sshrivastava/openairinterface5g
  • zhihengzhang/openairinterface5g
  • Rakesh_B_B/openairinterface5g
  • baleeiro/openairinterface5g
  • 19125064/openairinterface5g
  • linlin/openairinterface5g
  • NA1VE/openairinterface5g
  • oai1B/openairinterface5g
  • daveprice/openairinterface5g
  • mo/openairinterface5g
  • dhanmeet/openairinterface5g
  • mv2290/openairinterface-5-g-test
  • pagmatt/openairinterface5g
  • mmTestNYU/openairinterface5g
  • mmezzavilla/openairinterface5g
  • sudhakarb/openairinterface5g
  • mekki/openairinterface5g
  • virtanen/openairinterface5g
  • dyyu/openairinterface5g
  • mohammed_safwan/openairinterface5g
  • venkat/openairinterface5g
  • rupadhya/openairinterface5g
  • adjou/openairinterface5g
  • samiemostafavi/openairinterface5g-edaf
  • Sreeram/openairinterface5g
  • oliverxsch/openairinterface5g
  • oai/openairinterface5g
160 results
Show changes
Commits on Source (29)
Showing
with 402 additions and 319 deletions
......@@ -674,7 +674,8 @@ class SSHConnection():
self.command('mkdir -p ' + self.EPCSourceCodePath + '/scripts', '\$', 5)
self.command('cd /opt/hss_sim0609', '\$', 5)
self.command('echo ' + self.EPCPassword + ' | sudo -S rm -f hss.log daemon.log', '\$', 5)
self.command('echo ' + self.EPCPassword + ' | sudo -S echo "Starting sudo session" && sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real ', '\$', 5)
# based on Robert's feedback, new method to run simulated HSS
self.command('sudo su -c "cd /opt/hss_sim0609 && screen -dm -S simulated_hss ./starthss_real"', '\$', 5)
else:
logging.error('This option should not occur!')
self.close()
......
......@@ -112,7 +112,7 @@ function analyzeIperfFiles {
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
fi
else
EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"`
EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "bits/sec" | sed -e "s#^.*Bytes *##" -e "s#sec.*#sec#"`
if [[ $EFFECTIVE_BITRATE =~ .*Kbits/sec.* ]]
then
EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Kbits/sec.*##"`
......@@ -136,9 +136,9 @@ function analyzeIperfFiles {
else
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
fi
EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"`
JITTER=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*Mbits/sec *##" -e "s#ms.*#ms#"`
PACKETLOSS=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*(##" -e "s#).*##"`
EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "bits/sec" | sed -e "s#^.*Bytes *##" -e "s#sec.*#sec#"`
JITTER=`tail -n3 $IPERF_CASE | egrep "bits/sec" | sed -e "s#^.*bits/sec *##" -e "s#ms.*#ms#"`
PACKETLOSS=`tail -n3 $IPERF_CASE | egrep "bits/sec" | sed -e "s#^.*(##" -e "s#).*##"`
fi
echo " <td>" >> ./test_simulator_results.html
echo " <pre>" >> ./test_simulator_results.html
......@@ -730,8 +730,8 @@ function report_test {
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_iperf_dl*client*txt 2> /dev/null`
analyzeIperfFiles
#IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_ul*client*txt 2> /dev/null`
#analyzeIperfFiles
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_iperf_ul*client*txt 2> /dev/null`
analyzeIperfFiles
done
done
done
......
......@@ -342,6 +342,7 @@ function check_iperf {
local FILE_COMPLETE=`egrep -c "Server Report" ${LOC_BASE_LOG}_client.txt`
if [ $FILE_COMPLETE -eq 0 ]
then
# This part will become obsolete once we have UL
if [[ $LOC_IS_RF_SIM -eq 1 ]] && [[ $LOC_IS_NR -eq 1 ]]
then
echo "no UL integration right now --> normal to have no server report"
......@@ -350,11 +351,11 @@ function check_iperf {
local EFFECTIVE_BANDWIDTH=`tail -n1 ${LOC_BASE_LOG}_server.txt | sed -e "s#^.*MBytes *##" -e "s#^.*KBytes *##" -e "s#sec.*#sec#"`
if [[ $2 =~ .*K.* ]]
then
local BW_SUFFIX="K"
local BW_PREFIX="K"
else
local BW_SUFFIX="M"
local BW_PREFIX="M"
fi
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_SUFFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_SUFFIX}bits.* ]]
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]]
then
echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
else
......@@ -370,10 +371,19 @@ function check_iperf {
echo "File Report not found"
fi
else
local EFFECTIVE_BANDWIDTH=`tail -n3 ${LOC_BASE_LOG}_client.txt | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"`
if [ `egrep -c "Mbits/sec" ${LOC_BASE_LOG}_client.txt` -ne 0 ]
then
local EFFECTIVE_BANDWIDTH=`tail -n3 ${LOC_BASE_LOG}_client.txt | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"`
local BW_PREFIX="M"
fi
if [ `egrep -c "Kbits/sec" ${LOC_BASE_LOG}_client.txt` -ne 0 ]
then
local EFFECTIVE_BANDWIDTH=`tail -n3 ${LOC_BASE_LOG}_client.txt | egrep "Kbits/sec" | sed -e "s#^.*KBytes *##" -e "s#sec.*#sec#"`
local BW_PREFIX="K"
fi
if [ $LOC_IS_DL -eq 1 ] && [ $LOC_IS_BASIC_SIM -eq 1 ]
then
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_TWO}.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_THREE}.*Mbits.* ]]
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_TWO}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_THREE}.*${BW_PREFIX}bits.* ]]
then
echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
else
......@@ -381,7 +391,7 @@ function check_iperf {
IPERF_STATUS=-1
fi
else
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*Mbits.* ]]
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]]
then
if [ $LOC_IS_DL -eq 1 ]
then
......@@ -390,7 +400,7 @@ function check_iperf {
echo "got requested UL bandwidth: $EFFECTIVE_BANDWIDTH"
fi
else
echo "not basic-sim got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
IPERF_STATUS=-1
fi
fi
......@@ -2067,7 +2077,7 @@ function run_test_on_vm {
fi
echo "############################################################"
echo "${CN_CONFIG} : iperf DL -- UE is server and eNB is client"
echo "${CN_CONFIG} : iperf DL -- NR-UE is server and gNB is client"
echo "############################################################"
THROUGHPUT="30K"
CURR_IPERF_LOG_BASE=tdd_${PRB}prb_${CN_CONFIG}_iperf_dl
......@@ -2078,6 +2088,18 @@ function run_test_on_vm {
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT
echo "############################################################"
echo "${CN_CONFIG} : iperf UL -- gNB is server and NR-UE is client"
echo "############################################################"
THROUGHPUT="30K"
CURR_IPERF_LOG_BASE=tdd_${PRB}prb_${CN_CONFIG}_iperf_ul
get_enb_noS1_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR
get_ue_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 1
generic_iperf $GNB_VM_CMDS $GNB_VM_IP_ADDR $ENB_IP_ADDR $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 1 0
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT
echo "############################################################"
echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators"
echo "############################################################"
......
......@@ -247,22 +247,18 @@ add_boolean_option(T_TRACER True "Activate the T tracer, a debugging
add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs")
add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode")
add_boolean_option(BASIC_SIMULATOR False "Has to be True when building the basic simulator, False otherwise")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
add_boolean_option(ENABLE_ITTI True "ITTI is internal messaging, should remain enabled for most targets")
set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti)
if (${ENABLE_ITTI})
add_library(ITTI
${OCP_ITTI}/intertask_interface.cpp
${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/memory_pools.c
)
add_library(ITTI
${OCP_ITTI}/intertask_interface.cpp
${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/memory_pools.c
)
add_dependencies(ITTI rrc_flag)
set(ITTI_LIB ITTI)
set(GTPU_need_ITTI ${OPENAIR3_DIR}/GTPV1-U/gtpv1u_eNB.c)
endif (${ENABLE_ITTI})
##################################################
# ASN.1 grammar C code generation & dependencies #
......@@ -660,7 +656,6 @@ set (SHLIB_LOADER_SOURCES
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
set(HWLIB_USRP_SOURCE
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib_config.c
)
add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} )
target_link_libraries(oai_usrpdevif uhd)
......@@ -1713,7 +1708,6 @@ set(NR_L2_SRC_UE
${NR_UE_RRC_DIR}/L2_interface_ue.c
${NR_UE_RRC_DIR}/main_ue.c
${NR_UE_RRC_DIR}/rrc_UE.c
${LTE_RLC_SRC}
)
set (MAC_SRC
......@@ -2369,6 +2363,9 @@ add_library(rfsimulator MODULE
)
target_link_libraries(rfsimulator SIMU ${ATLAS_LIBRARIES})
add_library(oai_iqplayer MODULE
${OPENAIR_TARGETS}/ARCH/iqplayer/iqplayer_lib.c
)
set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}")
#include T directory even if the T is off because T macros are in the code
......@@ -2448,6 +2445,7 @@ add_executable(lte-softmodem
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/COMMON/create_tasks_mbms.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
......@@ -2462,7 +2460,7 @@ add_executable(lte-softmodem
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag)
add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
target_link_libraries (lte-softmodem
-Wl,--start-group
......@@ -2517,6 +2515,7 @@ add_executable(lte-uesoftmodem
${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
......@@ -2563,6 +2562,7 @@ add_executable(nr-softmodem
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
......@@ -2579,7 +2579,7 @@ target_link_libraries (nr-softmodem
-Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
S1AP_LIB S1AP_ENB L2 L2_LTE L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
S1AP_LIB S1AP_ENB L2 L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
......@@ -2602,6 +2602,7 @@ add_executable(nr-uesoftmodem
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
......@@ -2864,7 +2865,7 @@ if (${T_TRACER})
nr_ulschsim ldpctest polartest smallblocktest cu_test du_test
#all "add_library" definitions
ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP
params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif
params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer
oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai
coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
......
......@@ -296,8 +296,8 @@ check_install_usrp_uhd_driver(){
x=$((x + 1))
done
$SUDO apt-get update
$SUDO apt-get -y --allow-unauthenticated install python python-tk libboost-all-dev libusb-1.0-0-dev
$SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host
$SUDO apt-get -y install python python-tk libboost-all-dev libusb-1.0-0-dev
$SUDO apt-get -y install libuhd-dev libuhd003 uhd-host
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
$SUDO $INSTALLER -y install python boost libusb-devel libusbx-devel boost-devel python-mako python-docutils cmake
$SUDO -H pip install requests
......@@ -367,9 +367,9 @@ check_install_bladerf_driver(){
$SUDO add-apt-repository -y ppa:bladerf/bladerf
$SUDO apt-get update
fi
$SUDO apt-get install -y --allow-unauthenticated bladerf libbladerf-dev
$SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3
$SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40
$SUDO apt-get install -y bladerf libbladerf-dev
$SUDO apt-get install -y bladerf-firmware-fx3
$SUDO apt-get install -y bladerf-fpga-hostedx40
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
install_bladerf_driver_from_source
else
......
......@@ -274,16 +274,6 @@ typedef struct {
} log_t;
#if defined(ENABLE_ITTI)
typedef enum log_instance_type_e {
LOG_INSTANCE_UNKNOWN,
LOG_INSTANCE_ENB,
LOG_INSTANCE_UE,
} log_instance_type_t;
void log_set_instance_type (log_instance_type_t instance);
#endif
#ifdef LOG_MAIN
log_t *g_log;
......
......@@ -633,9 +633,6 @@ inline static uint32_t vcd_get_write_index(void)
return write_index;
}
#if defined(ENABLE_ITTI)
int signal_mask(void);
#endif
void *vcd_dumper_thread_rt(void *args)
{
......@@ -644,9 +641,7 @@ void *vcd_dumper_thread_rt(void *args)
struct sched_param sched_param;
uint32_t data_ready_wait;
# if defined(ENABLE_ITTI)
return 0; //signal_mask(); //function defined at common/utils/ocp_itti/intertask_interface.cpp
# endif
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1;
sched_setscheduler(0, SCHED_FIFO, &sched_param);
......
......@@ -358,23 +358,21 @@ static void forward(void *_forwarder, char *buf, int size) {
f->tail = new;
#if BASIC_SIMULATOR
/* When runnng the basic simulator, the tracer may be too slow.
* Let's not take too much memory in the tracee and
* wait if there is too much data to send. 200MB is
* arbitrary.
*/
while (f->memusage > 200 * 1024 * 1024) {
if (pthread_cond_signal(&f->cond)) abort();
if (pthread_mutex_unlock(&f->lock)) abort();
while (f->memusage > 200 * 1024 * 1024) {
if (pthread_cond_signal(&f->cond)) abort();
usleep(1000);
if (pthread_mutex_unlock(&f->lock)) abort();
if (pthread_mutex_lock(&f->lock)) abort();
}
usleep(1000);
#endif /* BASIC_SIMULATOR */
if (pthread_mutex_lock(&f->lock)) abort();
}
#endif
f->memusage += size+4;
/* warn every 100MB */
......
# telnet server principles
The oai telnet server is implemented in a shared library to be loaded by the [oai shared library loader](loader). The implementation includes a `telnetsrv_autoinit` function which is automatically called at load time, starts the telnet server and registers a first set of commands, which are delivered with the server (telnet, softmodem, loader).
The oai telnet server is implemented in shared libraries to be loaded by the [oai shared library loader](loader). `libtelnetsrv.so ` contains the code common to all oai softmodem executables, where `libtelnetsrv_<app>.so` contains the code specific to the executable identified by `app`.
| `<app>` | executable |
| :-----: | :---------------: |
| enb | `lte-softmodem` |
| gnb | `nr-softmodem` |
| 4Gue | `lte-uesoftmodem` |
| 5Gue | `nr-uesoftmodem` |
The implementation includes a `telnetsrv_autoinit` function which is automatically called at load time, starts the telnet server and registers a first set of commands, which are delivered with the server (telnet, softmodem, loader). it also uses the `get_softmodem_function` call to retrieve the running executable id and possibly loads the corresponding `libtelnetsrv_<app>.so`library.
Currently the telnet server only supports one user connection. The same dedicated thread is used to wait for a user connection and process the input received from this connection.
......@@ -12,10 +21,11 @@ The telnet server provides an API which can be used by any oai component to add
telnet server source files are located in [common/utils/telnetsrv](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/telnetsrv)
1. [telnetsrv.c](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/telnetsrv/telnetsrv.c) contains the telnet server implementation, including the implementation of the telnet CLI command.
1. [telnetsrv.c](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/telnetsrv/telnetsrv.c) contains the telnet server implementation, including the implementation of the `telnet` CLI command. This implementation is compatible with all softmodem executables and is in charge of loading any additional `libtelnetsrv_<app> .so` containing code specific to the running executables.
1. [telnetsrv.h](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/telnetsrv/telnetsrv.h) is the telnet server include file containing both private and public data type definitions. It also contains API prototypes for functions that are used to register a new command in the server.
1. `telnetsrv\_\<XXX\>.c`: implementation of \<XXX\> CLI command which are delivered with the telnet server.
1. `telnetsrv\_\<XXX\>.h`: include file for the implementation of XXX CLI command. Usually included only in the corresponding `.c`file
1. `telnetsrv_<XXX\>.c`: implementation of \<XXX\> CLI command which are delivered with the telnet server and are common to all softmodem executables.
1. `telnetsrv_<XXX\>.h`: include file for the implementation of XXX CLI command. Usually included only in the corresponding `.c`file
1. `telnetsrv_<app>_<XXX>.c`: implementation of \<XXX\> CLI command specific to the executable identified by \<app\>.These sources are used to create `libtelnetsrv_<app>.so` at build time.
1. [telnetsrv_CMakeLists.txt](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/telnetsrv/telnetsrv_CMakeLists.txt): CMakelists file containing the cmake instructions to build the telnet server. this file is included in the [global oai CMakelists](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/cmake_targets/CMakeLists.txt).
[oai telnet server home](telnetsrv.md)
......@@ -8,7 +8,7 @@ By default the embedded telnet server, which is implemented in a shared library,
./build_oai --build-lib telnetsrv
```
This will create the `libtelnetsrv.so` file in the `targets/bin` and `cmake_targets/ran_build/build` sub directories of the oai repository.
This will create the `libtelnetsrv.so` and `libtelnetsrv_<app> file in the `targets/bin` and `cmake_targets/ran_build/build` sub directories of the oai repository. <app> can be "enb", "gnb", "4GUE" or "5GUE", each library containing functions specific to a given executable.
When starting the softmodem, you must specify the **_\-\-telnetsrv_** option to load and start the telnet server. The telnet server is loaded via the [oai shared library loader](loader).
......
......@@ -53,6 +53,7 @@
#include <sys/resource.h>
#include "common/utils/load_module_shlib.h"
#include "common/config/config_userapi.h"
#include "executables/softmodem-common.h"
#include <readline/history.h>
......@@ -546,6 +547,7 @@ void run_telnetsrv(void) {
int readc, filled;
int status;
int optval = 1;
char prompt[sizeof(TELNET_PROMPT_PREFIX)+10];
pthread_setname_np(pthread_self(), "telnet");
set_sched(pthread_self(),0,telnetparams.priority);
sock = socket(AF_INET, SOCK_STREAM, 0);
......@@ -570,6 +572,7 @@ void run_telnetsrv(void) {
fprintf(stderr,"[TELNETSRV] Error %s on listen call\n",strerror(errno));
using_history();
int plen=sprintf(prompt,"%s_%s> ",TELNET_PROMPT_PREFIX,get_softmodem_function(NULL));
printf("\nInitializing telnet server...\n");
while( (telnetparams.new_socket = accept(sock, &cli_addr, &cli_len)) ) {
......@@ -613,9 +616,9 @@ void run_telnetsrv(void) {
HIST_ENTRY *hisentry = history_get(strtol(buf+1,NULL,0));
if (hisentry) {
char msg[TELNET_MAX_MSGLENGTH + sizeof(TELNET_PROMPT) +10];
char msg[TELNET_MAX_MSGLENGTH + plen +10];
sprintf(buf,"%s",hisentry->line);
sprintf(msg,"%s %s\n",TELNET_PROMPT, hisentry->line);
sprintf(msg,"%s %s\n",prompt, hisentry->line);
send(telnetparams.new_socket, msg, strlen(msg), MSG_NOSIGNAL);
}
}
......@@ -635,7 +638,7 @@ void run_telnetsrv(void) {
add_history(buf);
}
send(telnetparams.new_socket, TELNET_PROMPT, sizeof(TELNET_PROMPT), MSG_NOSIGNAL);
send(telnetparams.new_socket, prompt, strlen(prompt), MSG_NOSIGNAL);
} else {
printf ("[TELNETSRV] Closing telnet connection...\n");
break;
......@@ -653,7 +656,7 @@ void run_telnetsrv(void) {
}
/*------------------------------------------------------------------------------------------------*/
/* set_telnetmodule loads the commands delivered with the telnet server
/* load the commands delivered with the telnet server
*
*
*
......@@ -709,10 +712,17 @@ int add_sharedmodules(void) {
return ret;
}
/* autoinit functions is called by the loader when the telnet shared library is
dynamically loaded
*/
int telnetsrv_autoinit(void) {
memset(&telnetparams,0,sizeof(telnetparams));
config_get( telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t),"telnetsrv");
/* possibly load a exec specific shared lib */
char *execfunc=get_softmodem_function(NULL);
char libname[64];
sprintf(libname,"telnetsrv_%s",execfunc);
load_module_shlib(libname,NULL,0,NULL);
if(pthread_create(&telnetparams.telnet_pthread,NULL, (void *(*)(void *))run_telnetsrv, NULL) != 0) {
fprintf(stderr,"[TELNETSRV] Error %s on pthread_create call\n",strerror(errno));
return -1;
......
......@@ -35,7 +35,7 @@
#define TELNET_PORT 9090
#define TELNET_MAX_MSGLENGTH 2048
#define TELNET_PROMPT "softmodem> "
#define TELNET_PROMPT_PREFIX "softmodem"
#define TELNET_MAXCMD 20
#define TELNET_CMD_MAXSIZE 20
#define TELNET_HELPSTR_SIZE 80
......
......@@ -2,20 +2,32 @@ set(TELNETROOT ${OPENAIR_DIR}/common/utils/telnetsrv )
set(TELNETSRV_SOURCE
${TELNETROOT}/telnetsrv.c
${TELNETROOT}/telnetsrv_phycmd.c
${TELNETROOT}/telnetsrv_proccmd.c
${TELNETROOT}/telnetsrv_loader.c
${TELNETROOT}/telnetsrv_measurements.c
)
#set(TELNETSRV_ETHDEVCMD_SOURCE
# ${APPROOT}/telnetsrv/telnetsrv_ethdevcmd.c
# )
add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} )
#add_library(telnetsrv_ethdevcmd MODULE ${TELNETSRV_ETHDEVCMD_SOURCE} )
target_link_libraries(telnetsrv PRIVATE history)
foreach(TELNETLIB enb gnb 4gUE 5gUE)
set(TELNETLIB_SRCS "")
foreach(TELNETLIB_ASRC measurements phycmd)
set(TELNETLIB_SRC ${OPENAIR_DIR}/common/utils/telnetsrv/telnetsrv_${TELNETLIB}_${TELNETLIB_ASRC}.c)
if (EXISTS ${TELNETLIB_SRC})
set( TELNETLIB_SRCS "${TELNETLIB_SRC};${TELNETLIB_SRCS}")
endif()
endforeach()
if(NOT "${TELNETLIB_SRCS}" STREQUAL "")
message("Add ${TELNETLIB} specific telnet functions in libtelnetsrv_${TELNETLIB}.so")
add_library(telnetsrv_${TELNETLIB} MODULE ${TELNETLIB_SRCS} )
add_dependencies(telnetsrv telnetsrv_${TELNETLIB})
install(TARGETS telnetsrv_${TELNETLIB} DESTINATION bin)
else()
message("No specific telnet functions for ${TELNETLIB}")
endif()
endforeach()
install(TARGETS telnetsrv DESTINATION bin)
if (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/telnetsrv/telnetsrv_measurements.c
* \brief: implementation of telnet commands related to eNB measurments
* \author Francois TABURET
* \date 2019
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#define _GNU_SOURCE
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#define TELNETSERVERCODE
#include "telnetsrv.h"
#include "common/utils/LOG/log.h"
#include "common/config/config_userapi.h"
#include "telnetsrv_measurements.h"
#include "telnetsrv_ltemeasur_def.h"
#include "telnetsrv_cpumeasur_def.h"
#include "openair2/LAYER2/MAC/mac.h"
#include "openair1/PHY/phy_extern.h"
void measurcmd_display_macstats(telnet_printfunc_t prnt);
void measurcmd_display_macstats_ue(telnet_printfunc_t prnt);
void measurcmd_display_rlcstats(telnet_printfunc_t prnt);
void measurcmd_display_phycpu(telnet_printfunc_t prnt);
void measurcmd_display_maccpu(telnet_printfunc_t prnt);
void measurcmd_display_pdcpcpu(telnet_printfunc_t prnt);
static telnet_measurgroupdef_t enbmeasurgroups[] = {
{"enb", GROUP_LTESTATS,0, measurcmd_display_macstats, {NULL}},
{"enbues",GROUP_LTESTATS,0, measurcmd_display_macstats_ue,{NULL}},
{"rlc", GROUP_LTESTATS,0, measurcmd_display_rlcstats, {NULL}},
{"phycpu",GROUP_CPUSTATS,0, measurcmd_display_phycpu, {NULL}},
{"maccpu",GROUP_CPUSTATS,0, measurcmd_display_maccpu, {NULL}},
{"pdcpcpu",GROUP_CPUSTATS,0, measurcmd_display_pdcpcpu, {NULL}},
};
#define TELNET_NUM_ENBMEASURGROUPS (sizeof(enbmeasurgroups)/sizeof(telnet_measurgroupdef_t))
static int eNB_id =0;
static double cpufreq;
#define HDR "---------------------------------"
int get_measurgroups(telnet_measurgroupdef_t **measurgroups) {
*measurgroups = enbmeasurgroups;
return TELNET_NUM_ENBMEASURGROUPS;
}
void measurcmd_display_phycpu(telnet_printfunc_t prnt) {
PHY_VARS_eNB *phyvars = RC.eNB[eNB_id][0];
telnet_cpumeasurdef_t cpumeasur[]=CPU_PHYENB_MEASURE;
prnt("%s cpu (%1.1g GHz) measurements: PHY (cpustats %s) %s\n",HDR,cpufreq,
PRINT_CPUMEAS_STATE,HDR);
measurcmd_display_cpumeasures(prnt, cpumeasur, sizeof(cpumeasur)/sizeof(telnet_cpumeasurdef_t));
}
void measurcmd_display_maccpu(telnet_printfunc_t prnt) {
eNB_MAC_INST *macvars = RC.mac[eNB_id];
telnet_cpumeasurdef_t cpumeasur[]=CPU_MACENB_MEASURE;
prnt("%s cpu (%1.1g GHz) measurements: MAC (cpustats %s) %s\n",HDR,cpufreq,
PRINT_CPUMEAS_STATE,HDR);
measurcmd_display_cpumeasures(prnt, cpumeasur, sizeof(cpumeasur)/sizeof(telnet_cpumeasurdef_t));
}
void measurcmd_display_pdcpcpu(telnet_printfunc_t prnt) {
pdcp_stats_t *pdcpvars = &(eNB_pdcp_stats[eNB_id]);
telnet_cpumeasurdef_t cpumeasur[]=CPU_PDCPENB_MEASURE;
prnt("%s cpu (%1.1g GHz) measurements: PDCP (cpustats %s) %s \n",HDR,cpufreq,
PRINT_CPUMEAS_STATE,HDR);
measurcmd_display_cpumeasures(prnt, cpumeasur, sizeof(cpumeasur)/sizeof(telnet_cpumeasurdef_t));
}
/*----------------------------------------------------------------------------------------------------*/
void measurcmd_display_macstats_ue(telnet_printfunc_t prnt) {
UE_list_t *UE_list = &(RC.mac[eNB_id]->UE_list);
for (int UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
for (int i=0; i<UE_list->numactiveCCs[UE_id]; i++) {
int CC_id = UE_list->ordered_CCids[i][UE_id];
prnt("%s UE %i Id %i CCid %i %s\n",HDR,i,UE_id,CC_id,HDR);
eNB_UE_STATS *macuestatptr = &(UE_list->eNB_UE_stats[CC_id][UE_id]);
telnet_ltemeasurdef_t statsptr[]=LTEMAC_UEMEASURE;
measurcmd_display_measures(prnt, statsptr, sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t));
}
}
} /* measurcmd_display_macstats_ue */
void measurcmd_display_macstats(telnet_printfunc_t prnt) {
for (int CC_id=0 ; CC_id < MAX_NUM_CCs; CC_id++) {
eNB_STATS *macstatptr=&(RC.mac[eNB_id]->eNB_stats[CC_id]);
telnet_ltemeasurdef_t statsptr[]=LTEMAC_MEASURE;
prnt("%s eNB %i mac stats CC %i frame %u %s\n",
HDR, eNB_id, CC_id, RC.mac[eNB_id]->frame,HDR);
measurcmd_display_measures(prnt,statsptr,sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t));
}
} /* measurcmd_display_macstats */
void measurcmd_display_one_rlcstat(telnet_printfunc_t prnt, int UE_id, telnet_ltemeasurdef_t *statsptr, int num_rlcmeasure, unsigned int *rlcstats,
char *rbid_str, protocol_ctxt_t *ctxt, const srb_flag_t srb_flagP, const rb_id_t rb_idP)
{
int rlc_status = rlc_stat_req(ctxt,srb_flagP,rb_idP,
rlcstats, rlcstats+1, rlcstats+2, rlcstats+3, rlcstats+4, rlcstats+5,
rlcstats+6, rlcstats+7, rlcstats+8, rlcstats+9, rlcstats+10, rlcstats+11,
rlcstats+12, rlcstats+13, rlcstats+14, rlcstats+15, rlcstats+16, rlcstats+17,
rlcstats+18, rlcstats+19, rlcstats+20, rlcstats+21, rlcstats+22, rlcstats+23,
rlcstats+24, rlcstats+25, rlcstats+26, rlcstats+27);
if (rlc_status == RLC_OP_STATUS_OK) {
prnt("%s UE %i RLC %s mode %s %s\n",HDR,UE_id, rbid_str,
(rlcstats[0]==RLC_MODE_AM)? "AM": (rlcstats[0]==RLC_MODE_UM)?"UM":"NONE",HDR);
measurcmd_display_measures(prnt, statsptr, num_rlcmeasure);
}
} /* status measurcmd_rlc_stat_req */
void measurcmd_display_rlcstats(telnet_printfunc_t prnt) {
protocol_ctxt_t ctxt;
UE_list_t *UE_list = &(RC.mac[eNB_id]->UE_list);
telnet_ltemeasurdef_t statsptr[]=LTE_RLCMEASURE;
int num_rlcmeasure = sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t );
unsigned int *rlcstats = malloc(num_rlcmeasure*sizeof(unsigned int));
eNB_MAC_INST *eNB = RC.mac[eNB_id];
for(int i=0; i <num_rlcmeasure ; i++) {
statsptr[i].vptr = rlcstats + i;
}
for (int UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
#define NB_eNB_INST 1
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt,eNB_id, ENB_FLAG_YES,UE_list->eNB_UE_stats[0][UE_id].crnti,
eNB->frame,eNB->subframe,eNB_id);
measurcmd_display_one_rlcstat(prnt, UE_id, statsptr, num_rlcmeasure, rlcstats, "DCCH", &ctxt, SRB_FLAG_YES, DCCH);
measurcmd_display_one_rlcstat(prnt, UE_id, statsptr, num_rlcmeasure, rlcstats, "DTCH", &ctxt, SRB_FLAG_NO, DTCH-2);
}
} /* measurcmd_display_macstats_ue */
......@@ -29,7 +29,7 @@
* \note
* \warning
*/
#define _GNU_SOURCE
#define _GNU_SOURCE
#include <string.h>
#include <pthread.h>
......@@ -39,104 +39,85 @@
#define TELNETSRV_PHYCMD_MAIN
#include "telnetsrv_phycmd.h"
char *prnbuff;
extern int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length);
void init_phytelnet(void)
{
prnbuff=malloc(get_phybsize() );
if (prnbuff == NULL)
{
fprintf(stderr,"Error %s on malloc in init_phytelnet()\n",strerror(errno));
}
}
extern int dump_eNB_stats(PHY_VARS_eNB *eNB, char *buffer, int length);
void display_uestatshead( telnet_printfunc_t prnt)
{
prnt("cc ue rnti Dmcs Umcs tao tau Dbr Dtb \n");
}
void init_phytelnet(void) {
prnbuff=malloc(get_phybsize() );
void dump_uestats(int debug, telnet_printfunc_t prnt, uint8_t prntflag)
{
if (prnbuff == NULL) {
fprintf(stderr,"Error %s on malloc in init_phytelnet()\n",strerror(errno));
}
}
int p;
void display_uestatshead( telnet_printfunc_t prnt) {
prnt("cc ue rnti Dmcs Umcs tao tau Dbr Dtb \n");
}
p=dump_eNB_l2_stats( prnbuff, 0);
if(prntflag>=1)
prnt("%s\n",prnbuff);
if(debug>=1)
prnt("%i bytes printed\n",p);
void dump_uestats(int debug, telnet_printfunc_t prnt, uint8_t prntflag) {
int p;
p=dump_eNB_l2_stats( prnbuff, 0);
if(prntflag>=1)
prnt("%s\n",prnbuff);
if(debug>=1)
prnt("%i bytes printed\n",p);
}
void display_uestats(int debug, telnet_printfunc_t prnt, int ue)
{
for (int cc=0; cc<1 ; cc++)
{
}
void display_uestats(int debug, telnet_printfunc_t prnt, int ue) {
for (int cc=0; cc<1 ; cc++) {
}
}
void display_phycounters(char *buf, int debug, telnet_printfunc_t prnt)
{
prnt(" DLSCH kb DLSCH kb/s\n");
dump_uestats(debug, prnt,0);
void display_phycounters(char *buf, int debug, telnet_printfunc_t prnt) {
prnt(" DLSCH kb DLSCH kb/s\n");
dump_uestats(debug, prnt,0);
}
int dump_phyvars(char *buf, int debug, telnet_printfunc_t prnt)
{
if (debug > 0)
prnt("phy interface module received %s\n",buf);
if (strcasestr(buf,"phycnt") != NULL)
{
display_phycounters(buf, debug, prnt);
}
if (strcasestr(buf,"uestat") != NULL)
{
char *cptr=strcasestr(buf+sizeof("uestat"),"UE");
display_uestatshead(prnt);
if (cptr != NULL)
{
int ueidx = strtol( cptr+sizeof("UE"), NULL, 10);
if (ueidx < NUMBER_OF_UE_MAX && ueidx >= 0)
{
display_uestats(debug, prnt,ueidx);
}
} /* if cptr != NULL */
else
{
for (int ue=0; ue<NUMBER_OF_UE_MAX ; ue++)
{
display_uestats(debug, prnt,ue);
}
} /* else cptr != NULL */
} /* uestat */
if (strcasestr(buf,"uedump") != NULL)
{
dump_uestats(debug, prnt,1);
}
return 0;
int dump_phyvars(char *buf, int debug, telnet_printfunc_t prnt) {
if (debug > 0)
prnt("phy interface module received %s\n",buf);
if (strcasestr(buf,"phycnt") != NULL) {
display_phycounters(buf, debug, prnt);
}
if (strcasestr(buf,"uestat") != NULL) {
char *cptr=strcasestr(buf+sizeof("uestat"),"UE");
display_uestatshead(prnt);
if (cptr != NULL) {
int ueidx = strtol( cptr+sizeof("UE"), NULL, 10);
if (ueidx < NUMBER_OF_UE_MAX && ueidx >= 0) {
display_uestats(debug, prnt,ueidx);
}
} /* if cptr != NULL */
else {
for (int ue=0; ue<NUMBER_OF_UE_MAX ; ue++) {
display_uestats(debug, prnt,ue);
}
} /* else cptr != NULL */
} /* uestat */
if (strcasestr(buf,"uedump") != NULL) {
dump_uestats(debug, prnt,1);
}
return 0;
}
telnetshell_cmddef_t phy_cmdarray[] = {
{"disp","[phycnt,uedump,uestat UE<x>]", dump_phyvars},
{"disp","[phycnt,uedump,uestat UE<x>]", dump_phyvars},
{"","",NULL},
{"","",NULL},
};
/*-------------------------------------------------------------------------------------*/
void add_phy_cmds(void)
{
init_phytelnet();
add_telnetcmd("phy", phy_vardef, phy_cmdarray);
void add_phy_cmds(void) {
init_phytelnet();
add_telnetcmd("phy", phy_vardef, phy_cmdarray);
}
......@@ -20,9 +20,9 @@
*/
/*! \file common/utils/telnetsrv/telnetsrv_measurements.c
* \brief: implementation of telnet commands related to measurments
* \brief: implementation of telnet measurement functions common to all softmodems
* \author Francois TABURET
* \date 2019
* \date 2020
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
......@@ -47,40 +47,18 @@
#include "common/utils/LOG/log.h"
#include "common/config/config_userapi.h"
#include "telnetsrv_measurements.h"
#include "telnetsrv_ltemeasur_def.h"
#include "telnetsrv_cpumeasur_def.h"
#include "openair2/LAYER2/MAC/mac.h"
#include "openair1/PHY/phy_extern.h"
void measurcmd_display_macstats(telnet_printfunc_t prnt);
void measurcmd_display_macstats_ue(telnet_printfunc_t prnt);
void measurcmd_display_rlcstats(telnet_printfunc_t prnt);
void measurcmd_display_phycpu(telnet_printfunc_t prnt);
void measurcmd_display_maccpu(telnet_printfunc_t prnt);
void measurcmd_display_pdcpcpu(telnet_printfunc_t prnt);
static telnet_measurgroupdef_t measurgroups[] = {
{"enb", GROUP_LTESTATS,0, measurcmd_display_macstats, {NULL}},
{"enbues",GROUP_LTESTATS,0, measurcmd_display_macstats_ue,{NULL}},
{"rlc", GROUP_LTESTATS,0, measurcmd_display_rlcstats, {NULL}},
{"phycpu",GROUP_CPUSTATS,0, measurcmd_display_phycpu, {NULL}},
{"maccpu",GROUP_CPUSTATS,0, measurcmd_display_maccpu, {NULL}},
{"pdcpcpu",GROUP_CPUSTATS,0, measurcmd_display_pdcpcpu, {NULL}},
};
#define TELNET_NUM_MEASURGROUPS (sizeof(measurgroups)/sizeof(telnet_measurgroupdef_t))
static int eNB_id =0;
static char *grouptypes[] = {"ltestats","cpustats"};
static double cpufreq;
#define TELNET_NUM_MEASURTYPES (sizeof(grouptypes)/sizeof(char *))
#define HDR "---------------------------------"
void measurcmd_display_groups(telnet_printfunc_t prnt) {
void measurcmd_display_groups(telnet_printfunc_t prnt,telnet_measurgroupdef_t *measurgroups,int groups_size) {
prnt(" %*s %10s %s\n",TELNET_MAXMEASURNAME_LEN-1,"name","type","nombre de mesures");
for(int i=0; i<TELNET_NUM_MEASURGROUPS; i++)
for(int i=0; i<groups_size; i++)
prnt("%02d %*s %10s %i\n",i,TELNET_MAXMEASURNAME_LEN-1,measurgroups[i].groupname,
grouptypes[measurgroups[i].type], measurgroups[i].size);
} /* measurcmd_display_groups */
......@@ -96,32 +74,9 @@ void measurcmd_display_cpumeasures(telnet_printfunc_t prnt, telnet_cpumeasurdef_
prnt("\n\n");
} /* measurcmd_display_measures */
#define PRINT_CPUMEAS_STATE ((cpumeas(CPUMEAS_GETSTATE))?"enabled":"disabled")
void measurcmd_display_phycpu(telnet_printfunc_t prnt) {
PHY_VARS_eNB *phyvars = RC.eNB[eNB_id][0];
telnet_cpumeasurdef_t cpumeasur[]=CPU_PHYENB_MEASURE;
prnt("%s cpu (%1.1g GHz) measurements: PHY (cpustats %s) %s\n",HDR,cpufreq,
PRINT_CPUMEAS_STATE,HDR);
measurcmd_display_cpumeasures(prnt, cpumeasur, sizeof(cpumeasur)/sizeof(telnet_cpumeasurdef_t));
}
void measurcmd_display_maccpu(telnet_printfunc_t prnt) {
eNB_MAC_INST *macvars = RC.mac[eNB_id];
telnet_cpumeasurdef_t cpumeasur[]=CPU_MACENB_MEASURE;
prnt("%s cpu (%1.1g GHz) measurements: MAC (cpustats %s) %s\n",HDR,cpufreq,
PRINT_CPUMEAS_STATE,HDR);
measurcmd_display_cpumeasures(prnt, cpumeasur, sizeof(cpumeasur)/sizeof(telnet_cpumeasurdef_t));
}
void measurcmd_display_pdcpcpu(telnet_printfunc_t prnt) {
pdcp_stats_t *pdcpvars = &(eNB_pdcp_stats[eNB_id]);
telnet_cpumeasurdef_t cpumeasur[]=CPU_PDCPENB_MEASURE;
prnt("%s cpu (%1.1g GHz) measurements: PDCP (cpustats %s) %s \n",HDR,cpufreq,
PRINT_CPUMEAS_STATE,HDR);
measurcmd_display_cpumeasures(prnt, cpumeasur, sizeof(cpumeasur)/sizeof(telnet_cpumeasurdef_t));
}
/*----------------------------------------------------------------------------------------------------*/
/* lte measurements functions */
/* cellular measurements functions */
uint64_t measurcmd_getstatvalue(telnet_ltemeasurdef_t *measur,telnet_printfunc_t prnt) {
uint64_t val;
......@@ -164,70 +119,7 @@ void measurcmd_display_measures(telnet_printfunc_t prnt, telnet_ltemeasurdef_t
prnt("\n\n");
} /* measurcmd_display_measures */
void measurcmd_display_macstats_ue(telnet_printfunc_t prnt) {
UE_list_t *UE_list = &(RC.mac[eNB_id]->UE_list);
for (int UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
for (int i=0; i<UE_list->numactiveCCs[UE_id]; i++) {
int CC_id = UE_list->ordered_CCids[i][UE_id];
prnt("%s UE %i Id %i CCid %i %s\n",HDR,i,UE_id,CC_id,HDR);
eNB_UE_STATS *macuestatptr = &(UE_list->eNB_UE_stats[CC_id][UE_id]);
telnet_ltemeasurdef_t statsptr[]=LTEMAC_UEMEASURE;
measurcmd_display_measures(prnt, statsptr, sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t));
}
}
} /* measurcmd_display_macstats_ue */
void measurcmd_display_macstats(telnet_printfunc_t prnt) {
for (int CC_id=0 ; CC_id < MAX_NUM_CCs; CC_id++) {
eNB_STATS *macstatptr=&(RC.mac[eNB_id]->eNB_stats[CC_id]);
telnet_ltemeasurdef_t statsptr[]=LTEMAC_MEASURE;
prnt("%s eNB %i mac stats CC %i frame %u %s\n",
HDR, eNB_id, CC_id, RC.mac[eNB_id]->frame,HDR);
measurcmd_display_measures(prnt,statsptr,sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t));
}
} /* measurcmd_display_macstats */
void measurcmd_display_one_rlcstat(telnet_printfunc_t prnt, int UE_id, telnet_ltemeasurdef_t *statsptr, int num_rlcmeasure, unsigned int *rlcstats,
char *rbid_str, protocol_ctxt_t *ctxt, const srb_flag_t srb_flagP, const rb_id_t rb_idP)
{
int rlc_status = rlc_stat_req(ctxt,srb_flagP,rb_idP,
rlcstats, rlcstats+1, rlcstats+2, rlcstats+3, rlcstats+4, rlcstats+5,
rlcstats+6, rlcstats+7, rlcstats+8, rlcstats+9, rlcstats+10, rlcstats+11,
rlcstats+12, rlcstats+13, rlcstats+14, rlcstats+15, rlcstats+16, rlcstats+17,
rlcstats+18, rlcstats+19, rlcstats+20, rlcstats+21, rlcstats+22, rlcstats+23,
rlcstats+24, rlcstats+25, rlcstats+26, rlcstats+27);
if (rlc_status == RLC_OP_STATUS_OK) {
prnt("%s UE %i RLC %s mode %s %s\n",HDR,UE_id, rbid_str,
(rlcstats[0]==RLC_MODE_AM)? "AM": (rlcstats[0]==RLC_MODE_UM)?"UM":"NONE",HDR);
measurcmd_display_measures(prnt, statsptr, num_rlcmeasure);
}
} /* status measurcmd_rlc_stat_req */
void measurcmd_display_rlcstats(telnet_printfunc_t prnt) {
protocol_ctxt_t ctxt;
UE_list_t *UE_list = &(RC.mac[eNB_id]->UE_list);
telnet_ltemeasurdef_t statsptr[]=LTE_RLCMEASURE;
int num_rlcmeasure = sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t );
unsigned int *rlcstats = malloc(num_rlcmeasure*sizeof(unsigned int));
eNB_MAC_INST *eNB = RC.mac[eNB_id];
for(int i=0; i <num_rlcmeasure ; i++) {
statsptr[i].vptr = rlcstats + i;
}
for (int UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
#define NB_eNB_INST 1
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt,eNB_id, ENB_FLAG_YES,UE_list->eNB_UE_stats[0][UE_id].crnti,
eNB->frame,eNB->subframe,eNB_id);
measurcmd_display_one_rlcstat(prnt, UE_id, statsptr, num_rlcmeasure, rlcstats, "DCCH", &ctxt, SRB_FLAG_YES, DCCH);
measurcmd_display_one_rlcstat(prnt, UE_id, statsptr, num_rlcmeasure, rlcstats, "DTCH", &ctxt, SRB_FLAG_NO, DTCH-2);
}
} /* measurcmd_display_macstats_ue */
/*------------------------------------------------------------------------------------------------------------------------*/
/* function called by the telnet server when measur command is entered */
......@@ -238,20 +130,24 @@ int measurcmd_show(char *buf, int debug, telnet_printfunc_t prnt) {
if (debug > 0)
prnt(" measurcmd_show received %s\n",buf);
// char tmp[20480];
// dump_eNB_l2_stats(tmp, 0);
// prnt("%s\n",tmp);
int (*fptr)(telnet_measurgroupdef_t **) = dlsym(RTLD_DEFAULT,"get_measurgroups");
if ( fptr == NULL) {
prnt("No measures available for this softmodem\n");
return 0;
}
telnet_measurgroupdef_t *measurgroups;
int num_measurgroups = fptr( &measurgroups);
int s = sscanf(buf,"%ms %i-%i\n",&subcmd, &idx1,&idx2);
if (s>0) {
if ( strcmp(subcmd,"groups") == 0) {
measurcmd_display_groups(prnt);
measurcmd_display_groups(prnt,measurgroups,num_measurgroups);
badcmd=0;
} else {
for (int i=0; i<TELNET_NUM_MEASURTYPES; i++) {
if(strcmp(subcmd,grouptypes[i]) == 0) {
for(int j=0; j<TELNET_NUM_MEASURGROUPS; j++) {
for(int j=0; j<num_measurgroups; j++) {
if(i == measurgroups[j].type) {
badcmd=0;
measurgroups[j].displayfunc(prnt);
......@@ -260,7 +156,7 @@ int measurcmd_show(char *buf, int debug, telnet_printfunc_t prnt) {
}
}/* for i...*/
for (int i=0; i<TELNET_NUM_MEASURGROUPS; i++) {
for (int i=0; i<num_measurgroups; i++) {
if(strcmp(subcmd,measurgroups[i].groupname) == 0) {
measurgroups[i].displayfunc(prnt);
badcmd=0;
......
......@@ -34,16 +34,13 @@
#include <dlfcn.h>
#include "telnetsrv.h"
#include "openair1/PHY/defs_eNB.h"
#ifdef TELNETSRV_MEASURMENTS_MAIN
#define TELNET_MAXMEASURNAME_LEN 30
#define TELNET_MAXMEASURGROUPS 10
telnetshell_vardef_t measur_vardef[] = {
{"",0,NULL}
};
#define PRINT_CPUMEAS_STATE ((cpumeas(CPUMEAS_GETSTATE))?"enabled":"disabled")
typedef struct cpumeasurdef {
char statname[TELNET_MAXMEASURNAME_LEN];
time_stats_t *astatptr;
......@@ -75,6 +72,7 @@ typedef struct mesurgroupdef {
#define LTEMAC_MEASURGROUP_NAME "ltemac"
#define PHYCPU_MEASURGROUP_NAME "phycpu"
#ifdef TELNETSRV_MEASURMENTS_MAIN
int measurcmd_show(char *buf, int debug, telnet_printfunc_t prnt);
int measurcmd_cpustats(char *buf, int debug, telnet_printfunc_t prnt);
telnetshell_cmddef_t measur_cmdarray[] = {
......@@ -83,6 +81,19 @@ telnetshell_cmddef_t measur_cmdarray[] = {
{"","",NULL}
};
telnetshell_vardef_t measur_vardef[] = {
{"",0,NULL}
};
/* function to be implemented in any telnetsrv_xxx_measurements.c sources
to allow common measurment code to access measurments data */
extern int get_measurgroups(telnet_measurgroupdef_t **measurgroups);
/* */
#else
extern void add_measur_cmds(void);
extern void add_measur_cmds(void);
extern void measurcmd_display_groups(telnet_printfunc_t prnt,telnet_measurgroupdef_t *measurgroups,int groups_size);
extern void measurcmd_display_cpumeasures(telnet_printfunc_t prnt, telnet_cpumeasurdef_t *cpumeasure, int cpumeasure_size) ;
extern uint64_t measurcmd_getstatvalue(telnet_ltemeasurdef_t *measur,telnet_printfunc_t prnt);
extern void measurcmd_display_measures(telnet_printfunc_t prnt, telnet_ltemeasurdef_t *statsptr, int stats_size);
#endif /* TELNETSRV_MEASURCMD_MAIN */
......@@ -93,10 +93,8 @@
// extern openair0_device openair0;
#if defined(ENABLE_ITTI)
extern volatile int start_gNB;
extern volatile int start_UE;
#endif
extern volatile int start_gNB;
extern volatile int start_UE;
extern volatile int oai_exit;
extern openair0_config_t openair0_cfg[MAX_CARDS];
......@@ -360,7 +358,7 @@ static void *gNB_L1_thread( void *param ) {
}
#if 0 //defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
#if 0
// Wait for gNB application initialization to be complete (gNB registration to MME)
static void wait_system_ready (char *message, volatile int *start_flag) {
static char *indicator[] = {". ", ".. ", "... ", ".... ", ".....",
......
......@@ -142,9 +142,7 @@ extern int sync_var;
extern int transmission_mode;
extern double cpuf;
#if defined(ENABLE_ITTI)
extern volatile int start_eNB;
extern volatile int start_UE;
#endif
extern volatile int start_eNB;
extern volatile int start_UE;
#endif
......@@ -71,9 +71,7 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "UTIL/OTG/otg_vars.h"
#endif
#if defined(ENABLE_ITTI)
#include "intertask_interface.h"
#endif
#include "intertask_interface.h"
#include "PHY/INIT/phy_init.h"
......@@ -101,9 +99,7 @@ pthread_mutex_t sync_mutex;
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
int config_sync_var=-1;
#if defined(ENABLE_ITTI)
volatile int start_gNB = 0;
#endif
volatile int start_gNB = 0;
volatile int oai_exit = 0;
static int wait_for_sync = 0;
......@@ -119,9 +115,7 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
//Temp fix for inexistent NR upper layer
unsigned char NB_gNB_INST = 1;
#if defined(ENABLE_ITTI)
static char *itti_dump_file = NULL;
#endif
static char *itti_dump_file = NULL;
int UE_scan = 1;
int UE_scan_carrier = 0;
......@@ -302,7 +296,7 @@ void exit_function(const char *file, const char *function, const int line, const
exit(1);
}
#if defined(ENABLE_ITTI)
void *l2l1_task(void *arg) {
MessageDef *message_p = NULL;
int result;
......@@ -375,7 +369,6 @@ void *l2l1_task(void *arg) {
*/
return NULL;
}
#endif
int create_gNB_tasks(uint32_t gnb_nb) {
LOG_D(GNB_APP, "%s(gnb_nb:%d)\n", __FUNCTION__, gnb_nb);
......@@ -638,7 +631,6 @@ void wait_gNBs(void) {
printf("gNB L1 are configured\n");
}
#if defined(ENABLE_ITTI)
/*
* helper function to terminate a certain ITTI task
*/
......@@ -756,7 +748,6 @@ int restart_L1L2(module_id_t gnb_id) {
pthread_mutex_unlock(&sync_mutex);
return 0;
}
#endif
static void wait_nfapi_init(char *thread_name) {
printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
......@@ -814,7 +805,7 @@ int main( int argc, char **argv )
configure_linux();
printf("Reading in command-line options\n");
get_options ();
get_common_options();
get_common_options(SOFTMODEM_GNB_BIT );
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
fprintf(stderr,"Getting configuration failed\n");
......@@ -835,16 +826,16 @@ int main( int argc, char **argv )
}
cpuf=get_cpu_freq_GHz();
#if defined(ENABLE_ITTI)
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
// initialize mscgen log after ITTI
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
#endif
init_opt();
#ifdef PDCP_USE_NETLINK
if(!IS_SOFTMODEM_NOS1)
netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init();
......@@ -859,8 +850,6 @@ init_opt();
if(IS_SOFTMODEM_NOS1)
init_pdcp();
#if defined(ENABLE_ITTI)
if (RC.nb_nr_inst > 0) {
// don't create if node doesn't connect to RRC/S1/GTP
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
......@@ -869,7 +858,6 @@ init_opt();
RCconfig_L1();
}
#endif
/* Start the agent. If it is turned off in the configuration, it won't start */
RCconfig_nr_flexran();
......@@ -1004,19 +992,12 @@ init_opt();
// wait for end of program
printf("TYPE <CTRL-C> TO TERMINATE\n");
//getchar();
#if defined(ENABLE_ITTI)
printf("Entering ITTI signals handler\n");
itti_wait_tasks_end();
printf("Returned from ITTI signal handler\n");
oai_exit=1;
printf("oai_exit=%d\n",oai_exit);
#else
while (oai_exit==0)
sleep(1);
printf("Terminating application - oai_exit=%d\n",oai_exit);
#endif
// stop threads
/*#ifdef XFORMS
......