Commit 52e29812 authored by Raymond Knopp's avatar Raymond Knopp

Merge remote-tracking branch 'origin/develop' into enhancement-dlsim-format1A-testing

parents 5bf45e01 b805cfc6
......@@ -31,6 +31,7 @@ def sendSocialMediaMessage(pipeChannel, pipeColor, pipeMessage) {
}
def doRedHatBuild = false
def doFlexranCtrlTest = false
pipeline {
agent {
......@@ -69,6 +70,12 @@ pipeline {
} else {
doRedHatBuild = false
}
if (params.FlexRanRtcGitLabRepository_Credentials != null) {
doFlexranCtrlTest = true
}
if (fileExists("flexran")) {
sh "rm -Rf flexran > /dev/null 2>&1"
}
}
}
}
......@@ -103,6 +110,18 @@ pipeline {
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
sh "./ci-scripts/checkCodingFormattingRules.sh"
}
if (doFlexranCtrlTest) {
sh "mkdir flexran"
dir ('flexran') {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.FlexRanRtcGitLabRepository_Credentials}", usernameVariable: 'git_username', passwordVariable: 'git_password']
]) {
sh "git clone https://${git_username}:${git_password}@gitlab.eurecom.fr/flexran/flexran-rtc.git . > ../git_clone.log 2>&1"
}
sh "sed -i -e 's#add-apt-repository.*cleishm.*neo4j#add-apt-repository ppa:cleishm/neo4j -y#' -e 's#libneo4j-client-dev#libneo4j-client-dev -y#' tools/install_dependencies"
sh "zip -r -qq flexran.zip ."
}
}
}
}
post {
......@@ -288,12 +307,22 @@ pipeline {
stage ("Test basic simulator") {
steps {
gitlabCommitStatus(name: "Test basic-sim") {
timeout (time: 20, unit: 'MINUTES') {
timeout (time: 30, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
}
}
stage ("Build Flexran Controller") {
when {
expression {doFlexranCtrlTest}
}
steps {
timeout (time: 20, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant flexran-rtc --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
stage ("Test FDD - Band 7 - B210") {
steps {
script {
......
/inet.*brd/{print "interfaceToUse="$NF"done"}
......@@ -198,12 +198,18 @@ do
fi
done
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]; then STATUS=-1; fi
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]
then
echo "Expecting $NB_PATTERN_FILES log files and found $NB_FOUND_FILES"
STATUS=-1
fi
if [ $STATUS -eq 0 ]
then
echo "BUILD_OK" > $ARCHIVES_LOC/build_final_status.log
echo "STATUS seems OK"
else
echo "BUILD_KO" > $ARCHIVES_LOC/build_final_status.log
echo "STATUS failed?"
fi
exit $STATUS
......@@ -106,7 +106,12 @@ function build_on_vm {
echo "############################################################"
echo "Copying GIT repo into VM ($VM_NAME)"
echo "############################################################"
scp -o StrictHostKeyChecking=no $JENKINS_WKSP/localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu
if [[ "$VM_NAME" == *"-flexran-rtc"* ]]
then
scp -o StrictHostKeyChecking=no $JENKINS_WKSP/flexran/flexran.zip ubuntu@$VM_IP_ADDR:/home/ubuntu/localZip.zip
else
scp -o StrictHostKeyChecking=no $JENKINS_WKSP/localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu
fi
scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu
echo "############################################################"
......@@ -126,7 +131,22 @@ function build_on_vm {
echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS
echo "sudo apt-get --yes install zip daemon cppcheck >> zip-install.txt 2>&1" >> $VM_CMDS
fi
else
fi
if [[ "$VM_NAME" == *"-flexran-rtc"* ]]
then
if [ $DAEMON -eq 0 ]
then
echo "echo \"sudo apt-get --yes --quiet install zip curl jq \"" >> $VM_CMDS
echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS
echo "sudo apt-get --yes install zip curl jq >> zip-install.txt 2>&1" >> $VM_CMDS
else
echo "echo \"sudo apt-get --yes --quiet install zip daemon curl jq \"" >> $VM_CMDS
echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS
echo "sudo apt-get --yes install zip daemon curl jq >> zip-install.txt 2>&1" >> $VM_CMDS
fi
fi
if [[ "$VM_NAME" != *"-cppcheck"* ]] && [[ "$VM_NAME" != *"-flexran-rtc"* ]]
then
if [ $DAEMON -eq 0 ]
then
echo "echo \"sudo apt-get --yes --quiet install zip subversion libboost-dev \"" >> $VM_CMDS
......@@ -156,7 +176,19 @@ function build_on_vm {
echo "chmod 775 ./my-vm-build.sh " >> $VM_CMDS
echo "sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp -O /home/ubuntu/tmp/cmake_targets/log/cppcheck_build.txt -E /home/ubuntu/tmp/cmake_targets/log/cppcheck.xml ./my-vm-build.sh" >> $VM_CMDS
fi
else
fi
if [[ "$VM_NAME" == *"-flexran-rtc"* ]]
then
echo "mkdir -p cmake_targets/log" >> $VM_CMDS
echo "chmod 777 cmake_targets/log" >> $VM_CMDS
echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS
echo "echo \"./tools/install_dependencies \"" >> $VM_CMDS
echo "./tools/install_dependencies > cmake_targets/log/install-build.txt 2>&1" >> $VM_CMDS
echo "echo \"$BUILD_OPTIONS \"" >> $VM_CMDS
echo "$BUILD_OPTIONS > cmake_targets/log/rt_controller.Rel14.txt 2>&1" >> $VM_CMDS
fi
if [[ "$VM_NAME" != *"-cppcheck"* ]] && [[ "$VM_NAME" != *"-flexran-rtc"* ]]
then
echo "echo \"source oaienv\"" >> $VM_CMDS
echo "source oaienv" >> $VM_CMDS
echo "cd cmake_targets/" >> $VM_CMDS
......
......@@ -237,8 +237,8 @@ THREAD_STRUCT = (
NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_INTERFACE_NAME = "ens3";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -217,8 +217,8 @@ THREAD_STRUCT = (
NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_INTERFACE_NAME = "ens3";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
This diff is collapsed.
......@@ -40,6 +40,7 @@ function variant_usage {
echo " --variant cppcheck OR -v4"
echo " --variant enb-ethernet OR -v7"
echo " --variant ue-ethernet OR -v8"
echo " --variant flexran-rtc OR -v10"
}
MY_DIR=$(dirname $(readlink -f $0))
......@@ -284,6 +285,15 @@ case $key in
NBARGS=$[$NBARGS+256]
shift
;;
-v10)
VM_NAME=ci-flexran-rtc
ARCHIVES_LOC=flexran
LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=1
BUILD_OPTIONS="cmake . && make -j2"
NBARGS=$[$NBARGS+256]
shift
;;
--variant)
variant="$2"
case $variant in
......@@ -340,6 +350,14 @@ case $key in
BUILD_OPTIONS="--UE -t ETHERNET --noS1"
NBARGS=$[$NBARGS+256]
;;
flexran-rtc)
VM_NAME=ci-flexran-rtc
ARCHIVES_LOC=flexran
LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=1
BUILD_OPTIONS="cmake . && make -j2"
NBARGS=$[$NBARGS+256]
;;
*)
echo ""
echo "Syntax Error: Invalid Variant option -> $variant"
......
This diff is collapsed.
......@@ -92,10 +92,14 @@ function report_test {
echo "<!DOCTYPE html>" > ./test_simulator_results.html
echo "<html class=\"no-js\" lang=\"en-US\">" >> ./test_simulator_results.html
echo "<head>" >> ./test_simulator_results.html
echo " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" >> ./test_simulator_results.html
echo " <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\">" >> ./test_simulator_results.html
echo " <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js\"></script>" >> ./test_simulator_results.html
echo " <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\"></script>" >> ./test_simulator_results.html
echo " <title>Simulator Results for $JOB_NAME job build #$BUILD_ID</title>" >> ./test_simulator_results.html
echo " <base href = \"http://www.openairinterface.org/\" />" >> ./test_simulator_results.html
echo "</head>" >> ./test_simulator_results.html
echo "<body>" >> ./test_simulator_results.html
echo "<body><div class=\"container\">" >> ./test_simulator_results.html
echo " <table style=\"border-collapse: collapse; border: none;\">" >> ./test_simulator_results.html
echo " <tr style=\"border-collapse: collapse; border: none;\">" >> ./test_simulator_results.html
echo " <td style=\"border-collapse: collapse; border: none;\">" >> ./test_simulator_results.html
......@@ -162,6 +166,26 @@ function report_test {
then
echo " <h3>Basic Simulator Check</h3>" >> ./test_simulator_results.html
if [ -f $ARCHIVES_LOC/test_final_status.log ]
then
if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
then
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
else
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
echo " <strong>TEST was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
else
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
echo " <strong>COULD NOT DETERMINE TEST FINAL STATUS! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
echo " <button data-toggle=\"collapse\" data-target=\"#oai-basic-sim-test-details\">More details on Basic Simulator test results</button>" >> ./test_simulator_results.html
echo " <div id=\"oai-basic-sim-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
echo " <table border = \"1\">" >> ./test_simulator_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
......@@ -360,6 +384,36 @@ function report_test {
done
echo " </table>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ]
then
echo " <h3>Basic Simulator + FlexRan Controller Check</h3>" >> ./test_simulator_results.html
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
echo " <button data-toggle=\"collapse\" data-target=\"#oai-flexran-test-details\">More details on Basic Simulator + Fleran Controller test results</button>" >> ./test_simulator_results.html
echo " <div id=\"oai-flexran-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
echo " <table border = \"1\">" >> ./test_simulator_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
echo " <th>JSON Query Response</th>" >> ./test_simulator_results.html
echo " </tr>" >> ./test_simulator_results.html
FLEXRAN_QUERIES=`ls $ARCHIVES_LOC/flexran_ctl_query_*log`
for QUERY in $FLEXRAN_QUERIES
do
echo " <tr>" >> ./test_simulator_results.html
NAME=`echo $QUERY | sed -e "s#$ARCHIVES_LOC/##"`
echo " <td>$NAME</td>" >> ./test_simulator_results.html
echo " <td><pre><code>" >> ./test_simulator_results.html
egrep -v "LOG_NAME|\-\-\-\-\-" $QUERY >> ./test_simulator_results.html
echo " </code></pre></td>" >> ./test_simulator_results.html
echo " </tr>" >> ./test_simulator_results.html
done
echo " </table>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
ARCHIVES_LOC=archives/phy_sim/test
......@@ -367,6 +421,24 @@ function report_test {
then
echo " <h3>Physical Simulators Check</h3>" >> ./test_simulator_results.html
if [ -f $ARCHIVES_LOC/test_final_status.log ]
then
if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
then
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
else
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
echo " <strong>TEST was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
else
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
echo " <strong>COULD NOT DETERMINE TEST FINAL STATUS! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
echo " <table border = \"1\">" >> ./test_simulator_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
......@@ -399,6 +471,10 @@ function report_test {
done
echo " </table>" >> ./test_simulator_results.html
echo " <br>" >> ./test_simulator_results.html
echo " <button data-toggle=\"collapse\" data-target=\"#oai-phy-sim-test-details\">More details on Physical Simulators test results</button>" >> ./test_simulator_results.html
echo " <div id=\"oai-phy-sim-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
echo " <h4>Details</h4>" >> ./test_simulator_results.html
for XML_FILE in $XML_TESTS
......@@ -449,6 +525,9 @@ function report_test {
done
fi
echo "</body>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
echo " <p></p>" >> ./test_simulator_results.html
echo " <div class=\"well well-lg\">End of Test Report -- Copyright <span class=\"glyphicon glyphicon-copyright-mark\"></span> 2018 <a href=\"http://www.openairinterface.org/\">OpenAirInterface</a>. All Rights Reserved.</div>" >> ./test_simulator_results.html
echo "</div></body>" >> ./test_simulator_results.html
echo "</html>" >> ./test_simulator_results.html
}
This diff is collapsed.
......@@ -165,6 +165,25 @@ function check_on_vm_build {
fi
done
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]; then STATUS=-1; fi
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]
then
echo "Expecting $NB_PATTERN_FILES log files and found $NB_FOUND_FILES"
STATUS=-1
fi
# If we were building the FlexRan Controller, flag-touch for basic-simulator to continue
if [[ "$VM_NAME" == *"-flexran-rtc"* ]]
then
if [[ $STATUS -eq 0 ]]
then
touch $JENKINS_WKSP/flexran/flexran_build_complete.txt
fi
fi
if [[ $STATUS -eq 0 ]]
then
echo "BUILD_OK" > $ARCHIVES_LOC/build_final_status.log
else
echo "BUILD_KO" > $ARCHIVES_LOC/build_final_status.log
fi
}
......@@ -24,6 +24,7 @@
<TestCaseRequestedList>
010101
050101 060101 070101 040101
030100 040300 040401 040201 030201
030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201
030111 040301 040511 040613 040614 040615 040616 040617 040651 040652 040653 040654 040401 040201 030201
030121 040301 040521 040623 040624 040625 040626 040627 040662 040661 040663 040664 040401 040201 030201
......@@ -37,6 +38,12 @@
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
</testCase>
<testCase id="030100">
<class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band7/5MHz) with T Tracer on</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --T_stdout 0</Initialize_eNB_args>
</testCase>
<testCase id="030101">
<class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band7/5MHz)</desc>
......@@ -70,6 +77,12 @@
<desc>Terminate UE</desc>
</testCase>
<testCase id="040300">
<class>Attach_UE</class>
<desc>Attach single UE</desc>
<nbMaxUEtoAttach>1</nbMaxUEtoAttach>
</testCase>
<testCase id="040301">
<class>Attach_UE</class>
<desc>Attach UE</desc>
......
......@@ -24,6 +24,7 @@
<TestCaseRequestedList>
010101
050101 060101 070101 040101
030100 040300 040401 040201 030201
030104 040301 040501 040602 040601 040603 040642 040641 040643 040401 040201 030201
030114 040301 040511 040612 040611 040613 040652 040651 040653 040401 040201 030201
050201 060201 070201
......@@ -40,12 +41,18 @@
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
</testCase>
<testCase id="030100">
<class>Initialize_eNB</class>
<desc>Initialize eNB (TDD/Band40/5MHz) with T Tracer on</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf --T_stdout 0</Initialize_eNB_args>
</testCase>
<testCase id="030104">
<class>Initialize_eNB</class>
<desc>Initialize eNB (TDD/Band40/5MHz)</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf</Initialize_eNB_args>
</testCase>
<testCase id="030114">
<class>Initialize_eNB</class>
<desc>Initialize eNB (TDD/Band40/10MHz/info)</desc>
......@@ -73,6 +80,12 @@
<desc>Terminate UE</desc>
</testCase>
<testCase id="040300">
<class>Attach_UE</class>
<desc>Attach single UE</desc>
<nbMaxUEtoAttach>1</nbMaxUEtoAttach>
</testCase>
<testCase id="040301">
<class>Attach_UE</class>
<desc>Attach UE</desc>
......
......@@ -21,17 +21,15 @@
-->
<testCaseList>
<!-- Only 5MHz is tested since neither 10MHz nor 20MHz work in this configuration -->
<!-- Also no UL iperf in 5MHz (040642) -->
<!-- Only 5MHz/10MHz is tested since 20MHz does not work as in monolithic -->
<TestCaseRequestedList>
010101
050101 060101 070101 040101
030104 030105 040301 040501 040602 040401 040201 030201 030202
030104 030105 040301 040501 040602 040642 040401 040201 030201 030202
030114 030115 040301 040511 040612 040652 040401 040201 030201 030202
050201 060201 070201
</TestCaseRequestedList>
<!--
030104 030105 040301 040501 040602 040642 040401 040201 030201 030202
030114 030115 040301 040511 040612 040652 040401 040201 030201 030202
030124 030125 040301 040521 040622 040662 040401 040201 030201 030202
-->
<TestCaseExclusionList>
......
......@@ -21,17 +21,14 @@
-->
<testCaseList>
<!-- Only 5MHz is tested since neither 10MHz nor 20MHz work in this configuration -->
<TestCaseRequestedList>
010101
050101 060101 070101 040101
030101 030102 040301 040501 040604 040642 040401 040201 030201 030202
050201 060201 070201
</TestCaseRequestedList>
<!--
030111 030112 040301 040511 040614 040652 040401 040201 030201 030202
030121 030122 040301 040521 040624 040662 040401 040201 030201 030202
-->
050201 060201 070201
</TestCaseRequestedList>
<TestCaseExclusionList>
</TestCaseExclusionList>
......
......@@ -107,6 +107,28 @@
<desc>Reboot UE</desc>
</testCase>
<!-- CAT-M UE class command references -->
<testCase id="040102">
<class>Initialize_CatM_module</class>
<desc>Initialize CAT-M Module</desc>
</testCase>
<testCase id="040202">
<class>Terminate_CatM_module</class>
<desc>Terminate CAT-M Module</desc>
</testCase>
<testCase id="040302">
<class>Attach_CatM_module</class>
<desc>Attach CAT-M Module</desc>
</testCase>
<testCase id="040402">
<class>Detach_CatM_module</class>
<desc>Detach CAT-M Module</desc>
</testCase>
<!-- EPC class command references -->
<testCase id="050101">
......
......@@ -630,7 +630,6 @@ add_boolean_option(ENABLE_VCD True "always true now, time measurem
add_boolean_option(ENABLE_VCD_FIFO True "time measurements of proc calls and var displays sent to FIFO (one more thread)")
add_boolean_option(LINUX False "used in weird memcpy() in pdcp.c ???")
add_boolean_option(LINUX_LIST False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False")
add_boolean_option(LOG_NO_THREAD True "Disable thread for log, seems always set to true")
add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
##########################
......@@ -1927,6 +1926,7 @@ add_executable(lte-softmodem
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
......@@ -1966,6 +1966,7 @@ add_executable(lte-softmodem-nos1
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
......@@ -2003,6 +2004,7 @@ add_executable(lte-uesoftmodem
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
......@@ -2041,6 +2043,7 @@ add_executable(lte-uesoftmodem-nos1
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
......
......@@ -651,6 +651,9 @@ function main() {
compilations \
lte-simulators coding \
libcoding.so $dbin/libcoding.so
# compilations \
# lte-simulators $config_libconfig_shlib \
# lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
fi
# Core simulators
......
This diff is collapsed.
This diff is collapsed.
......@@ -20,8 +20,8 @@
*/
/*! \file common/config/config_load_configmodule.h
* \brief: configuration module, include file to be used by the source code calling the
* configuration module initialization
* \brief: configuration module, include file to be used by the source code calling the
* configuration module initialization
* \author Francois TABURET
* \date 2017
* \version 0.1
......@@ -31,12 +31,13 @@
* \warning
*/
#ifndef INCLUDE_CONFIG_LOADCONFIGMODULE_H
#define INCLUDE_CONFIG_LOADCONFIGMODULE_H
#define INCLUDE_CONFIG_LOADCONFIGMODULE_H
#include <string.h>
#include <stdlib.h>
#include "common/config/config_paramdesc.h"
#include "common/utils/T/T.h"
#define CONFIG_MAX_OOPT_PARAMS 10 // maximum number of parameters in the -O option (-O <cfgmode>:P1:P2...
#define CONFIG_MAX_ALLOCATEDPTRS 1024 // maximum number of parameters that can be dynamicaly allocated in the config module
......@@ -44,12 +45,14 @@
#define CONFIG_LIBCONFIGFILE "libconfig" // use libconfig file
#define CONFIG_CMDLINEONLY "cmdline" // use only command line options
#define DEFAULT_CFGFILENAME "oai.conf" // default config file
/* rtflags bit position definitions */
/* bit position definition for the argv_info mask of the configmodule_interface_t structure */
#define CONFIG_CMDLINEOPT_PROCESSED (1<<0) // command line option has been processed
/* bit position definitions for the rtflags mask of the configmodule_interface_t structure*/
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
#define CONFIG_DEBUGPTR (1<<1) // print memory allocation/free debug messages
#define CONFIG_DEBUGCMDLINE (1<<2) // print command line processing messages
#define CONFIG_NOABORTONCHKF (1<<3) // disable abort execution when parameter checking function fails
#define CONFIG_NOCHECKUNKOPT (1<<3) // disable check unprocessed (so invalid) command line options
#define CONFIG_NOABORTONCHKF (1<<4) // disable abort execution when parameter checking function fails
#define CONFIG_NOEXITONHELP (1<<19) // do not exit after printing help
#define CONFIG_HELP (1<<20) // print help message
#define CONFIG_ABORT (1<<21) // config failed,abort execution
......@@ -58,10 +61,10 @@ typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix);
typedef int(*configmodule_getlistfunc_t)(paramlist_def_t *, paramdef_t *,int numparams, char *prefix);
typedef void(*configmodule_endfunc_t)(void);
typedef struct configmodule_interface
{
typedef struct configmodule_interface {
int argc;
char **argv;
uint32_t *argv_info;
char *cfgmode;
int num_cfgP;
char *cfgP[CONFIG_MAX_OOPT_PARAMS];
......@@ -71,7 +74,7 @@ typedef struct configmodule_interface
configmodule_endfunc_t end;
uint32_t numptrs;
uint32_t rtflags;
char *ptrs[CONFIG_MAX_ALLOCATEDPTRS];
char *ptrs[CONFIG_MAX_ALLOCATEDPTRS];
} configmodule_interface_t;
#ifdef CONFIG_LOADCONFIG_MAIN
......@@ -81,17 +84,17 @@ static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugfl
debugflags can also be defined in the config_libconfig section of the config file\n \
debugflags: mask, 1->print parameters, 2->print memory allocations debug messages\n \
4->print command line processing debug messages\n ";
#define CONFIG_SECTIONNAME "config"
#define CONFIGPARAM_DEBUGFLAGS_IDX 0
static paramdef_t Config_Params[] = {
/*-----------------------------------------------------------------------------------------------------------------------*/
/* config parameters for config module */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------*/
{"debugflags", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0},
/*-----------------------------------------------------------------------------------------------------------------------*/
/* config parameters for config module */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------*/
{"debugflags", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0},
};
#else
......@@ -100,10 +103,11 @@ extern configmodule_interface_t *cfgptr;
#define printf_params(...) if ( (cfgptr->rtflags & (CONFIG_PRINTPARAMS)) != 0 ) { printf ( __VA_ARGS__ ); }
#define printf_ptrs(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGPTR)) != 0 ) { printf ( __VA_ARGS__ ); }
#define printf_ptrs(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGPTR)) != 0 ) { printf ( __VA_ARGS__ ); }
#define printf_cmdl(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGCMDLINE)) != 0 ) { printf ( __VA_ARGS__ ); }
extern configmodule_interface_t *load_configmodule(int argc, char **argv);
#define CONFIG_ENABLECMDLINEONLY (1<<1)
extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags);
extern void end_configmodule(void);
#endif /* INCLUDE_CONFIG_LOADCONFIGMODULE_H */
......@@ -38,7 +38,7 @@
#define MAX_OPTNAME_SIZE 64
#define CONFIG_MAXOPTLENGTH 512 /* max full option length, full option name exemple: (prefix1.[<index>].prefix2.optname */
/* parameter flags definitions */
......@@ -55,83 +55,81 @@
#define PARAMFLAG_PARAMSET (1 << 16) // parameter has been explicitely set in get functions
#define PARAMFLAG_PARAMSETDEF (1 << 17) // parameter has been set to default value in get functions
/* checkedparam_t is possibly used in paramdef_t for specific parameter value validation */
#define CONFIG_MAX_NUMCHECKVAL 20
typedef struct paramdef paramdef_t;
typedef union checkedparam {
struct {
int (*f1)(paramdef_t *param); /* check an integer against a list of authorized values */
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values */
int num_okintval; /* number of valid values in the checkingval array */
} s1;
struct {
int (*f1a)(paramdef_t *param); /* check an integer against a list of authorized values and set param value */
/* to the corresponding item in setintval array (mainly for RRC params) */
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values in config file */
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
int num_okintval; /* number of valid values in the checkingval array */
} s1a;
struct {
int (*f2)(paramdef_t *param); /* check an integer against an authorized range, defined by its min and max value */
int okintrange[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store min and max values */
} s2;
struct {
int (*f3)(paramdef_t *param); /* check a string against a list of authorized values */
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
int num_okstrval; /* number of valid values in the checkingval array */
} s3;
struct {
int (*f3a)(paramdef_t *param); /* check a string against a list of authorized values and set param value */
/* to the corresponding item in setintval array (mainly for RRC params) */
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
int num_okstrval; /* number of valid values in the checkingval array */
} s3a;
struct {
int (*f4)(paramdef_t *param); /* generic check function, no arguments but the param description */
} s4;
struct {
void (*checkfunc)(void) ;
} s5;
struct {
int (*f1)(paramdef_t *param); /* check an integer against a list of authorized values */
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values */
int num_okintval; /* number of valid values in the checkingval array */
} s1;
struct {
int (*f1a)(paramdef_t *param); /* check an integer against a list of authorized values and set param value */
/* to the corresponding item in setintval array (mainly for RRC params) */
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values in config file */
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
int num_okintval; /* number of valid values in the checkingval array */
} s1a;
struct {
int (*f2)(paramdef_t *param); /* check an integer against an authorized range, defined by its min and max value */
int okintrange[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store min and max values */
} s2;
struct {
int (*f3)(paramdef_t *param); /* check a string against a list of authorized values */
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
int num_okstrval; /* number of valid values in the checkingval array */
} s3;
struct {
int (*f3a)(paramdef_t *param); /* check a string against a list of authorized values and set param value */
/* to the corresponding item in setintval array (mainly for RRC params) */
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
int num_okstrval; /* number of valid values in the checkingval array */
} s3a;
struct {
int (*f4)(paramdef_t *param); /* generic check function, no arguments but the param description */
} s4;
struct {
void (*checkfunc)(void) ;
} s5;
} checkedparam_t;
/* paramdef is used to describe a parameter, array of paramdef_t strustures is used as the main parameter in */
/* config apis used to retrieve parameters values */
typedef struct paramdef
{
char optname[MAX_OPTNAME_SIZE]; /* parameter name, can be used as long command line option */
char *helpstr; /* help string */
unsigned int paramflags; /* value is a "ored" combination of above PARAMFLAG_XXXX values */
union { /* pointer to the parameter value, completed by the config module */
char **strptr;
char **strlistptr;
uint8_t *u8ptr;
int8_t *i8ptr;
uint16_t *u16ptr;
int16_t *i16ptr;
uint32_t *uptr;
int32_t *iptr;
uint64_t *u64ptr;
int64_t *i64ptr;
double *dblptr;
void *voidptr;
} ;
union { /* default parameter value, to be used when PARAMFLAG_MANDATORY is not specified */
char *defstrval;
char **defstrlistval;
uint32_t defuintval;
int defintval;
uint64_t defint64val;
int *defintarrayval;
double defdblval;
} ;
char type; /* parameter value type, as listed below as TYPE_XXXX macro */
int numelt; /* number of elements in a list or array parameters or max size of string value */
checkedparam_t *chkPptr; /* possible pointer to the structure containing the info used to check parameter values */
int *processedvalue; /* used to store integer values computed from string original value */
typedef struct paramdef {
char optname[MAX_OPTNAME_SIZE]; /* parameter name, can be used as long command line option */
char *helpstr; /* help string */
unsigned int paramflags; /* value is a "ored" combination of above PARAMFLAG_XXXX values */
union { /* pointer to the parameter value, completed by the config module */
char **strptr;
char **strlistptr;
uint8_t *u8ptr;
int8_t *i8ptr;
uint16_t *u16ptr;
int16_t *i16ptr;
uint32_t *uptr;
int32_t *iptr;
uint64_t *u64ptr;
int64_t *i64ptr;
double *dblptr;
void *voidptr;
} ;
union { /* default parameter value, to be used when PARAMFLAG_MANDATORY is not specified */
char *defstrval;
char **defstrlistval;
uint32_t defuintval;
int defintval;
uint64_t defint64val;
int *defintarrayval;
double defdblval;
} ;
char type; /* parameter value type, as listed below as TYPE_XXXX macro */
int numelt; /* number of elements in a list or array parameters or max size of string value */
checkedparam_t *chkPptr; /* possible pointer to the structure containing the info used to check parameter values */
int *processedvalue; /* used to store integer values computed from string original value */
} paramdef_t;
#define TYPE_INT TYPE_INT32
......@@ -161,9 +159,9 @@ typedef struct paramdef
#define ANY_IPV4ADDR_STRING "0.0.0.0"
typedef struct paramlist_def {
char listname[MAX_OPTNAME_SIZE];
paramdef_t **paramarray;
int numelt ;
char listname[MAX_OPTNAME_SIZE];
paramdef_t **paramarray;
int numelt ;
} paramlist_def_t;
/* macro helpers for module users */
......
This diff is collapsed.
......@@ -20,7 +20,7 @@
*/
/*! \file common/config/config_userapi.h
* \brief: configuration module, include file to be used by the source code calling the
* \brief: configuration module, include file to be used by the source code calling the
* configuration module to access configuration parameters
* \author Francois TABURET
* \date 2017
......@@ -31,7 +31,7 @@
* \warning
*/
#ifndef INCLUDE_CONFIG_USERAPI_H
#define INCLUDE_CONFIG_USERAPI_H
#define INCLUDE_CONFIG_USERAPI_H
#include "config_load_configmodule.h"
#ifdef __cplusplus
......@@ -48,14 +48,16 @@ extern "C"
#define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F))
/* utility functions, to be used by configuration module and/or configuration libraries */
extern configmodule_interface_t *config_get_if(void);
extern char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ;
extern char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ;
extern void config_printhelp(paramdef_t *,int numparams);
extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix);
extern void config_assign_processedint(paramdef_t *cfgoption, int val);
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
extern int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr);
/* apis to get parameters, to be used by oai modules, at configuration time */
/* apis to get/check parameters, to be used by oai modules, at configuration time */
#define CONFIG_CHECKALLSECTIONS "ALLSECTIONS"
extern int config_check_cmdlineopt(char *prefix);
extern int config_get(paramdef_t *params,int numparams, char *prefix);
extern int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix);
......
The configuration module objectives are
1. Allow easy parameters management in oai, helping the development of a flexible, modularized and fully configurable softmodem.
1. Use a common configuration API in all oai modules
1. Allow development of alternative configuration sources without modifying the oai code. Today the only delivered configuration source is the libconfig format configuration file.
The loader objectives are
1. provides a common mechanism to prevent an executable to include code that is only used under specific configurations, without rebuilding the code
1. Provide a common mechanism to allow to choose between different implementations of a given set of functions, without rebuilding the code
As a developer you may need to look at these sections:
......
### Adding console traces in oai code
#### console messages macros
```C
LOG_E(<component>,<format>,<argument>,...)
LOG_W(<component>,<format>,<argument>,...)
LOG_I(<component>,<format>,<argument>,...)
LOG_D(<component>,<format>,<argument>,...)
LOG_T(<component>,<format>,<argument>,...)
)
```
these macros are used in place of the printf C function. The additionnal ***component*** parameter identifies the functionnal module which generates the message. At run time, the message will only be printed if the configured log level for the component is greater or equal than the macro level used in the code.
| macro | level letter | level value | level name |
|:---------|:---------------|:---------------|----------------:|
| LOG_E | E | 0 | error |
| LOG_W | W | 1 | warning |
| LOG_I | I | 2 | informational |
| LOG_D | D | 3 | debug |
| LOG_T | T | 4 | trace |
component list is defined as an `enum` in [log.h](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/LOG/log.h). A new component can be defined by adding an item in this type, it must also be defined in the T tracer [T_messages.txt ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/T/T_messages.txt).
Most oai sources are including LOG macros.
#### conditional code macros
```C
LOG_DEBUGFLAG(<flag>)
```
this macro is to be used in if statements. The condition is true if the flag has been set, as described in the [run time usage page](rtusage.md)
```C
if ( LOG_DEBUGFLAG(<flag>) {
/*
the code below is only executed if the corresponding
<flag>_debug option is set.
*/
......................
......................
}
```
[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c#L396)
#### memory dump macros
```C
LOG_DUMPFLAG(<flag>)
```
this macro is to be used in if statements. The condition is true if the flag has been set, as described in the [run time usage page](rtusage.md). It is mainly provided to surround LOG_M macros or direct calls to `log_dump`which otherwise would be unconditionals.
```C
if ( LOG_DUMPFLAG(<flag>) {
/*
the code below is only executed if the corresponding
<flag>_dump option is set.
*/
LOG_M(.............
LOG_M(.............
log_dump(...
}
[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/LTE_TRANSPORT/prach.c#L205)
#### matlab format dump
```C
LOG_M(file, vector, data, len, dec, format)
```
|argument| type| description |
|:-----------|:-------|-----------------:|
| file | char* |path to the fle which will contain the dump |
|vector |char * |name of the dump, printed at the top of the dump file |
|data| void *| pointer to the memory to be dumpped |
|len | int | length of the data to be dumpped, in `dec` unit|
| dec| int | length of each data item.Interpretation depends on format|
|format| int | defines the type of data to be dumped|
This macro can be used to dump a buffer in a format that can be used for analyze via tools like matlab or octave. **It must be surrounded by LOG_DEBUGFLAG or LOG_DUMPFLAG macros, to prevent the dump to be built unconditionally.** The LOG_M macro points to the `write_file_matlab` function implemented in [log.c](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/LOG/log.c). **This function should be revisited for more understandable implementation and ease of use (format parameter ???)**
[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/LTE_TRANSPORT/prach.c#L205)
#### hexadecimal format dump
```C
LOG_DUMPMSG(c, f, b, s, x...)
```
dumps a memory region if the corresponding debug flag `f` is set as explained here [run time usage page](rtusage.md)
|argument| type| description |
|:-----------|:-------|-----------------:|
| c | int, component id (in `comp_name_t` enum)| used to print the message, as specified by the s and x arguments |
|f |int |flag used to filter the dump depending on the logs configuration. flag list is defined by the LOG_MASKMAP_INIT macro in [log.h](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/LOG/log.h) |
|b| void *| pointer to the memory to be dumpped |
|s | int | length of the data to be dumpped in char|
| x...| printf format and arguments| text string to be printed at the top of the dump|
This macro can be used to conditionaly dump a buffer, bytes by bytes, giving the integer value of each byte in hexadecimal form.
[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair2/RRC/LTE/rrc_eNB.c#L1181)
This macro points to the `log_dump` function, implemented in [log.c](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/LOG/log.c). This function can also dump buffers containing `double` data via the LOG_UDUMPMSG macro
```C
LOG_UDUMPMSG(c, b, s, f, x...)
```
|argument| type| description |
|:-----------|:-------|-----------------:|
| c | int, component id (in `comp_name_t` enum)| used to print the message, as specified by the s and x arguments |
|b| void *| pointer to the memory to be dumpped |
|s | int | length of the data to be dumpped in char|
|f| int | format of dumped data LOG_DUMP_CHAR or LOG_DUMP_DOUBLE|
| x...| printf format and arguments| text string to be printed at the top of the dump|
[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/SIMULATION/LTE_PHY/dlsim.c#L1974)
[logging facility developer main page](devusage.md)
[logging facility main page](log.md)
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
\ No newline at end of file
# logging facility source files
The oai logging facility is implemented in two source files, located in [common/utils/LOG](LOG)
1. [log.c](../log.c) contains logging implementation
1. [log.h](../log.h) is the logging facility include file containing both private and public data type definitions. It also contain API prototypes.
The logging facility doesn't create any thread, all api's are executed in the context of the caller. The tracing macro's `LOG_<X>` are all using the logRecord_mt function to output the messages. To keep this function thread safe it must perform a single system call to the output stream. The buffer used to build the message must be specific to the calling thread, which is today enforced by using a variable in the logRecord_mt stack.
Data used by the logging utility are defined by the `log_t` structure which is allocated at init time, when calling the `logInit` function.
[logging facility main page](log.md)
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
\ No newline at end of file
### Initializing and configuring the logging facility
#### logging facility APIs
```C
int logInit (void);
```
Allocate the internal data used by the logging utility, set the configuration, using the [configuration module](../../../config/DOC/config.md)
```C
void logClean (void)
```
Reset console attributes (color settings) and possibly close opened log files. Logging facility is still usable after this call, the internal data are not freed.
```C
int set_log(int component, int level)
void set_glog(int level)
```
Set a component or all components logiing level. Messages which level is lower than this level are not printed to the console.
```C
void set_glog_onlinelog(int enable)
```
Enable or disable all logging messages. Even error level messages are discarded, which is not advised. This can be usefull to temporarily workaround high rate of logging messages.
```C
void set_component_filelog(int comp)
void close_component_filelog(int comp)
```
Redirect or reset to stdout the output stream used by the logging facility. When the output stream is redirected to a file, it is created under /tmp with a hard-coded filename including the componemt name.
```C
SET_LOG_DEBUG(flag)
CLEAR_LOG_DEBUG(flag)
SET_LOG_DUMP(flag)
CLEAR_LOG_DUMP(flag)
```
These macros are used to set or clear the corresponding bit flag, trigerring the activation or un-activation of conditional code or memory dumps generation.
Example of using the logging utility APIs can be found, for initialization and cleanup, in [lte-softmodem.c](../../../../targets/RT/USER/lte-softmodem.c) and in the [telnet server log command implementation](../../telnetsrv/telnetsrv_proccmd.c) for a complete access to the logging facility features.
#### components and debug flags definitions
Adding a new component is just adding an item in the `comp_name_t` enum defined in [log.h](../log.h) . You must also declare it in the T Tracer facility [message fefinitions](../../T/T_messages.txt).
To add a flag than can then be used for adding conditional code or memory dumps you have to add the flag definition in the `LOG_MASKMAP_INIT` macro, in [log.h](../log.h).
[logging facility developer main page](devusage.md)
[logging facility main page](log.md)
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
\ No newline at end of file
### logging facility developer usage
The logging facility objectives are
1. provide a common console tracing mechanism
1. Allow a flexible activation of console traces, by configuration or dynamically at any time while code is running.
Most developpers will only use the log macros to add console messages to the code. The logging facility also provides an api that is used for initialization and configuration.
[Adding console traces in oaicode](addconsoletrace.md)
[Configuring the logging facility](configurelog.md)
[logging facility main page](log.md)
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
# OAI console logging facility
oai includes a console logging facility that any component should use when writting informational or debugging messages to the softmodem or uesoftmodem stdout stream.
By default, this facility is included at build-time and activated at run-time. The T Tracer and the Logging facility share common options for activation:
- To disable the logging facility (and T Tracer) at build-time use the *--disable-T-Tracer* switch:
```bash
/build_oai --disable-T-Tracer
```
- To use the the T-Tracer instead of the console logging facility, use the command line option *T_stdout*. *T_stdout* is a boolean option, which, when set to 0 (false) disable the console logging facility. All stdout messages are then sent to the T-Tracer.
## Documentation
* [runtime usage](rtusage.md)
* [developer usage](devusage.md)
* [module architecture](arch.md)
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -92,4 +92,5 @@ Connection closed by foreign host.
```
[oai telnetserver home](telnetsrv.md)
[oai telnetserver usage home](telnetusage.md)
\ No newline at end of file
[oai telnetserver usage home](telnetusage.md)
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -67,6 +67,7 @@ int phy_init_RU(RU_t *ru) {
}
if (ru->function != NGFI_RRU_IF5) { // we need to do RX/TX RU processing
init_dfts();
init_7_5KHz();
LOG_I(PHY,"nb_tx %d\n",ru->nb_tx);
ru->common.rxdata_7_5kHz = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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