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) { ...@@ -31,6 +31,7 @@ def sendSocialMediaMessage(pipeChannel, pipeColor, pipeMessage) {
} }
def doRedHatBuild = false def doRedHatBuild = false
def doFlexranCtrlTest = false
pipeline { pipeline {
agent { agent {
...@@ -69,6 +70,12 @@ pipeline { ...@@ -69,6 +70,12 @@ pipeline {
} else { } else {
doRedHatBuild = false 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 { ...@@ -103,6 +110,18 @@ pipeline {
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow // For the moment, there is no fail criteria. Just a notification of number of files that do not follow
sh "./ci-scripts/checkCodingFormattingRules.sh" 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 { post {
...@@ -288,12 +307,22 @@ pipeline { ...@@ -288,12 +307,22 @@ pipeline {
stage ("Test basic simulator") { stage ("Test basic simulator") {
steps { steps {
gitlabCommitStatus(name: "Test basic-sim") { 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}" 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") { stage ("Test FDD - Band 7 - B210") {
steps { steps {
script { script {
......
/inet.*brd/{print "interfaceToUse="$NF"done"}
...@@ -198,12 +198,18 @@ do ...@@ -198,12 +198,18 @@ do
fi fi
done 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 ] if [ $STATUS -eq 0 ]
then then
echo "BUILD_OK" > $ARCHIVES_LOC/build_final_status.log
echo "STATUS seems OK" echo "STATUS seems OK"
else else
echo "BUILD_KO" > $ARCHIVES_LOC/build_final_status.log
echo "STATUS failed?" echo "STATUS failed?"
fi fi
exit $STATUS exit $STATUS
...@@ -106,7 +106,12 @@ function build_on_vm { ...@@ -106,7 +106,12 @@ function build_on_vm {
echo "############################################################" echo "############################################################"
echo "Copying GIT repo into VM ($VM_NAME)" echo "Copying GIT repo into VM ($VM_NAME)"
echo "############################################################" echo "############################################################"
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 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 scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu
echo "############################################################" echo "############################################################"
...@@ -126,7 +131,22 @@ function build_on_vm { ...@@ -126,7 +131,22 @@ function build_on_vm {
echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS 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 echo "sudo apt-get --yes install zip daemon cppcheck >> zip-install.txt 2>&1" >> $VM_CMDS
fi fi
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 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 ] if [ $DAEMON -eq 0 ]
then then
echo "echo \"sudo apt-get --yes --quiet install zip subversion libboost-dev \"" >> $VM_CMDS echo "echo \"sudo apt-get --yes --quiet install zip subversion libboost-dev \"" >> $VM_CMDS
...@@ -156,7 +176,19 @@ function build_on_vm { ...@@ -156,7 +176,19 @@ function build_on_vm {
echo "chmod 775 ./my-vm-build.sh " >> $VM_CMDS 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 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 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 "echo \"source oaienv\"" >> $VM_CMDS
echo "source oaienv" >> $VM_CMDS echo "source oaienv" >> $VM_CMDS
echo "cd cmake_targets/" >> $VM_CMDS echo "cd cmake_targets/" >> $VM_CMDS
......
...@@ -237,8 +237,8 @@ THREAD_STRUCT = ( ...@@ -237,8 +237,8 @@ THREAD_STRUCT = (
NETWORK_CONTROLLER : NETWORK_CONTROLLER :
{ {
FLEXRAN_ENABLED = "no"; FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo"; FLEXRAN_INTERFACE_NAME = "ens3";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210; FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache"; FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no"; FLEXRAN_AWAIT_RECONF = "no";
......
...@@ -217,8 +217,8 @@ THREAD_STRUCT = ( ...@@ -217,8 +217,8 @@ THREAD_STRUCT = (
NETWORK_CONTROLLER : NETWORK_CONTROLLER :
{ {
FLEXRAN_ENABLED = "no"; FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo"; FLEXRAN_INTERFACE_NAME = "ens3";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210; FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache"; FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no"; FLEXRAN_AWAIT_RECONF = "no";
......
This diff is collapsed.
...@@ -40,6 +40,7 @@ function variant_usage { ...@@ -40,6 +40,7 @@ function variant_usage {
echo " --variant cppcheck OR -v4" echo " --variant cppcheck OR -v4"
echo " --variant enb-ethernet OR -v7" echo " --variant enb-ethernet OR -v7"
echo " --variant ue-ethernet OR -v8" echo " --variant ue-ethernet OR -v8"
echo " --variant flexran-rtc OR -v10"
} }
MY_DIR=$(dirname $(readlink -f $0)) MY_DIR=$(dirname $(readlink -f $0))
...@@ -284,6 +285,15 @@ case $key in ...@@ -284,6 +285,15 @@ case $key in
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
shift 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)
variant="$2" variant="$2"
case $variant in case $variant in
...@@ -340,6 +350,14 @@ case $key in ...@@ -340,6 +350,14 @@ case $key in
BUILD_OPTIONS="--UE -t ETHERNET --noS1" BUILD_OPTIONS="--UE -t ETHERNET --noS1"
NBARGS=$[$NBARGS+256] 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 ""
echo "Syntax Error: Invalid Variant option -> $variant" echo "Syntax Error: Invalid Variant option -> $variant"
......
This diff is collapsed.
...@@ -92,10 +92,14 @@ function report_test { ...@@ -92,10 +92,14 @@ function report_test {
echo "<!DOCTYPE html>" > ./test_simulator_results.html echo "<!DOCTYPE html>" > ./test_simulator_results.html
echo "<html class=\"no-js\" lang=\"en-US\">" >> ./test_simulator_results.html echo "<html class=\"no-js\" lang=\"en-US\">" >> ./test_simulator_results.html
echo "<head>" >> ./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 " <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 " <base href = \"http://www.openairinterface.org/\" />" >> ./test_simulator_results.html
echo "</head>" >> ./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 " <table style=\"border-collapse: collapse; border: none;\">" >> ./test_simulator_results.html
echo " <tr 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 echo " <td style=\"border-collapse: collapse; border: none;\">" >> ./test_simulator_results.html
...@@ -162,6 +166,26 @@ function report_test { ...@@ -162,6 +166,26 @@ function report_test {
then then
echo " <h3>Basic Simulator Check</h3>" >> ./test_simulator_results.html 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 " <table border = \"1\">" >> ./test_simulator_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
echo " <th>Log File Name</th>" >> ./test_simulator_results.html echo " <th>Log File Name</th>" >> ./test_simulator_results.html
...@@ -360,6 +384,36 @@ function report_test { ...@@ -360,6 +384,36 @@ function report_test {
done done
echo " </table>" >> ./test_simulator_results.html 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 fi
ARCHIVES_LOC=archives/phy_sim/test ARCHIVES_LOC=archives/phy_sim/test
...@@ -367,6 +421,24 @@ function report_test { ...@@ -367,6 +421,24 @@ function report_test {
then then
echo " <h3>Physical Simulators Check</h3>" >> ./test_simulator_results.html 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 " <table border = \"1\">" >> ./test_simulator_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
echo " <th>Log File Name</th>" >> ./test_simulator_results.html echo " <th>Log File Name</th>" >> ./test_simulator_results.html
...@@ -399,6 +471,10 @@ function report_test { ...@@ -399,6 +471,10 @@ function report_test {
done done
echo " </table>" >> ./test_simulator_results.html 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 echo " <h4>Details</h4>" >> ./test_simulator_results.html
for XML_FILE in $XML_TESTS for XML_FILE in $XML_TESTS
...@@ -449,6 +525,9 @@ function report_test { ...@@ -449,6 +525,9 @@ function report_test {
done done
fi 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 echo "</html>" >> ./test_simulator_results.html
} }
This diff is collapsed.
...@@ -165,6 +165,25 @@ function check_on_vm_build { ...@@ -165,6 +165,25 @@ function check_on_vm_build {
fi fi
done 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 @@ ...@@ -24,6 +24,7 @@
<TestCaseRequestedList> <TestCaseRequestedList>
010101 010101
050101 060101 070101 040101 050101 060101 070101 040101
030100 040300 040401 040201 030201
030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 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 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 030121 040301 040521 040623 040624 040625 040626 040627 040662 040661 040663 040664 040401 040201 030201
...@@ -37,6 +38,12 @@ ...@@ -37,6 +38,12 @@
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args> <Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
</testCase> </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"> <testCase id="030101">
<class>Initialize_eNB</class> <class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band7/5MHz)</desc> <desc>Initialize eNB (FDD/Band7/5MHz)</desc>
...@@ -70,6 +77,12 @@ ...@@ -70,6 +77,12 @@
<desc>Terminate UE</desc> <desc>Terminate UE</desc>
</testCase> </testCase>
<testCase id="040300">
<class>Attach_UE</class>
<desc>Attach single UE</desc>
<nbMaxUEtoAttach>1</nbMaxUEtoAttach>
</testCase>
<testCase id="040301"> <testCase id="040301">
<class>Attach_UE</class> <class>Attach_UE</class>
<desc>Attach UE</desc> <desc>Attach UE</desc>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<TestCaseRequestedList> <TestCaseRequestedList>
010101 010101
050101 060101 070101 040101 050101 060101 070101 040101
030100 040300 040401 040201 030201
030104 040301 040501 040602 040601 040603 040642 040641 040643 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 030114 040301 040511 040612 040611 040613 040652 040651 040653 040401 040201 030201
050201 060201 070201 050201 060201 070201
...@@ -40,6 +41,12 @@ ...@@ -40,6 +41,12 @@
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args> <Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
</testCase> </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"> <testCase id="030104">
<class>Initialize_eNB</class> <class>Initialize_eNB</class>
<desc>Initialize eNB (TDD/Band40/5MHz)</desc> <desc>Initialize eNB (TDD/Band40/5MHz)</desc>
...@@ -73,6 +80,12 @@ ...@@ -73,6 +80,12 @@
<desc>Terminate UE</desc> <desc>Terminate UE</desc>
</testCase> </testCase>
<testCase id="040300">
<class>Attach_UE</class>
<desc>Attach single UE</desc>
<nbMaxUEtoAttach>1</nbMaxUEtoAttach>
</testCase>
<testCase id="040301"> <testCase id="040301">
<class>Attach_UE</class> <class>Attach_UE</class>
<desc>Attach UE</desc> <desc>Attach UE</desc>
......
...@@ -21,17 +21,15 @@ ...@@ -21,17 +21,15 @@
--> -->
<testCaseList> <testCaseList>
<!-- Only 5MHz is tested since neither 10MHz nor 20MHz work in this configuration --> <!-- Only 5MHz/10MHz is tested since 20MHz does not work as in monolithic -->
<!-- Also no UL iperf in 5MHz (040642) -->
<TestCaseRequestedList> <TestCaseRequestedList>
010101 010101
050101 060101 070101 040101 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 050201 060201 070201
</TestCaseRequestedList> </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 030124 030125 040301 040521 040622 040662 040401 040201 030201 030202
--> -->
<TestCaseExclusionList> <TestCaseExclusionList>
......
...@@ -21,17 +21,14 @@ ...@@ -21,17 +21,14 @@
--> -->
<testCaseList> <testCaseList>
<!-- Only 5MHz is tested since neither 10MHz nor 20MHz work in this configuration -->
<TestCaseRequestedList> <TestCaseRequestedList>
010101 010101
050101 060101 070101 040101 050101 060101 070101 040101
030101 030102 040301 040501 040604 040642 040401 040201 030201 030202 030101 030102 040301 040501 040604 040642 040401 040201 030201 030202
050201 060201 070201
</TestCaseRequestedList>
<!--
030111 030112 040301 040511 040614 040652 040401 040201 030201 030202 030111 030112 040301 040511 040614 040652 040401 040201 030201 030202
030121 030122 040301 040521 040624 040662 040401 040201 030201 030202 030121 030122 040301 040521 040624 040662 040401 040201 030201 030202
--> 050201 060201 070201
</TestCaseRequestedList>
<TestCaseExclusionList> <TestCaseExclusionList>
</TestCaseExclusionList> </TestCaseExclusionList>
......
...@@ -107,6 +107,28 @@ ...@@ -107,6 +107,28 @@
<desc>Reboot UE</desc> <desc>Reboot UE</desc>
</testCase> </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 --> <!-- EPC class command references -->
<testCase id="050101"> <testCase id="050101">
......
...@@ -630,7 +630,6 @@ add_boolean_option(ENABLE_VCD True "always true now, time measurem ...@@ -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(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 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(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") add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
########################## ##########################
...@@ -1927,6 +1926,7 @@ add_executable(lte-softmodem ...@@ -1927,6 +1926,7 @@ add_executable(lte-softmodem
${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c
...@@ -1966,6 +1966,7 @@ add_executable(lte-softmodem-nos1 ...@@ -1966,6 +1966,7 @@ add_executable(lte-softmodem-nos1
${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c
...@@ -2003,6 +2004,7 @@ add_executable(lte-uesoftmodem ...@@ -2003,6 +2004,7 @@ add_executable(lte-uesoftmodem
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.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/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rfsim.c ${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
...@@ -2041,6 +2043,7 @@ add_executable(lte-uesoftmodem-nos1 ...@@ -2041,6 +2043,7 @@ add_executable(lte-uesoftmodem-nos1
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.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/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rfsim.c ${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
......
...@@ -651,6 +651,9 @@ function main() { ...@@ -651,6 +651,9 @@ function main() {
compilations \ compilations \
lte-simulators coding \ lte-simulators coding \
libcoding.so $dbin/libcoding.so libcoding.so $dbin/libcoding.so
# compilations \
# lte-simulators $config_libconfig_shlib \
# lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
fi fi
# Core simulators # Core simulators
......
...@@ -39,40 +39,38 @@ ...@@ -39,40 +39,38 @@
#include "config_userapi.h" #include "config_userapi.h"
int parse_stringlist(paramdef_t *cfgoptions, char *val) int parse_stringlist(paramdef_t *cfgoptions, char *val) {
{ char *atoken;
char *atoken; char *tokctx;
char *tokctx; char *tmpval=strdup(val);
char *tmpval=strdup(val); int numelt=0;
int numelt=0;
cfgoptions->numelt=0; cfgoptions->numelt=0;
atoken=strtok_r(tmpval, ",",&tokctx); atoken=strtok_r(tmpval, ",",&tokctx);
while(atoken != NULL) { while(atoken != NULL) {
numelt++ ; numelt++ ;
atoken=strtok_r(NULL, ",",&tokctx); atoken=strtok_r(NULL, ",",&tokctx);
} }
free(tmpval); free(tmpval);
config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt); config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt);
cfgoptions->numelt=numelt; cfgoptions->numelt=numelt;
atoken=strtok_r(val, ",",&tokctx); atoken=strtok_r(val, ",",&tokctx);
for( int i=0; i<cfgoptions->numelt && atoken != NULL ; i++) { for( int i=0; i<cfgoptions->numelt && atoken != NULL ; i++) {
config_check_valptr(cfgoptions,&(cfgoptions->strlistptr[i]),strlen(atoken)+1); config_check_valptr(cfgoptions,&(cfgoptions->strlistptr[i]),strlen(atoken)+1);
sprintf(cfgoptions->strlistptr[i],"%s",atoken); sprintf(cfgoptions->strlistptr[i],"%s",atoken);
printf_params("[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname,i,cfgoptions->strlistptr[i]); printf_params("[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname,i,cfgoptions->strlistptr[i]);
atoken=strtok_r(NULL, ",",&tokctx); atoken=strtok_r(NULL, ",",&tokctx);
} }
return (cfgoptions->numelt > 0); return (cfgoptions->numelt > 0);
} }
int processoption(paramdef_t *cfgoptions, char *value) int processoption(paramdef_t *cfgoptions, char *value) {
{ char *tmpval = value;
char *tmpval = value; int optisset=0;
int optisset=0; char defbool[2]="1";
char defbool[2]="1";
if ( value == NULL) { if ( value == NULL) {
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */ if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
...@@ -82,8 +80,8 @@ char defbool[2]="1"; ...@@ -82,8 +80,8 @@ char defbool[2]="1";
tmpval = defbool; tmpval = defbool;
} }
} }
switch(cfgoptions->type)
{ switch(cfgoptions->type) {
case TYPE_STRING: case TYPE_STRING:
if (cfgoptions->numelt == 0 ) { if (cfgoptions->numelt == 0 ) {
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1); config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
...@@ -91,6 +89,7 @@ char defbool[2]="1"; ...@@ -91,6 +89,7 @@ char defbool[2]="1";
} else { } else {
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval); sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
} }
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval); printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
optisset=1; optisset=1;
break; break;
...@@ -98,6 +97,7 @@ char defbool[2]="1"; ...@@ -98,6 +97,7 @@ char defbool[2]="1";
case TYPE_STRINGLIST: case TYPE_STRINGLIST:
optisset=parse_stringlist(cfgoptions,tmpval); optisset=parse_stringlist(cfgoptions,tmpval);
break; break;
case TYPE_UINT32: case TYPE_UINT32:
case TYPE_INT32: case TYPE_INT32:
case TYPE_UINT16: case TYPE_UINT16:
...@@ -108,6 +108,7 @@ char defbool[2]="1"; ...@@ -108,6 +108,7 @@ char defbool[2]="1";
config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,NULL,0)); config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,NULL,0));
optisset=1; optisset=1;
break; break;
case TYPE_UINT64: case TYPE_UINT64:
case TYPE_INT64: case TYPE_INT64:
config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t)); config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t));
...@@ -115,10 +116,11 @@ char defbool[2]="1"; ...@@ -115,10 +116,11 @@ char defbool[2]="1";
printf_cmdl("[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*(cfgoptions->i64ptr)); printf_cmdl("[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*(cfgoptions->i64ptr));
optisset=1; optisset=1;
break; break;
case TYPE_UINTARRAY: case TYPE_UINTARRAY:
case TYPE_INTARRAY: case TYPE_INTARRAY:
break; break;
case TYPE_DOUBLE: case TYPE_DOUBLE:
config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double)); config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double));
*(cfgoptions->dblptr) = strtof(tmpval,NULL); *(cfgoptions->dblptr) = strtof(tmpval,NULL);
...@@ -127,45 +129,83 @@ char defbool[2]="1"; ...@@ -127,45 +129,83 @@ char defbool[2]="1";
break; break;
case TYPE_IPV4ADDR: case TYPE_IPV4ADDR:
break; break;
default: default:
fprintf(stderr,"[CONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type); fprintf(stderr,"[CONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type);
break; break;
} /* switch on param type */ } /* switch on param type */
if (optisset == 1) { if (optisset == 1) {
cfgoptions->paramflags = cfgoptions->paramflags | PARAMFLAG_PARAMSET; cfgoptions->paramflags = cfgoptions->paramflags | PARAMFLAG_PARAMSET;
} }
return optisset; return optisset;
} }
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) int config_check_cmdlineopt(char *prefix) {
{ int unknowndetected=0;
char testprefix[CONFIG_MAXOPTLENGTH]="";
int finalcheck = 0;
if (prefix != NULL) {
if (strcmp(prefix,CONFIG_CHECKALLSECTIONS) == 0)
finalcheck = 1;
else if (strlen(prefix) > 0) {
sprintf(testprefix,"--%s.",prefix);
}
}
for (int i=1; i<config_get_if()->argc ; i++) {
if ( !finalcheck && strstr(config_get_if()->argv[i],testprefix) == NULL ) continue;
if ( !finalcheck && testprefix[0]==0 && index(config_get_if()->argv[i],'.') != NULL) continue;
if ( !finalcheck && config_get_if()->argv[i][0] == '-' && isdigit(config_get_if()->argv[i][1])) continue;
if ( (config_get_if()->argv_info[i] & CONFIG_CMDLINEOPT_PROCESSED) == 0 ) {
fprintf(stderr,"[CONFIG] unknown option: %s\n",
config_get_if()->argv[i] );
unknowndetected++;
}
}
printf_cmdl("[CONFIG] %i unknown option(s) in command line starting with %s (section %s)\n",
unknowndetected,testprefix,((prefix==NULL)?"":prefix));
return unknowndetected;
} /* parse_cmdline*/
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) {
int c = config_get_if()->argc; int c = config_get_if()->argc;
int i,j; int i,j;
char *pp; char *pp;
char cfgpath[512]; /* 512 should be enough for the sprintf below */ char cfgpath[CONFIG_MAXOPTLENGTH];
j = 0; j = 0;
i = 0; i = 0;
while (c > 0 ) { while (c > 0 ) {
char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */ char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
/* first check help options, either --help, -h or --help_<section> */ /* first check help options, either --help, -h or --help_<section> */
if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) { if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) {
char *tokctx; char *tokctx;
pp=strtok_r(oneargv, "_",&tokctx); pp=strtok_r(oneargv, "_",&tokctx);
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
if (pp == NULL || strcasecmp(pp,config_get_if()->argv[i] ) == 0 ) { if (pp == NULL || strcasecmp(pp,config_get_if()->argv[i] ) == 0 ) {
if( prefix == NULL) { if( prefix == NULL) {
config_printhelp(cfgoptions,numoptions); config_printhelp(cfgoptions,numoptions);
if ( ! ( CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP))) if ( ! ( CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP)))
exit_fun("[CONFIG] Exiting after displaying help\n"); exit_fun("[CONFIG] Exiting after displaying help\n");
} }
} else { } else {
pp=strtok_r(NULL, " ",&tokctx); pp=strtok_r(NULL, " ",&tokctx);
if ( prefix != NULL && pp != NULL && strncasecmp(prefix,pp,strlen(pp)) == 0 ) { if ( prefix != NULL && pp != NULL && strncasecmp(prefix,pp,strlen(pp)) == 0 ) {
printf ("Help for %s section:\n",prefix); printf ("Help for %s section:\n",prefix);
config_printhelp(cfgoptions,numoptions); config_printhelp(cfgoptions,numoptions);
if ( ! (CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP))) { if ( ! (CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP))) {
fprintf(stderr,"[CONFIG] %s %i section %s:", __FILE__, __LINE__, prefix); fprintf(stderr,"[CONFIG] %s %i section %s:", __FILE__, __LINE__, prefix);
exit_fun(" Exiting after displaying help\n"); exit_fun(" Exiting after displaying help\n");
...@@ -176,23 +216,29 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) ...@@ -176,23 +216,29 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
/* now, check for non help options */ /* now, check for non help options */
if (oneargv[0] == '-') { if (oneargv[0] == '-') {
for(int n=0;n<numoptions;n++) { for(int n=0; n<numoptions; n++) {
if ( ( cfgoptions[n].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) { if ( ( cfgoptions[n].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) {
continue; continue;
} }
if (prefix != NULL) { if (prefix != NULL) {
sprintf(cfgpath,"%s.%s",prefix,cfgoptions[n].optname); sprintf(cfgpath,"%s.%s",prefix,cfgoptions[n].optname);
} else { } else {
sprintf(cfgpath,"%s",cfgoptions[n].optname); sprintf(cfgpath,"%s",cfgoptions[n].optname);
} }
if ( ((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgpath) == 0)) || /* short option, one "-" */ if ( ((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgpath) == 0)) || /* short option, one "-" */
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) ) { ((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) ) {
char *valptr=NULL; char *valptr=NULL;
int ret; int ret;
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
if (c > 0) { if (c > 0) {
pp = config_get_if()->argv[i+1]; pp = config_get_if()->argv[i+1];
if (pp != NULL ) { if (pp != NULL ) {
ret = strlen(pp); ret = strlen(pp);
if (ret > 0 ) { if (ret > 0 ) {
if (pp[0] != '-') if (pp[0] != '-')
valptr=pp; valptr=pp;
...@@ -201,19 +247,36 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) ...@@ -201,19 +247,36 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
} }
} }
} }
j += processoption(&(cfgoptions[n]), valptr); j += processoption(&(cfgoptions[n]), valptr);
if ( valptr != NULL ) { if ( valptr != NULL ) {
i++; i++;
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
c--; c--;
} }
break; break;
} }
} /* for n... */ } /* for n... */
} /* if (oneargv[0] == '-') */ } /* if (oneargv[0] == '-') */
free(oneargv); free(oneargv);
i++; i++;
c--; c--;
} /* fin du while */ } /* fin du while */
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j); printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
if ( !(CONFIG_ISFLAGSET( CONFIG_NOCHECKUNKOPT )) ) {
i=config_check_cmdlineopt(prefix);
if (i > 0) {
fprintf(stderr,"[CONFIG] %i unknown options for section %s detected in command line\n",
i,((prefix==NULL)?"\"root section\"":prefix));
exit_fun(" Exiting after detecting errors in command line \n");
}
}
return j; return j;
} /* parse_cmdline*/ } /* parse_cmdline*/
...@@ -42,17 +42,15 @@ ...@@ -42,17 +42,15 @@
#include "config_userapi.h" #include "config_userapi.h"
#define CONFIG_SHAREDLIBFORMAT "libparams_%s.so" #define CONFIG_SHAREDLIBFORMAT "libparams_%s.so"
int load_config_sharedlib(configmodule_interface_t *cfgptr) int load_config_sharedlib(configmodule_interface_t *cfgptr) {
{ void *lib_handle;
void *lib_handle; char fname[128];
char fname[128]; char libname[FILENAME_MAX];
char libname[FILENAME_MAX]; int st;
int st;
st=0; st=0;
sprintf(libname,CONFIG_SHAREDLIBFORMAT,cfgptr->cfgmode); sprintf(libname,CONFIG_SHAREDLIBFORMAT,cfgptr->cfgmode);
lib_handle = dlopen(libname,RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE); lib_handle = dlopen(libname,RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
if (!lib_handle) { if (!lib_handle) {
fprintf(stderr,"[CONFIG] %s %d Error calling dlopen(%s): %s\n",__FILE__, __LINE__, libname,dlerror()); fprintf(stderr,"[CONFIG] %s %d Error calling dlopen(%s): %s\n",__FILE__, __LINE__, libname,dlerror());
st = -1; st = -1;
...@@ -71,6 +69,7 @@ int st; ...@@ -71,6 +69,7 @@ int st;
sprintf (fname,"config_%s_get",cfgptr->cfgmode); sprintf (fname,"config_%s_get",cfgptr->cfgmode);
cfgptr->get = dlsym(lib_handle,fname); cfgptr->get = dlsym(lib_handle,fname);
if (cfgptr->get == NULL ) { if (cfgptr->get == NULL ) {
printf("[CONFIG] %s %d no function %s for config mode %s\n", printf("[CONFIG] %s %d no function %s for config mode %s\n",
__FILE__, __LINE__,fname, cfgptr->cfgmode); __FILE__, __LINE__,fname, cfgptr->cfgmode);
...@@ -79,6 +78,7 @@ int st; ...@@ -79,6 +78,7 @@ int st;
sprintf (fname,"config_%s_getlist",cfgptr->cfgmode); sprintf (fname,"config_%s_getlist",cfgptr->cfgmode);
cfgptr->getlist = dlsym(lib_handle,fname); cfgptr->getlist = dlsym(lib_handle,fname);
if (cfgptr->getlist == NULL ) { if (cfgptr->getlist == NULL ) {
printf("[CONFIG] %s %d no function %s for config mode %s\n", printf("[CONFIG] %s %d no function %s for config mode %s\n",
__FILE__, __LINE__,fname, cfgptr->cfgmode); __FILE__, __LINE__,fname, cfgptr->cfgmode);
...@@ -87,6 +87,7 @@ int st; ...@@ -87,6 +87,7 @@ int st;
sprintf (fname,"config_%s_end",cfgptr->cfgmode); sprintf (fname,"config_%s_end",cfgptr->cfgmode);
cfgptr->end = dlsym(lib_handle,fname); cfgptr->end = dlsym(lib_handle,fname);
if (cfgptr->getlist == NULL ) { if (cfgptr->getlist == NULL ) {
printf("[CONFIG] %s %d no function %s for config mode %s\n", printf("[CONFIG] %s %d no function %s for config mode %s\n",
__FILE__, __LINE__,fname, cfgptr->cfgmode); __FILE__, __LINE__,fname, cfgptr->cfgmode);
...@@ -102,29 +103,29 @@ int nooptfunc(void) { ...@@ -102,29 +103,29 @@ int nooptfunc(void) {
}; };
int config_cmdlineonly_getlist(paramlist_def_t *ParamList, int config_cmdlineonly_getlist(paramlist_def_t *ParamList,
paramdef_t *params, int numparams, char *prefix) paramdef_t *params, int numparams, char *prefix) {
{
ParamList->numelt = 0; ParamList->numelt = 0;
return 0; return 0;
} }
int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
{
int defval; int defval;
int fatalerror=0; int fatalerror=0;
int numdefvals=0; int numdefvals=0;
for(int i=0; i<numoptions; i++) {
for(int i=0;i<numoptions;i++) {
defval=0; defval=0;
switch(cfgoptions[i].type) { switch(cfgoptions[i].type) {
case TYPE_STRING: case TYPE_STRING:
defval=config_setdefault_string(&(cfgoptions[i]), prefix); defval=config_setdefault_string(&(cfgoptions[i]), prefix);
break; break;
case TYPE_STRINGLIST: case TYPE_STRINGLIST:
defval=config_setdefault_stringlist(&(cfgoptions[i]), prefix); defval=config_setdefault_stringlist(&(cfgoptions[i]), prefix);
break; break;
case TYPE_UINT8: case TYPE_UINT8:
case TYPE_INT8: case TYPE_INT8:
case TYPE_UINT16: case TYPE_UINT16:
...@@ -134,96 +135,120 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) ...@@ -134,96 +135,120 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
case TYPE_MASK: case TYPE_MASK:
defval=config_setdefault_int(&(cfgoptions[i]), prefix); defval=config_setdefault_int(&(cfgoptions[i]), prefix);
break; break;
case TYPE_UINT64: case TYPE_UINT64:
case TYPE_INT64: case TYPE_INT64:
defval=config_setdefault_int64(&(cfgoptions[i]), prefix); defval=config_setdefault_int64(&(cfgoptions[i]), prefix);
break; break;
case TYPE_UINTARRAY: case TYPE_UINTARRAY:
case TYPE_INTARRAY: case TYPE_INTARRAY:
defval=config_setdefault_intlist(&(cfgoptions[i]), prefix); defval=config_setdefault_intlist(&(cfgoptions[i]), prefix);
break; break;
case TYPE_DOUBLE: case TYPE_DOUBLE:
defval=config_setdefault_double(&(cfgoptions[i]), prefix); defval=config_setdefault_double(&(cfgoptions[i]), prefix);
break; break;
case TYPE_IPV4ADDR: case TYPE_IPV4ADDR:
defval=config_setdefault_ipv4addr(&(cfgoptions[i]), prefix); defval=config_setdefault_ipv4addr(&(cfgoptions[i]), prefix);
break; break;
default: default:
fprintf(stderr,"[CONFIG] %s.%s type %i not supported\n",prefix, cfgoptions[i].optname,cfgoptions[i].type); fprintf(stderr,"[CONFIG] %s.%s type %i not supported\n",prefix, cfgoptions[i].optname,cfgoptions[i].type);
fatalerror=1; fatalerror=1;
break; break;
} /* switch on param type */ } /* switch on param type */
if (defval == 1) { if (defval == 1) {
numdefvals++; numdefvals++;
cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSETDEF; cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSETDEF;
} }
} /* for loop on options */ } /* for loop on options */
printf("[CONFIG] %s: %i/%i parameters successfully set \n", printf("[CONFIG] %s: %i/%i parameters successfully set \n",
((prefix == NULL)?"(root)":prefix), ((prefix == NULL)?"(root)":prefix),
numdefvals,numoptions ); numdefvals,numoptions );
if (fatalerror == 1) { if (fatalerror == 1) {
fprintf(stderr,"[CONFIG] fatal errors found when assigning %s parameters \n", fprintf(stderr,"[CONFIG] fatal errors found when assigning %s parameters \n",
prefix); prefix);
} }
return numdefvals; return numdefvals;
} }
configmodule_interface_t *load_configmodule(int argc, char **argv) configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags) {
{ char *cfgparam=NULL;
char *cfgparam=NULL; char *modeparams=NULL;
char *modeparams=NULL; char *cfgmode=NULL;
char *cfgmode=NULL; char *strtokctx=NULL;
char *strtokctx=NULL; char *atoken;
char *atoken; uint32_t tmpflags=0;
uint32_t tmpflags=0; int i;
int i; int OoptIdx=-1;
/* first parse the command line to look for the -O option */ /* first parse the command line to look for the -O option */
for (i = 0;i<argc;i++) { for (i = 0; i<argc; i++) {
if (strlen(argv[i]) < 2) continue; if (strlen(argv[i]) < 2) continue;
if ( argv[i][1] == 'O' && i < (argc -1)) { if ( argv[i][1] == 'O' && i < (argc -1)) {
cfgparam = argv[i+1]; cfgparam = argv[i+1];
OoptIdx=i;
} }
if ( strstr(argv[i], "help_config") != NULL ) { if ( strstr(argv[i], "help_config") != NULL ) {
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params)); config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
exit(0); exit(0);
} }
if ( (strcmp(argv[i]+1, "h") == 0) || (strstr(argv[i]+1, "help_") != NULL ) ) { if ( (strcmp(argv[i]+1, "h") == 0) || (strstr(argv[i]+1, "help_") != NULL ) ) {
tmpflags = CONFIG_HELP; tmpflags = CONFIG_HELP;
} }
} }
/* look for the OAI_CONFIGMODULE environement variable */ /* look for the OAI_CONFIGMODULE environement variable */
if ( cfgparam == NULL ) { if ( cfgparam == NULL ) {
cfgparam = getenv("OAI_CONFIGMODULE"); cfgparam = getenv("OAI_CONFIGMODULE");
} }
/* default */ /* default different for UE and softmodem because UE doesn't use config file*/
/* and -O option is not mandatory for UE */
/* phy simulators behave as UE */
/* test of exec name would better be replaced by a parameter to the l */
/* oad_configmodule function */
if (cfgparam == NULL) { if (cfgparam == NULL) {
tmpflags = tmpflags | CONFIG_NOOOPT; tmpflags = tmpflags | CONFIG_NOOOPT;
if (strstr(argv[0],"uesoftmodem") == NULL) {
cfgparam = CONFIG_LIBCONFIGFILE ":" DEFAULT_CFGFILENAME; if ( initflags & CONFIG_ENABLECMDLINEONLY) {
cfgparam = CONFIG_CMDLINEONLY ":dbgl0" ;
} else { } else {
cfgparam = CONFIG_CMDLINEONLY ":dbgl0" ; cfgparam = CONFIG_CMDLINEONLY ":dbgl0" ;
cfgparam = CONFIG_LIBCONFIGFILE ":" DEFAULT_CFGFILENAME;
} }
} }
/* parse the config parameters to set the config source */ /* parse the config parameters to set the config source */
i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams); i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams);
if (i< 0) { if (i< 0) {
fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno)); fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno));
exit(-1); exit(-1) ;
} } else if ( i == 1 ) {
else if ( i == 1 ) {
/* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig /* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig
with one parameter, the path to the configuration file */ with one parameter, the path to the configuration file cfgmode must not be NULL */
modeparams=cfgmode; modeparams=cfgmode;
cfgmode=strdup(CONFIG_LIBCONFIGFILE); cfgmode=strdup(CONFIG_LIBCONFIGFILE);
} }
cfgptr = malloc(sizeof(configmodule_interface_t)); cfgptr = calloc(sizeof(configmodule_interface_t),1);
memset(cfgptr,0,sizeof(configmodule_interface_t)); cfgptr->argv_info = calloc(sizeof(int32_t), argc);
cfgptr->argv_info[0] |= CONFIG_CMDLINEOPT_PROCESSED;
if (OoptIdx >= 0) {
cfgptr->argv_info[OoptIdx] |= CONFIG_CMDLINEOPT_PROCESSED;
cfgptr->argv_info[OoptIdx+1] |= CONFIG_CMDLINEOPT_PROCESSED;
}
cfgptr->rtflags = cfgptr->rtflags | tmpflags; cfgptr->rtflags = cfgptr->rtflags | tmpflags;
cfgptr->argc = argc; cfgptr->argc = argc;
...@@ -231,30 +256,34 @@ int i; ...@@ -231,30 +256,34 @@ int i;
cfgptr->cfgmode=strdup(cfgmode); cfgptr->cfgmode=strdup(cfgmode);
cfgptr->num_cfgP=0; cfgptr->num_cfgP=0;
atoken=strtok_r(modeparams,":",&strtokctx); atoken=strtok_r(modeparams,":",&strtokctx);
while ( cfgptr->num_cfgP< CONFIG_MAX_OOPT_PARAMS && atoken != NULL) { while ( cfgptr->num_cfgP< CONFIG_MAX_OOPT_PARAMS && atoken != NULL) {
/* look for debug level in the config parameters, it is commom to all config mode /* look for debug level in the config parameters, it is commom to all config mode
and will be removed frome the parameter array passed to the shared module */ and will be removed frome the parameter array passed to the shared module */
char *aptr; char *aptr;
aptr=strcasestr(atoken,"dbgl"); aptr=strcasestr(atoken,"dbgl");
if (aptr != NULL) { if (aptr != NULL) {
cfgptr->rtflags = cfgptr->rtflags | strtol(aptr+4,NULL,0); cfgptr->rtflags = cfgptr->rtflags | strtol(aptr+4,NULL,0);
} else { } else {
cfgptr->cfgP[cfgptr->num_cfgP] = strdup(atoken); cfgptr->cfgP[cfgptr->num_cfgP] = strdup(atoken);
cfgptr->num_cfgP++; cfgptr->num_cfgP++;
} }
atoken = strtok_r(NULL,":",&strtokctx); atoken = strtok_r(NULL,":",&strtokctx);
} }
printf("[CONFIG] get parameters from %s ",cfgmode); printf("[CONFIG] get parameters from %s ",cfgmode);
for (i=0;i<cfgptr->num_cfgP; i++) {
for (i=0; i<cfgptr->num_cfgP; i++) {
printf("%s ",cfgptr->cfgP[i]); printf("%s ",cfgptr->cfgP[i]);
} }
printf(", debug flags: 0x%08x\n",cfgptr->rtflags); printf(", debug flags: 0x%08x\n",cfgptr->rtflags);
if (strstr(cfgparam,CONFIG_CMDLINEONLY) == NULL) { if (strstr(cfgparam,CONFIG_CMDLINEONLY) == NULL) {
i=load_config_sharedlib(cfgptr); i=load_config_sharedlib(cfgptr);
if (i == 0) { if (i == 0) {
printf("[CONFIG] config module %s loaded\n",cfgmode); printf("[CONFIG] config module %s loaded\n",cfgmode);
Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags); Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags);
...@@ -270,22 +299,22 @@ int i; ...@@ -270,22 +299,22 @@ int i;
cfgptr->end = (configmodule_endfunc_t)nooptfunc; cfgptr->end = (configmodule_endfunc_t)nooptfunc;
} }
if (modeparams != NULL) free(modeparams); if (modeparams != NULL) free(modeparams);
if (cfgmode != NULL) free(cfgmode); if (cfgmode != NULL) free(cfgmode);
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) { if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params)); config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
// exit(-1); // exit(-1);
} }
return cfgptr; return cfgptr;
} }
/* free memory allocated when reading parameters */ /* free memory allocated when reading parameters */
/* config module could be initialized again after this call */ /* config module could be initialized again after this call */
void end_configmodule(void) void end_configmodule(void) {
{
if (cfgptr != NULL) { if (cfgptr != NULL) {
if (cfgptr->end != NULL) { if (cfgptr->end != NULL) {
printf ("[CONFIG] calling config module end function...\n"); printf ("[CONFIG] calling config module end function...\n");
...@@ -293,29 +322,32 @@ void end_configmodule(void) ...@@ -293,29 +322,32 @@ void end_configmodule(void)
} }
printf ("[CONFIG] free %u config value pointers\n",cfgptr->numptrs); printf ("[CONFIG] free %u config value pointers\n",cfgptr->numptrs);
for(int i=0; i<cfgptr->numptrs ; i++) { for(int i=0; i<cfgptr->numptrs ; i++) {
if (cfgptr->ptrs[i] != NULL) { if (cfgptr->ptrs[i] != NULL) {
free(cfgptr->ptrs[i]); free(cfgptr->ptrs[i]);
cfgptr->ptrs[i]=NULL; cfgptr->ptrs[i]=NULL;
} }
} }
cfgptr->numptrs=0; cfgptr->numptrs=0;
} }
} }
/* free all memory used by config module */ /* free all memory used by config module */
/* should be called only at program exit */ /* should be called only at program exit */
void free_configmodule(void) void free_configmodule(void) {
{
if (cfgptr != NULL) { if (cfgptr != NULL) {
end_configmodule(); end_configmodule();
if( cfgptr->cfgmode != NULL) free(cfgptr->cfgmode); if( cfgptr->cfgmode != NULL) free(cfgptr->cfgmode);
printf ("[CONFIG] free %u config parameter pointers\n",cfgptr->num_cfgP); printf ("[CONFIG] free %u config parameter pointers\n",cfgptr->num_cfgP);
for (int i=0; i<cfgptr->num_cfgP; i++) { for (int i=0; i<cfgptr->num_cfgP; i++) {
if ( cfgptr->cfgP[i] != NULL) free(cfgptr->cfgP[i]); if ( cfgptr->cfgP[i] != NULL) free(cfgptr->cfgP[i]);
} }
free(cfgptr); free(cfgptr);
cfgptr=NULL; cfgptr=NULL;
} }
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "common/config/config_paramdesc.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_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 #define CONFIG_MAX_ALLOCATEDPTRS 1024 // maximum number of parameters that can be dynamicaly allocated in the config module
...@@ -44,12 +45,14 @@ ...@@ -44,12 +45,14 @@
#define CONFIG_LIBCONFIGFILE "libconfig" // use libconfig file #define CONFIG_LIBCONFIGFILE "libconfig" // use libconfig file
#define CONFIG_CMDLINEONLY "cmdline" // use only command line options #define CONFIG_CMDLINEONLY "cmdline" // use only command line options
#define DEFAULT_CFGFILENAME "oai.conf" // default config file #define DEFAULT_CFGFILENAME "oai.conf" // default config file
/* bit position definition for the argv_info mask of the configmodule_interface_t structure */
/* rtflags bit position definitions */ #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_PRINTPARAMS 1 // print parameters values while processing
#define CONFIG_DEBUGPTR (1<<1) // print memory allocation/free debug messages #define CONFIG_DEBUGPTR (1<<1) // print memory allocation/free debug messages
#define CONFIG_DEBUGCMDLINE (1<<2) // print command line processing 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_NOEXITONHELP (1<<19) // do not exit after printing help
#define CONFIG_HELP (1<<20) // print help message #define CONFIG_HELP (1<<20) // print help message
#define CONFIG_ABORT (1<<21) // config failed,abort execution #define CONFIG_ABORT (1<<21) // config failed,abort execution
...@@ -58,10 +61,10 @@ typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP); ...@@ -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_getfunc_t)(paramdef_t *,int numparams, char *prefix);
typedef int(*configmodule_getlistfunc_t)(paramlist_def_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 void(*configmodule_endfunc_t)(void);
typedef struct configmodule_interface typedef struct configmodule_interface {
{
int argc; int argc;
char **argv; char **argv;
uint32_t *argv_info;
char *cfgmode; char *cfgmode;
int num_cfgP; int num_cfgP;
char *cfgP[CONFIG_MAX_OOPT_PARAMS]; char *cfgP[CONFIG_MAX_OOPT_PARAMS];
...@@ -87,11 +90,11 @@ static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugfl ...@@ -87,11 +90,11 @@ static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugfl
static paramdef_t Config_Params[] = { static paramdef_t Config_Params[] = {
/*-----------------------------------------------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------------------------------------------*/
/* config parameters for config module */ /* config parameters for config module */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------------------------------------------*/
{"debugflags", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0}, {"debugflags", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0},
}; };
#else #else
...@@ -103,7 +106,8 @@ extern configmodule_interface_t *cfgptr; ...@@ -103,7 +106,8 @@ extern configmodule_interface_t *cfgptr;
#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__ ); } #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); extern void end_configmodule(void);
#endif /* INCLUDE_CONFIG_LOADCONFIGMODULE_H */ #endif /* INCLUDE_CONFIG_LOADCONFIGMODULE_H */
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#define MAX_OPTNAME_SIZE 64 #define MAX_OPTNAME_SIZE 64
#define CONFIG_MAXOPTLENGTH 512 /* max full option length, full option name exemple: (prefix1.[<index>].prefix2.optname */
/* parameter flags definitions */ /* parameter flags definitions */
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
#define PARAMFLAG_PARAMSET (1 << 16) // parameter has been explicitely set in get functions #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 #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 */ /* checkedparam_t is possibly used in paramdef_t for specific parameter value validation */
#define CONFIG_MAX_NUMCHECKVAL 20 #define CONFIG_MAX_NUMCHECKVAL 20
typedef struct paramdef paramdef_t; typedef struct paramdef paramdef_t;
...@@ -100,8 +99,7 @@ typedef union checkedparam { ...@@ -100,8 +99,7 @@ typedef union checkedparam {
/* paramdef is used to describe a parameter, array of paramdef_t strustures is used as the main parameter in */ /* 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 */ /* config apis used to retrieve parameters values */
typedef struct paramdef typedef struct paramdef {
{
char optname[MAX_OPTNAME_SIZE]; /* parameter name, can be used as long command line option */ char optname[MAX_OPTNAME_SIZE]; /* parameter name, can be used as long command line option */
char *helpstr; /* help string */ char *helpstr; /* help string */
unsigned int paramflags; /* value is a "ored" combination of above PARAMFLAG_XXXX values */ unsigned int paramflags; /* value is a "ored" combination of above PARAMFLAG_XXXX values */
......
This diff is collapsed.
...@@ -48,14 +48,16 @@ extern "C" ...@@ -48,14 +48,16 @@ extern "C"
#define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F)) #define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F))
/* utility functions, to be used by configuration module and/or configuration libraries */ /* utility functions, to be used by configuration module and/or configuration libraries */
extern configmodule_interface_t *config_get_if(void); 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 void config_printhelp(paramdef_t *,int numparams);
extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix); 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_processedint(paramdef_t *cfgoption, int val);
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val); extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
extern int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr); 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_get(paramdef_t *params,int numparams, char *prefix);
extern int config_getlist(paramlist_def_t *ParamList, 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 The loader objectives are
1. Allow easy parameters management in oai, helping the development of a flexible, modularized and fully configurable softmodem. 1. provides a common mechanism to prevent an executable to include code that is only used under specific configurations, without rebuilding the code
1. Use a common configuration API in all oai modules 1. Provide a common mechanism to allow to choose between different implementations of a given set of functions, without rebuilding the code
1. Allow development of alternative configuration sources without modifying the oai code. Today the only delivered configuration source is the libconfig format configuration file.
As a developer you may need to look at these sections: 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.
...@@ -45,11 +45,11 @@ ...@@ -45,11 +45,11 @@
#include <time.h> #include <time.h>
#include <stdint.h> #include <stdint.h>
#ifndef __STDC_FORMAT_MACROS #ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
#endif #endif
#include <inttypes.h> #include <inttypes.h>
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif
#include <pthread.h> #include <pthread.h>
#include "T.h" #include "T.h"
...@@ -118,9 +118,8 @@ extern "C" { ...@@ -118,9 +118,8 @@ extern "C" {
#define FLAG_NOCOLOR 0x0001 /*!< \brief use colors in log messages, depending on level */ #define FLAG_NOCOLOR 0x0001 /*!< \brief use colors in log messages, depending on level */
#define FLAG_THREAD 0x0008 /*!< \brief display thread name in log messages */ #define FLAG_THREAD 0x0008 /*!< \brief display thread name in log messages */
#define FLAG_LEVEL 0x0010 /*!< \brief display log level in log messages */ #define FLAG_LEVEL 0x0010 /*!< \brief display log level in log messages */
#define FLAG_FUNCT 0x0020
#define FLAG_FILE_LINE 0x0040
#define FLAG_TIME 0x0100 #define FLAG_TIME 0x0100
#define FLAG_INITIALIZED 0x8000
#define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O) #define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O)
#define CLEAR_LOG_OPTION(O) g_log->flag = (g_log->flag & (~O)) #define CLEAR_LOG_OPTION(O) g_log->flag = (g_log->flag & (~O))
...@@ -165,7 +164,7 @@ extern "C" { ...@@ -165,7 +164,7 @@ extern "C" {
{"NAS", DEBUG_NAS},\ {"NAS", DEBUG_NAS},\
{"UE_TIMING", UE_TIMING},\ {"UE_TIMING", UE_TIMING},\
{NULL,-1}\ {NULL,-1}\
} }
...@@ -251,7 +250,7 @@ typedef struct { ...@@ -251,7 +250,7 @@ typedef struct {
log_component_t log_component[MAX_LOG_COMPONENTS]; log_component_t log_component[MAX_LOG_COMPONENTS];
char level2string[NUM_LOG_LEVEL]; char level2string[NUM_LOG_LEVEL];
int flag; int flag;
char* filelog_name; char *filelog_name;
uint64_t debug_mask; uint64_t debug_mask;
uint64_t dump_mask; uint64_t dump_mask;
} log_t; } log_t;
...@@ -272,9 +271,9 @@ void log_set_instance_type (log_instance_type_t instance); ...@@ -272,9 +271,9 @@ void log_set_instance_type (log_instance_type_t instance);
log_t *g_log; log_t *g_log;
#else #else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
extern log_t *g_log; extern log_t *g_log;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
...@@ -283,8 +282,9 @@ extern log_t *g_log; ...@@ -283,8 +282,9 @@ extern log_t *g_log;
# include "log_if.h" # include "log_if.h"
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
int logInit (void); int logInit (void);
int isLogInitDone (void);
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7))); void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
void log_dump(int component, void *buffer, int buffsize,int datatype, const char* format, ... ); void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... );
int set_log(int component, int level); int set_log(int component, int level);
void set_glog(int level); void set_glog(int level);
...@@ -339,10 +339,10 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -339,10 +339,10 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
/* optname help paramflags XXXptr defXXXval type numelt */ /* optname help paramflags XXXptr defXXXval type numelt */
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define LOG_GLOBALPARAMS_DESC { \ #define LOG_GLOBALPARAMS_DESC { \
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \ {LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \ {LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0} \ {LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0} \
} }
#define LOG_OPTIONS_IDX 2 #define LOG_OPTIONS_IDX 2
/*----------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------*/
...@@ -355,22 +355,22 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -355,22 +355,22 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
// debugging macros // debugging macros
#define LOG_F LOG_I /* because LOG_F was originaly to dump a message or buffer but is also used as a regular level...., to dump use LOG_DUMPMSG */ #define LOG_F LOG_I /* because LOG_F was originaly to dump a message or buffer but is also used as a regular level...., to dump use LOG_DUMPMSG */
# if T_TRACER # if T_TRACER
/* per component, level dependant macros */ /* per component, level dependant macros */
# define LOG_E(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0) # define LOG_E(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0)
# define LOG_W(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0) # define LOG_W(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0)
# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) # define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0) # define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0) # define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
/* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */ /* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */
# define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */ # define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
# define nfapi_log(FILE, FNC, LN, COMP, LVL, F...) do { if (T_stdout) { logRecord_mt(__FILE__, __FUNCTION__, __LINE__,COMP, LVL, F) ;}} while (0) /* */ # define nfapi_log(FILE, FNC, LN, COMP, LVL, F...) do { if (T_stdout) { logRecord_mt(__FILE__, __FUNCTION__, __LINE__,COMP, LVL, F) ;}} while (0) /* */
/* bitmask dependant macros, to isolate debugging code */ /* bitmask dependant macros, to isolate debugging code */
# define LOG_DEBUGFLAG(D) (g_log->debug_mask & D) # define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
/* bitmask dependant macros, to generate debug file such as matlab file or message dump */ /* bitmask dependant macros, to generate debug file such as matlab file or message dump */
# define LOG_DUMPFLAG(D) (g_log->dump_mask & D) # define LOG_DUMPFLAG(D) (g_log->dump_mask & D)
# define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)/* */ # define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)/* */
/* define variable only used in LOG macro's */ /* define variable only used in LOG macro's */
# define LOG_VAR(A,B) A B # define LOG_VAR(A,B) A B
# else /* T_TRACER: remove all debugging and tracing messages, except errors */ # else /* T_TRACER: remove all debugging and tracing messages, except errors */
# define LOG_I(c, x...) /* */ # define LOG_I(c, x...) /* */
...@@ -420,7 +420,7 @@ static __inline__ uint64_t rdtsc(void) { ...@@ -420,7 +420,7 @@ static __inline__ uint64_t rdtsc(void) {
extern double cpuf; extern double cpuf;
static inline uint64_t checkTCPU(int timeout, char * file, int line) { static inline uint64_t checkTCPU(int timeout, char *file, int line) {
static uint64_t __thread lastCPUTime=0; static uint64_t __thread lastCPUTime=0;
static uint64_t __thread last=0; static uint64_t __thread last=0;
uint64_t cur=rdtsc(); uint64_t cur=rdtsc();
...@@ -429,25 +429,29 @@ static inline uint64_t checkTCPU(int timeout, char * file, int line) { ...@@ -429,25 +429,29 @@ static inline uint64_t checkTCPU(int timeout, char * file, int line) {
uint64_t CPUTime=CPUt.tv_sec*1000*1000+CPUt.tv_nsec/1000; uint64_t CPUTime=CPUt.tv_sec*1000*1000+CPUt.tv_nsec/1000;
double microCycles=(double)(cpuf*1000); double microCycles=(double)(cpuf*1000);
int duration=(int)((cur-last)/microCycles); int duration=(int)((cur-last)/microCycles);
if ( last!=0 && duration > timeout ) { if ( last!=0 && duration > timeout ) {
//struct timespec ts; //struct timespec ts;
//clock_gettime(CLOCK_MONOTONIC, &ts); //clock_gettime(CLOCK_MONOTONIC, &ts);
printf("%s:%d lte-ue delay %d (exceed %d), CPU for this period: %lld\n", file, line, printf("%s:%d lte-ue delay %d (exceed %d), CPU for this period: %lld\n", file, line,
duration, timeout, (long long)CPUTime-lastCPUTime ); duration, timeout, (long long)CPUTime-lastCPUTime );
} }
last=cur; last=cur;
lastCPUTime=CPUTime; lastCPUTime=CPUTime;
return cur; return cur;
} }
static inline unsigned long long checkT(int timeout, char * file, int line) { static inline unsigned long long checkT(int timeout, char *file, int line) {
static unsigned long long __thread last=0; static unsigned long long __thread last=0;
unsigned long long cur=rdtsc(); unsigned long long cur=rdtsc();
int microCycles=(int)(cpuf*1000); int microCycles=(int)(cpuf*1000);
int duration=(int)((cur-last)/microCycles); int duration=(int)((cur-last)/microCycles);
if ( last!=0 && duration > timeout ) if ( last!=0 && duration > timeout )
printf("%s:%d lte-ue delay %d (exceed %d)\n", file, line, printf("%s:%d lte-ue delay %d (exceed %d)\n", file, line,
duration, timeout); duration, timeout);
last=cur; last=cur;
return cur; return cur;
} }
...@@ -458,7 +462,7 @@ typedef struct m { ...@@ -458,7 +462,7 @@ typedef struct m {
uint64_t maxArray[11]; uint64_t maxArray[11];
} Meas; } Meas;
static inline void printMeas(char * txt, Meas *M, int period) { static inline void printMeas(char *txt, Meas *M, int period) {
if (M->iterations%period == 0 ) { if (M->iterations%period == 0 ) {
char txt2[512]; char txt2[512];
sprintf(txt2,"%s avg=%" PRIu64 " iterations=%" PRIu64 " max=%" sprintf(txt2,"%s avg=%" PRIu64 " iterations=%" PRIu64 " max=%"
...@@ -476,13 +480,13 @@ static inline void printMeas(char * txt, Meas *M, int period) { ...@@ -476,13 +480,13 @@ static inline void printMeas(char * txt, Meas *M, int period) {
} }
} }
static inline int cmpint(const void* a, const void* b) { static inline int cmpint(const void *a, const void *b) {
uint64_t* aa=(uint64_t*)a; uint64_t *aa=(uint64_t *)a;
uint64_t* bb=(uint64_t*)b; uint64_t *bb=(uint64_t *)b;
return (int)(*aa-*bb); return (int)(*aa-*bb);
} }
static inline void updateTimes(uint64_t start, Meas *M, int period, char * txt) { static inline void updateTimes(uint64_t start, Meas *M, int period, char *txt) {
if (start!=0) { if (start!=0) {
uint64_t end=rdtsc(); uint64_t end=rdtsc();
long long diff=(end-start)/(cpuf*1000); long long diff=(end-start)/(cpuf*1000);
......
...@@ -8,27 +8,35 @@ char **unique_ids; ...@@ -8,27 +8,35 @@ char **unique_ids;
int unique_ids_size; int unique_ids_size;
int unique_ids_maxsize; int unique_ids_maxsize;
int cmp(const void *p1, const void *p2) int cmp(const void *p1, const void *p2) {
{ return strcmp(*(char *const *)p1, *(char *const *)p2);
return strcmp(*(char * const *)p1, *(char * const *)p2);
} }
/* return 1 if s was not already known, 0 if it was */ /* return 1 if s was not already known, 0 if it was */
int new_unique_id(char *s, char *input_file) int new_unique_id(char *s, char *input_file) {
{
if (unique_ids_size) if (unique_ids_size)
if (bsearch(&s, unique_ids, unique_ids_size, sizeof(char *), cmp) != NULL) { if (bsearch(&s, unique_ids, unique_ids_size, sizeof(char *), cmp) != NULL) {
printf("error: ID %s is not unique in %s\n", s, input_file); printf("error: ID %s is not unique in %s\n", s, input_file);
return 0; return 0;
} }
if (unique_ids_size == unique_ids_maxsize) { if (unique_ids_size == unique_ids_maxsize) {
unique_ids_maxsize += 256; unique_ids_maxsize += 256;
unique_ids = realloc(unique_ids, unique_ids_maxsize * sizeof(char *)); unique_ids = realloc(unique_ids, unique_ids_maxsize * sizeof(char *));
if (unique_ids == NULL) { printf("erorr: out of memory\n"); abort(); }
if (unique_ids == NULL) {
printf("error: out of memory\n");
abort();
} }
}
unique_ids[unique_ids_size] = strdup(s); unique_ids[unique_ids_size] = strdup(s);
if (unique_ids[unique_ids_size] == NULL)
{ printf("erorr: out of memory\n"); abort(); } if (unique_ids[unique_ids_size] == NULL) {
printf("error: out of memory\n");
abort();
}
unique_ids_size++; unique_ids_size++;
qsort(unique_ids, unique_ids_size, sizeof(char *), cmp); qsort(unique_ids, unique_ids_size, sizeof(char *), cmp);
return 1; return 1;
...@@ -38,14 +46,17 @@ char *bufname; ...@@ -38,14 +46,17 @@ char *bufname;
int bufname_size; int bufname_size;
int bufname_maxsize; int bufname_maxsize;
void putname(int c) void putname(int c) {
{
if (bufname_size == bufname_maxsize) { if (bufname_size == bufname_maxsize) {
bufname_maxsize += 256; bufname_maxsize += 256;
bufname = realloc(bufname, bufname_maxsize); bufname = realloc(bufname, bufname_maxsize);
if (bufname == NULL)
{ printf("erorr: memory allocation error\n"); exit(1); } if (bufname == NULL) {
printf("error: memory allocation error\n");
exit(1);
}
} }
bufname[bufname_size] = c; bufname[bufname_size] = c;
bufname_size++; bufname_size++;
} }
...@@ -54,42 +65,54 @@ char *bufvalue; ...@@ -54,42 +65,54 @@ char *bufvalue;
int bufvalue_size; int bufvalue_size;
int bufvalue_maxsize; int bufvalue_maxsize;
void putvalue(int c) void putvalue(int c) {
{
if (bufvalue_size == bufvalue_maxsize) { if (bufvalue_size == bufvalue_maxsize) {
bufvalue_maxsize += 256; bufvalue_maxsize += 256;
bufvalue = realloc(bufvalue, bufvalue_maxsize); bufvalue = realloc(bufvalue, bufvalue_maxsize);
if (bufvalue == NULL)
{ printf("error: memory allocation error\n"); exit(1); } if (bufvalue == NULL) {
printf("error: memory allocation error\n");
exit(1);
}
} }
bufvalue[bufvalue_size] = c; bufvalue[bufvalue_size] = c;
bufvalue_size++; bufvalue_size++;
} }
void smash_spaces(FILE *f) void smash_spaces(FILE *f) {
{
int c; int c;
while (1) { while (1) {
c = fgetc(f); c = fgetc(f);
if (isspace(c)) continue; if (isspace(c)) continue;
if (c == ' ') continue; if (c == ' ') continue;
if (c == '\t') continue; if (c == '\t') continue;
if (c == '\n') continue; if (c == '\n') continue;
if (c == 10 || c == 13) continue; if (c == 10 || c == 13) continue;
if (c == '#') { if (c == '#') {
while (1) { while (1) {
c = fgetc(f); c = fgetc(f);
if (c == '\n' || c == EOF) break; if (c == '\n' || c == EOF) break;
} }
continue; continue;
} }
break; break;
} }
if (c != EOF) ungetc(c, f); if (c != EOF) ungetc(c, f);
} }
void get_line(FILE *f, char **name, char **value) void get_line(FILE *f, char **name, char **value) {
{
int c; int c;
bufname_size = 0; bufname_size = 0;
bufvalue_size = 0; bufvalue_size = 0;
...@@ -97,23 +120,39 @@ void get_line(FILE *f, char **name, char **value) ...@@ -97,23 +120,39 @@ void get_line(FILE *f, char **name, char **value)
*value = NULL; *value = NULL;
smash_spaces(f); smash_spaces(f);
c = fgetc(f); c = fgetc(f);
while (!(c == '=' || isspace(c) || c == EOF)) { putname(c); c = fgetc(f); }
while (!(c == '=' || isspace(c) || c == EOF)) {
putname(c);
c = fgetc(f);
}
if (c == EOF) return; if (c == EOF) return;
putname(0); putname(0);
while (!(c == EOF || c == '=')) c = fgetc(f); while (!(c == EOF || c == '=')) c = fgetc(f);
if (c == EOF) return; if (c == EOF) return;
smash_spaces(f); smash_spaces(f);
c = fgetc(f); c = fgetc(f);
while (!(c == 10 || c == 13 || c == EOF)) { putvalue(c); c = fgetc(f); }
while (!(c == 10 || c == 13 || c == EOF)) {
putvalue(c);
c = fgetc(f);
}
putvalue(0); putvalue(0);
if (bufname_size <= 1) return; if (bufname_size <= 1) return;
if (bufvalue_size <= 1) return; if (bufvalue_size <= 1) return;
*name = bufname; *name = bufname;
*value = bufvalue; *value = bufvalue;
} }
int main(int n, char **v) int main(int n, char **v) {
{
FILE *in; FILE *in;
FILE *out; FILE *out;
char *name; char *name;
...@@ -121,36 +160,54 @@ int main(int n, char **v) ...@@ -121,36 +160,54 @@ int main(int n, char **v)
char *in_name; char *in_name;
char *out_name; char *out_name;
if (n != 3) { printf("error: gimme <source> <dest>\n"); exit(1); } if (n != 3) {
printf("error: gimme <source> <dest>\n");
exit(1);
}
n = 0; n = 0;
in_name = v[1]; in_name = v[1];
out_name = v[2]; out_name = v[2];
in = fopen(in_name, "r");
if (in == NULL) {
perror(in_name);
exit(1);
}
in = fopen(in_name, "r"); if (in == NULL) { perror(in_name); exit(1); } out = fopen(out_name, "w");
out = fopen(out_name, "w"); if (out == NULL) { perror(out_name); exit(1); }
if (out == NULL) {
perror(out_name);
exit(1);
}
fprintf(out, "/* generated file, do not edit by hand */\n\n"); fprintf(out, "/* generated file, do not edit by hand */\n\n");
while (1) { while (1) {
get_line(in, &name, &value); get_line(in, &name, &value);
if (name == NULL) break; if (name == NULL) break;
if (isspace(value[strlen(value)-1])) { if (isspace(value[strlen(value)-1])) {
printf("error: bad value '%s' (no space at the end please!)\n", value); printf("error: bad value '%s' (no space at the end please!)\n", value);
unlink(out_name); unlink(out_name);
exit(1); exit(1);
} }
if (!strcmp(name, "ID")) { if (!strcmp(name, "ID")) {
if (!new_unique_id(value, in_name)) { unlink(out_name); exit(1); } if (!new_unique_id(value, in_name)) {
unlink(out_name);
exit(1);
}
fprintf(out, "#define T_%s T_ID(%d)\n", value, n); fprintf(out, "#define T_%s T_ID(%d)\n", value, n);
n++; n++;
} }
} }
fprintf(out, "#define T_NUMBER_OF_IDS %d\n", n);
fprintf(out, "#define T_NUMBER_OF_IDS %d\n", n);
fclose(in); fclose(in);
fclose(out); fclose(out);
return 0; return 0;
} }
This diff is collapsed.
...@@ -93,3 +93,4 @@ Connection closed by foreign host. ...@@ -93,3 +93,4 @@ Connection closed by foreign host.
[oai telnetserver home](telnetsrv.md) [oai telnetserver home](telnetsrv.md)
[oai telnetserver usage home](telnetusage.md) [oai telnetserver usage home](telnetusage.md)
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
\ No newline at end of file
...@@ -196,14 +196,12 @@ void oai_create_enb(void) { ...@@ -196,14 +196,12 @@ void oai_create_enb(void) {
int bodge_counter=0; int bodge_counter=0;
PHY_VARS_eNB *eNB = RC.eNB[0][0]; PHY_VARS_eNB *eNB = RC.eNB[0][0];
printf("[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d nb_CC[0]:%d abstraction_flag:%d single_thread_flag:%d td:%p te:%p if_inst:%p\n", eNB->Mod_id, eNB->CC_id, RC.nb_CC[0], eNB->abstraction_flag, eNB->single_thread_flag, eNB->td, eNB->te, eNB->if_inst); printf("[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d nb_CC[0]:%d abstraction_flag:%d single_thread_flag:%d if_inst:%p\n", eNB->Mod_id, eNB->CC_id, RC.nb_CC[0], eNB->abstraction_flag, eNB->single_thread_flag, eNB->if_inst);
eNB->Mod_id = bodge_counter; eNB->Mod_id = bodge_counter;
eNB->CC_id = bodge_counter; eNB->CC_id = bodge_counter;
eNB->abstraction_flag = 0; eNB->abstraction_flag = 0;
eNB->single_thread_flag = 0;//single_thread_flag; eNB->single_thread_flag = 0;//single_thread_flag;
eNB->td = ulsch_decoding_data_all;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
eNB->te = dlsch_encoding_all;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
RC.nb_CC[bodge_counter] = 1; RC.nb_CC[bodge_counter] = 1;
......
...@@ -59,14 +59,11 @@ void generate_qpsk_table(void) { ...@@ -59,14 +59,11 @@ void generate_qpsk_table(void) {
} }
} }
void init_7_5KHz(void);
void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) { void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) {
ccodelte_init(); ccodelte_init();
ccodelte_init_inv(); ccodelte_init_inv();
init_dfts();
phy_generate_viterbi_tables_lte(); phy_generate_viterbi_tables_lte();
load_codinglib(); load_codinglib();
lte_sync_time_init(frame_parms);
generate_ul_ref_sigs(); generate_ul_ref_sigs();
generate_ul_ref_sigs_rx(); generate_ul_ref_sigs_rx();
generate_64qam_table(); generate_64qam_table();
...@@ -76,13 +73,11 @@ void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) { ...@@ -76,13 +73,11 @@ void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) {
init_unscrambling_lut(); init_unscrambling_lut();
init_scrambling_lut(); init_scrambling_lut();
//set_taus_seed(1328); //set_taus_seed(1328);
// init_7_5KHz();
init_sss(); init_sss();
} }
void free_lte_top(void) { void free_lte_top(void) {
free_codinglib(); free_codinglib();
lte_sync_time_free();
/* free_ul_ref_sigs() is called in phy_free_lte_eNB() */ /* free_ul_ref_sigs() is called in phy_free_lte_eNB() */
} }
......
...@@ -67,6 +67,7 @@ int phy_init_RU(RU_t *ru) { ...@@ -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 if (ru->function != NGFI_RRU_IF5) { // we need to do RX/TX RU processing
init_dfts();
init_7_5KHz(); init_7_5KHz();
LOG_I(PHY,"nb_tx %d\n",ru->nb_tx); LOG_I(PHY,"nb_tx %d\n",ru->nb_tx);
ru->common.rxdata_7_5kHz = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) ); ru->common.rxdata_7_5kHz = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#include "assertions.h" #include "assertions.h"
#include <math.h> #include <math.h>
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
#include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/LTE_REFSIG/lte_refsig.h"
...@@ -661,8 +662,9 @@ int init_lte_ue_signal(PHY_VARS_UE *ue, ...@@ -661,8 +662,9 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
init_dfts();
init_frame_parms(&ue->frame_parms,1); init_frame_parms(&ue->frame_parms,1);
lte_sync_time_init(&ue->frame_parms);
init_lte_top(&ue->frame_parms); init_lte_top(&ue->frame_parms);
init_7_5KHz(); init_7_5KHz();
init_ul_hopping(&ue->frame_parms); init_ul_hopping(&ue->frame_parms);
......
...@@ -1505,7 +1505,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, ...@@ -1505,7 +1505,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
// Do ULSCH Decoding for data portion // Do ULSCH Decoding for data portion
ret = eNB->td(eNB,UE_id,harq_pid,llr8_flag); ret = ulsch_decoding_data_all(eNB,UE_id,harq_pid,llr8_flag);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,0);
......
...@@ -1298,7 +1298,7 @@ void dlsch_channel_compensation(int **rxdataF_ext, ...@@ -1298,7 +1298,7 @@ void dlsch_channel_compensation(int **rxdataF_ext,
unsigned short rb; unsigned short rb;
unsigned char aatx,aarx,symbol_mod,pilots=0; unsigned char aatx,aarx,symbol_mod,pilots=0;
__m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128; __m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128;
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
...@@ -1311,9 +1311,9 @@ void dlsch_channel_compensation(int **rxdataF_ext, ...@@ -1311,9 +1311,9 @@ void dlsch_channel_compensation(int **rxdataF_ext,
} }
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) { for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
__m128i QAM_amp128b = _mm_setzero_si128();
if (mod_order == 4) { if (mod_order == 4) {
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10) QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
QAM_amp128b = _mm_setzero_si128();
} else if (mod_order == 6) { } else if (mod_order == 6) {
QAM_amp128 = _mm_set1_epi16(QAM64_n1); // QAM_amp128 = _mm_set1_epi16(QAM64_n1); //
QAM_amp128b = _mm_set1_epi16(QAM64_n2); QAM_amp128b = _mm_set1_epi16(QAM64_n2);
...@@ -1766,11 +1766,11 @@ void dlsch_channel_compensation_core(int **rxdataF_ext, ...@@ -1766,11 +1766,11 @@ void dlsch_channel_compensation_core(int **rxdataF_ext,
int length_mod8 = 0; int length_mod8 = 0;
int length2; int length2;
__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b, *dl_ch128_2, *rxdataF128,*rxdataF_comp128,*rho128; __m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b, *dl_ch128_2, *rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128;
int aatx = 0, aarx = 0; int aatx = 0, aarx = 0;
for (aatx=0; aatx<n_tx; aatx++) { for (aatx=0; aatx<n_tx; aatx++) {
__m128i QAM_amp128b;
if (mod_order == 4) { if (mod_order == 4) {
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10) QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
QAM_amp128b = _mm_setzero_si128(); QAM_amp128b = _mm_setzero_si128();
...@@ -2158,7 +2158,7 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext, ...@@ -2158,7 +2158,7 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
__m128i *dl_ch0_128,*dl_ch1_128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128; __m128i *dl_ch0_128,*dl_ch1_128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128;
unsigned char aarx=0,symbol_mod,pilots=0; unsigned char aarx=0,symbol_mod,pilots=0;
int precoded_signal_strength=0; int precoded_signal_strength=0;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128;
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
...@@ -2167,10 +2167,9 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext, ...@@ -2167,10 +2167,9 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
//printf("comp prec: symbol %d, pilots %d\n",symbol, pilots); //printf("comp prec: symbol %d, pilots %d\n",symbol, pilots);
__m128i QAM_amp128b = _mm_setzero_si128();
if (mod_order == 4) { if (mod_order == 4) {
QAM_amp128 = _mm_set1_epi16(QAM16_n1); QAM_amp128 = _mm_set1_epi16(QAM16_n1);
QAM_amp128b = _mm_setzero_si128();
} else if (mod_order == 6) { } else if (mod_order == 6) {
QAM_amp128 = _mm_set1_epi16(QAM64_n1); QAM_amp128 = _mm_set1_epi16(QAM64_n1);
QAM_amp128b = _mm_set1_epi16(QAM64_n2); QAM_amp128b = _mm_set1_epi16(QAM64_n2);
...@@ -2621,7 +2620,7 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -2621,7 +2620,7 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
int **rxdataF_comp0 = pdsch_vars->rxdataF_comp0; int **rxdataF_comp0 = pdsch_vars->rxdataF_comp0;
int **rxdataF_comp1 = pdsch_vars->rxdataF_comp1[harq_pid][round]; int **rxdataF_comp1 = pdsch_vars->rxdataF_comp1[harq_pid][round];
unsigned char *pmi_ext = pdsch_vars->pmi_ext; unsigned char *pmi_ext = pdsch_vars->pmi_ext;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp0_128,QAM_amp0_128b,QAM_amp1_128,QAM_amp1_128b; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp0_128,QAM_amp1_128;
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
...@@ -2632,17 +2631,17 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -2632,17 +2631,17 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
// printf("comp prec: symbol %d, pilots %d\n",symbol, pilots); // printf("comp prec: symbol %d, pilots %d\n",symbol, pilots);
__m128i QAM_amp0_128b = _mm_setzero_si128();
if (mod_order0 == 4) { if (mod_order0 == 4) {
QAM_amp0_128 = _mm_set1_epi16(QAM16_n1); QAM_amp0_128 = _mm_set1_epi16(QAM16_n1);
QAM_amp0_128b = _mm_setzero_si128();
} else if (mod_order0 == 6) { } else if (mod_order0 == 6) {
QAM_amp0_128 = _mm_set1_epi16(QAM64_n1); QAM_amp0_128 = _mm_set1_epi16(QAM64_n1);
QAM_amp0_128b = _mm_set1_epi16(QAM64_n2); QAM_amp0_128b = _mm_set1_epi16(QAM64_n2);
} }
__m128i QAM_amp1_128b = _mm_setzero_si128();
if (mod_order1 == 4) { if (mod_order1 == 4) {
QAM_amp1_128 = _mm_set1_epi16(QAM16_n1); QAM_amp1_128 = _mm_set1_epi16(QAM16_n1);
QAM_amp1_128b = _mm_setzero_si128();
} else if (mod_order1 == 6) { } else if (mod_order1 == 6) {
QAM_amp1_128 = _mm_set1_epi16(QAM64_n1); QAM_amp1_128 = _mm_set1_epi16(QAM64_n1);
QAM_amp1_128b = _mm_set1_epi16(QAM64_n2); QAM_amp1_128b = _mm_set1_epi16(QAM64_n2);
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
#include <math.h> #include <math.h>
#include "common_lib.h" #include "common_lib.h"
#include "msc.h" #include "msc.h"
#include <common/utils/LOG/log.h>
//#include <complex.h> //#include <complex.h>
...@@ -862,22 +863,60 @@ typedef enum { ...@@ -862,22 +863,60 @@ typedef enum {
RESYNCH=4 RESYNCH=4
} UE_MODE_t; } UE_MODE_t;
/// Threading Parameter #define FOREACH_PARALLEL(GEN) \
GEN(PARALLEL_SINGLE_THREAD) \
GEN(PARALLEL_RU_L1_SPLIT) \
GEN(PARALLEL_RU_L1_TRX_SPLIT)
#define GENERATE_ENUM(N) N,
#define GENERATE_ENUMTXT(N) {(char*)#N, N},
typedef enum { typedef enum {
PARALLEL_SINGLE_THREAD =0, FOREACH_PARALLEL(GENERATE_ENUM)
PARALLEL_RU_L1_SPLIT =1, } PARALLEL_CONF_t;
PARALLEL_RU_L1_TRX_SPLIT =2
}PARALLEL_CONF_t;
#define FOREACH_WORKER(GEN) GEN(WORKER_DISABLE) GEN(WORKER_ENABLE)
typedef enum { typedef enum {
WORKER_DISABLE =0, FOREACH_WORKER(GENERATE_ENUM)
WORKER_ENABLE =1
}WORKER_CONF_t; }WORKER_CONF_t;
typedef struct THREAD_STRUCT_s { typedef struct THREAD_STRUCT_s {
PARALLEL_CONF_t parallel_conf; PARALLEL_CONF_t parallel_conf;
WORKER_CONF_t worker_conf; WORKER_CONF_t worker_conf;
} THREAD_STRUCT; } THREAD_STRUCT;
extern THREAD_STRUCT thread_struct;
static inline void set_parallel_conf(char *parallel_conf) {
mapping config[]= {
FOREACH_PARALLEL(GENERATE_ENUMTXT)
{NULL,-1}
};
thread_struct.parallel_conf = (PARALLEL_CONF_t)map_str_to_int(config, parallel_conf);
if (thread_struct.parallel_conf == -1 ) {
LOG_E(ENB_APP,"Impossible value: %s\n", parallel_conf);
thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
}
}
static inline void set_worker_conf(char *worker_conf) {
mapping config[]={
FOREACH_WORKER(GENERATE_ENUMTXT)
{NULL, -1}
};
thread_struct.worker_conf = (WORKER_CONF_t)map_str_to_int(config, worker_conf);
if (thread_struct.worker_conf == -1 ) {
LOG_E(ENB_APP,"Impossible value: %s\n", worker_conf);
thread_struct.worker_conf = WORKER_DISABLE ;
}
}
static inline PARALLEL_CONF_t get_thread_parallel_conf(void) {
return thread_struct.parallel_conf;
}
static inline WORKER_CONF_t get_thread_worker_conf(void) {
return thread_struct.worker_conf;
}
typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t; typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t;
......
...@@ -904,8 +904,6 @@ typedef struct PHY_VARS_eNB_s { ...@@ -904,8 +904,6 @@ typedef struct PHY_VARS_eNB_s {
/// Ethernet parameters for fronthaul interface /// Ethernet parameters for fronthaul interface
eth_params_t eth_params; eth_params_t eth_params;
int rx_total_gain_dB; int rx_total_gain_dB;
int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag);
int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *);
int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_eNB_s *eNB); int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_eNB_s *eNB);
uint8_t local_flag; uint8_t local_flag;
LTE_DL_FRAME_PARMS frame_parms; LTE_DL_FRAME_PARMS frame_parms;
...@@ -1080,6 +1078,7 @@ typedef struct PHY_VARS_eNB_s { ...@@ -1080,6 +1078,7 @@ typedef struct PHY_VARS_eNB_s {
time_stats_t ofdm_mod_stats; time_stats_t ofdm_mod_stats;
time_stats_t dlsch_common_and_dci; time_stats_t dlsch_common_and_dci;
time_stats_t dlsch_ue_specific;
time_stats_t dlsch_encoding_stats; time_stats_t dlsch_encoding_stats;
time_stats_t dlsch_modulation_stats; time_stats_t dlsch_modulation_stats;
time_stats_t dlsch_scrambling_stats; time_stats_t dlsch_scrambling_stats;
......
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
#include "common/ran_context.h" #include "common/ran_context.h"
char* namepointer_chMag ; char *namepointer_chMag ;
char fmageren_name2[512]; char fmageren_name2[512];
char* namepointer_log2; char *namepointer_log2;
#include "PHY/LTE_REFSIG/primary_synch.h" #include "PHY/LTE_REFSIG/primary_synch.h"
...@@ -45,7 +45,7 @@ int16_t *primary_synch2_time; ...@@ -45,7 +45,7 @@ int16_t *primary_synch2_time;
PHY_VARS_UE ***PHY_vars_UE_g; PHY_VARS_UE ***PHY_vars_UE_g;
LTE_DL_FRAME_PARMS *lte_frame_parms_g; LTE_DL_FRAME_PARMS *lte_frame_parms_g;
#else #else
PHY_VARS_UE * PHY_vars_UE_g[MAX_UE][MAX_NUM_CCs]={NULL}; PHY_VARS_UE *PHY_vars_UE_g[MAX_UE][MAX_NUM_CCs]= {NULL};
#endif #endif
...@@ -62,10 +62,10 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"}; ...@@ -62,10 +62,10 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
#ifndef OPENAIR2 #ifndef OPENAIR2
unsigned char NB_eNB_INST=0; unsigned char NB_eNB_INST=0;
unsigned char NB_UE_INST=0; unsigned char NB_UE_INST=0;
unsigned char NB_RN_INST=0; unsigned char NB_RN_INST=0;
unsigned char NB_INST=0; unsigned char NB_INST=0;
#endif #endif
unsigned int ULSCH_max_consecutive_errors = 20; unsigned int ULSCH_max_consecutive_errors = 20;
...@@ -134,9 +134,9 @@ double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.1682 ...@@ -134,9 +134,9 @@ double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.1682
#ifdef OCP_FRAMEWORK #ifdef OCP_FRAMEWORK
#include <enums.h> #include <enums.h>
#else #else
char eNB_functions[6][20]={"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RAU_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5",}; char eNB_functions[6][20]= {"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RAU_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5",};
char eNB_timing[2][20]={"synch_to_ext_device","synch_to_other"}; char eNB_timing[2][20]= {"synch_to_ext_device","synch_to_other"};
char ru_if_types[MAX_RU_IF_TYPES][20]={"local RF","IF5 RRU","IF5 Mobipass","IF4p5 RRU","IF1pp RRU"}; char ru_if_types[MAX_RU_IF_TYPES][20]= {"local RF","IF5 RRU","IF5 Mobipass","IF4p5 RRU","IF1pp RRU"};
#endif #endif
/// lookup table for unscrambling in RX /// lookup table for unscrambling in RX
......
...@@ -400,7 +400,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, ...@@ -400,7 +400,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
start_meas(&eNB->dlsch_encoding_stats); start_meas(&eNB->dlsch_encoding_stats);
eNB->te(eNB, dlsch_encoding_all(eNB,
dlsch_harq->pdu, dlsch_harq->pdu,
dlsch_harq->pdsch_start, dlsch_harq->pdsch_start,
dlsch, dlsch,
...@@ -582,6 +582,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -582,6 +582,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
} }
if (do_meas==1) stop_meas(&eNB->dlsch_common_and_dci); if (do_meas==1) stop_meas(&eNB->dlsch_common_and_dci);
if (do_meas==1) start_meas(&eNB->dlsch_ue_specific);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0);
...@@ -649,6 +650,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -649,6 +650,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PHICH,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PHICH,0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+(eNB->CC_id),0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+(eNB->CC_id),0);
if (do_meas==1) stop_meas(&eNB->dlsch_ue_specific);
if (do_meas==1) stop_meas(&eNB->phy_proc_tx); if (do_meas==1) stop_meas(&eNB->phy_proc_tx);
} }
......
This diff is collapsed.
...@@ -49,38 +49,46 @@ void sumUpStatsSlot(time_stats_t *res, time_stats_t src[RX_NB_TH][2], int lastAc ...@@ -49,38 +49,46 @@ void sumUpStatsSlot(time_stats_t *res, time_stats_t src[RX_NB_TH][2], int lastAc
res->p_time=src[lastActive][last].p_time; res->p_time=src[lastActive][last].p_time;
} }
double squareRoot(time_stats_t *ptr) {
double timeBase=1/(1000*cpu_freq_GHz);
return sqrt((double)ptr->diff_square*pow(timeBase,2)/ptr->trials -
pow((double)ptr->diff/ptr->trials*timeBase,2));
}
void printDistribution(time_stats_t *ptr, varArray_t *sortedList, char *txt) {
double timeBase=1/(1000*cpu_freq_GHz);
printf("%-43s %6.2f us (%d trials)\n",
txt,
(double)ptr->diff/ptr->trials*timeBase,
ptr->trials);
printf(" Statistics std=%.2f, median=%.2f, q1=%.2f, q3=%.2f µs (on %ld trials)\n",
squareRoot(ptr), median(sortedList),q1(sortedList),q3(sortedList), sortedList->size);
}
void printStatIndent(time_stats_t *ptr, char *txt) { void printStatIndent(time_stats_t *ptr, char *txt) {
printf("|__ %-50s %.2f us (%d trials)\n", printf("|__ %-38s %6.2f us (%3d trials)\n",
txt, txt,
ptr->trials?inMicroS(ptr->diff/ptr->trials):0, ptr->trials?inMicroS(ptr->diff/ptr->trials):0,
ptr->trials); ptr->trials);
} }
void printStatIndent2(time_stats_t *ptr, char *txt, int turbo_iter) { void printStatIndent2(time_stats_t *ptr, char *txt) {
double timeBase=1/(1000*cpu_freq_GHz); double timeBase=1/(1000*cpu_freq_GHz);
printf(" |__ %-45s %.2f us (cycles/block %ld, %5d trials)\n", printf(" |__ %-34s %6.2f us (%3d trials)\n",
txt, txt,
ptr->trials?((double)ptr->diff)/ptr->trials*timeBase:0, ptr->trials?((double)ptr->diff)/ptr->trials*timeBase:0,
turbo_iter?(uint64_t)round(((double)ptr->diff)/turbo_iter):0,
ptr->trials); ptr->trials);
} }
double squareRoot(time_stats_t *ptr) { void printStatIndent3(time_stats_t *ptr, char *txt) {
double timeBase=1/(1000*cpu_freq_GHz);
return sqrt((double)ptr->diff_square*pow(timeBase,2)/ptr->trials -
pow((double)ptr->diff/ptr->trials*timeBase,2));
}
void printDistribution(time_stats_t *ptr, varArray_t *sortedList, char *txt) {
double timeBase=1/(1000*cpu_freq_GHz); double timeBase=1/(1000*cpu_freq_GHz);
printf("%-50s :%.2f us (%d trials)\n", printf(" |__ %-30s %6.2f us (%3d trials)\n",
txt, txt,
(double)ptr->diff/ptr->trials*timeBase, ptr->trials?((double)ptr->diff)/ptr->trials*timeBase:0,
ptr->trials); ptr->trials);
printf("|__ Statistics std=%.2f, median=%.2f, q1=%.2f, q3=%.2f µs (on %ld trials)\n",
squareRoot(ptr), median(sortedList),q1(sortedList),q3(sortedList), sortedList->size);
} }
void logDistribution(FILE* fd, time_stats_t *ptr, varArray_t *sortedList, int dropped) { void logDistribution(FILE* fd, time_stats_t *ptr, varArray_t *sortedList, int dropped) {
fprintf(fd,"%f;%f;%f;%f;%f;%f;%d;", fprintf(fd,"%f;%f;%f;%f;%f;%f;%d;",
squareRoot(ptr), squareRoot(ptr),
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -43,10 +43,14 @@ ...@@ -43,10 +43,14 @@
# include "s1ap_eNB.h" # include "s1ap_eNB.h"
# include "sctp_eNB_task.h" # include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h" # include "gtpv1u_eNB_task.h"
/* temporary warning removale while implementing noS1 */
/* as config option */
# else # else
# ifdef EPC_MODE_ENABLED
# undef EPC_MODE_ENABLED
# endif
# define EPC_MODE_ENABLED 0 # define EPC_MODE_ENABLED 0
# endif # endif
# include "x2ap_eNB.h" # include "x2ap_eNB.h"
# include "x2ap_messages_types.h" # include "x2ap_messages_types.h"
# define X2AP_ENB_REGISTER_RETRY_DELAY 10 # define X2AP_ENB_REGISTER_RETRY_DELAY 10
......
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.
...@@ -62,7 +62,6 @@ sim_t sim; ...@@ -62,7 +62,6 @@ sim_t sim;
void init_ru_devices(void); void init_ru_devices(void);
void init_RU(const char*);
void *rfsim_top(void *n_frames); void *rfsim_top(void *n_frames);
void wait_RUs(void) void wait_RUs(void)
......
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