mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-15 13:40:29 +00:00
Compare commits
132 Commits
csirs-sim
...
pre-commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3d9380131 | ||
|
|
38dc378224 | ||
|
|
93df326273 | ||
|
|
e5c54b5971 | ||
|
|
ff97f0dea6 | ||
|
|
1c512f3dc5 | ||
|
|
6f2d90fee9 | ||
|
|
aa5bd641fd | ||
|
|
463a3ad1cf | ||
|
|
288e0e1412 | ||
|
|
c1d0e836b4 | ||
|
|
dc550ebaf6 | ||
|
|
03096dd495 | ||
|
|
22783bb3a7 | ||
|
|
879e374d32 | ||
|
|
39d3477d84 | ||
|
|
f5989abd0d | ||
|
|
a5696562da | ||
|
|
2bb1f36a2c | ||
|
|
81b2fe634f | ||
|
|
cb4c307221 | ||
|
|
4a47fbbef7 | ||
|
|
2213235fc1 | ||
|
|
138e0f9547 | ||
|
|
25f77993ca | ||
|
|
cbe69c7dfa | ||
|
|
337abd5716 | ||
|
|
c0a2dc9006 | ||
|
|
a2f8f2ead3 | ||
|
|
c99e5642b5 | ||
|
|
0161568d69 | ||
|
|
1aed7b5802 | ||
|
|
e8e3f60e73 | ||
|
|
85b4057bde | ||
|
|
b15d394212 | ||
|
|
0b752116ee | ||
|
|
17a87cd858 | ||
|
|
7fc1d1835a | ||
|
|
3ff08f25ca | ||
|
|
a1b68b9f98 | ||
|
|
e0ef042fe6 | ||
|
|
34aad5d276 | ||
|
|
51e17fd7c8 | ||
|
|
449910dbc7 | ||
|
|
b81442de91 | ||
|
|
7e3406c3bd | ||
|
|
1be48251f0 | ||
|
|
05c2165535 | ||
|
|
8ecc693799 | ||
|
|
74fcab8779 | ||
|
|
45ae5f19e4 | ||
|
|
d694aa68eb | ||
|
|
99c0e6a149 | ||
|
|
a91741818b | ||
|
|
9fe14b784f | ||
|
|
d33466d632 | ||
|
|
90ec531554 | ||
|
|
82f9501424 | ||
|
|
d45a1e209b | ||
|
|
850f03d328 | ||
|
|
08085af943 | ||
|
|
4cda6ab959 | ||
|
|
a1ab732111 | ||
|
|
00c1976078 | ||
|
|
f414ae474c | ||
|
|
10516db5dd | ||
|
|
c866078b21 | ||
|
|
3e515d9c9c | ||
|
|
da7054092a | ||
|
|
4569ef199d | ||
|
|
6f9a716eb9 | ||
|
|
817d1a6cb5 | ||
|
|
c53b28f51d | ||
|
|
9afa94040d | ||
|
|
52d5705f47 | ||
|
|
e27f8c24cf | ||
|
|
7606a93f57 | ||
|
|
185690cb94 | ||
|
|
442b3045d6 | ||
|
|
196855364c | ||
|
|
afb3005a7c | ||
|
|
425ea41ba5 | ||
|
|
dc260bd4d9 | ||
|
|
5fcd456a46 | ||
|
|
8583689349 | ||
|
|
03350ab21b | ||
|
|
83ffa53ccc | ||
|
|
ec327d26fc | ||
|
|
90ff73798a | ||
|
|
1b9b65800e | ||
|
|
51d8441927 | ||
|
|
6d3a902135 | ||
|
|
cfa58f8dbb | ||
|
|
87402f4959 | ||
|
|
176521e6ec | ||
|
|
d93b0e13d2 | ||
|
|
ef67552e1f | ||
|
|
8d8ac73cb4 | ||
|
|
dfed62bd24 | ||
|
|
edd7611854 | ||
|
|
466c9b5eee | ||
|
|
447c0b211e | ||
|
|
d63dc3a321 | ||
|
|
900fa704ed | ||
|
|
be9fc79f77 | ||
|
|
57df1ede4b | ||
|
|
6684ead115 | ||
|
|
8dfb61827b | ||
|
|
f6693d41e3 | ||
|
|
1d42dfda66 | ||
|
|
b875f855c7 | ||
|
|
bad2ae874e | ||
|
|
da44a52092 | ||
|
|
f55e26a25e | ||
|
|
5d8e79521e | ||
|
|
14cceed229 | ||
|
|
6556c88694 | ||
|
|
2cb9dc6bcd | ||
|
|
10d386ef75 | ||
|
|
b10864c2e8 | ||
|
|
683d855d97 | ||
|
|
2483b68ee4 | ||
|
|
7732c30c1d | ||
|
|
7cf76f69bd | ||
|
|
f59d67e526 | ||
|
|
99bded7b87 | ||
|
|
0da39e702c | ||
|
|
6b5a8b691d | ||
|
|
008c6fa73c | ||
|
|
39fa6d81ec | ||
|
|
709c06f08e | ||
|
|
13d129768f |
@@ -709,14 +709,15 @@ target_link_libraries(SCHED_LIB PRIVATE asn1_lte_rrc_hdrs)
|
||||
set(SCHED_NR_SRC
|
||||
${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_gNB.c
|
||||
${OPENAIR1_DIR}/SCHED_NR/nr_prach_procedures.c
|
||||
${OPENAIR1_DIR}/SCHED_NR/nr_ru_procedures.c
|
||||
${OPENAIR1_DIR}/SCHED_NR/phy_frame_config_nr.c
|
||||
)
|
||||
add_library(SCHED_NR_LIB ${SCHED_NR_SRC})
|
||||
target_link_libraries(SCHED_NR_LIB PRIVATE asn1_nr_rrc_hdrs UTIL)
|
||||
target_link_libraries(SCHED_NR_LIB PRIVATE NFAPI_LIB) # some FAPI messages pack "subPDUs"
|
||||
|
||||
set(SCHED_SRC_RU
|
||||
${OPENAIR1_DIR}/SCHED/ru_procedures.c
|
||||
${OPENAIR1_DIR}/SCHED_NR/nr_ru_procedures.c
|
||||
${OPENAIR1_DIR}/SCHED/prach_procedures.c
|
||||
)
|
||||
add_library(SCHED_RU_LIB ${SCHED_SRC_RU})
|
||||
@@ -752,6 +753,7 @@ set(NFAPI_SRC
|
||||
add_library(NFAPI_LIB ${NFAPI_SRC})
|
||||
target_link_libraries(NFAPI_LIB PUBLIC nfapi_common)
|
||||
target_link_libraries(NFAPI_LIB PUBLIC nr_fapi_p5 nr_fapi_p7)
|
||||
target_link_libraries(NFAPI_LIB PRIVATE z)
|
||||
|
||||
if(OAI_WLS)
|
||||
target_compile_definitions(NFAPI_LIB PRIVATE ENABLE_WLS)
|
||||
@@ -877,6 +879,10 @@ set(PHY_SRC
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots_mbsfn.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_coding.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_modulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci.c
|
||||
@@ -893,22 +899,22 @@ set(PHY_SRC
|
||||
)
|
||||
|
||||
set(PHY_SRC_RU
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if4_tools.c
|
||||
${OPENAIR1_DIR}/PHY/if4_tools.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/drs_modulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_ul.c
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_nr.c
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/ul_7_5_kHz.c
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/gen_75KHz.cpp
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/beamforming.c
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/compute_bf_weights.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_init_ru.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/nr_init_ru.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
|
||||
)
|
||||
|
||||
set(NR_PHY_SRC_RU
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/nr_beamforming.c
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_nr.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/nr_init_ru.c
|
||||
${OPENAIR1_DIR}/PHY/if4_tools.c
|
||||
)
|
||||
|
||||
set(PHY_SRC_UE
|
||||
@@ -1068,7 +1074,7 @@ add_library(PHY_NR_COMMON ${PHY_NR_SRC_COMMON})
|
||||
target_link_libraries(PHY_NR_COMMON PUBLIC UTIL)
|
||||
|
||||
add_library(PHY_NR ${PHY_NR_SRC})
|
||||
target_link_libraries(PHY_NR nr_phy_common nr_common nr_fapi_p5 polar smallblock)
|
||||
target_link_libraries(PHY_NR nr_phy_common nr_common nr_fapi_p5 polar smallblock ds)
|
||||
|
||||
add_library(PHY_NR_NO_AVX_256 ${PHY_NR_SRC})
|
||||
target_link_libraries(PHY_NR_NO_AVX_256 nr_phy_common nr_common)
|
||||
@@ -1080,6 +1086,8 @@ target_link_libraries(PHY_NR_UE PRIVATE asn1_nr_rrc_hdrs nr_phy_common nr_common
|
||||
add_library(PHY_RU ${PHY_SRC_RU})
|
||||
target_link_libraries(PHY_RU PRIVATE asn1_lte_rrc_hdrs UTIL)
|
||||
|
||||
add_library(NR_PHY_RU ${NR_PHY_SRC_RU})
|
||||
|
||||
#Layer 2 library
|
||||
#####################
|
||||
set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC)
|
||||
@@ -1742,7 +1750,7 @@ target_link_libraries(lte-softmodem PRIVATE
|
||||
lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U SECURITY UTIL SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
|
||||
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
|
||||
${NAS_UE_LIB} ITTI SIMU radio_common softmodem_common
|
||||
-Wl,--end-group z dl)
|
||||
-Wl,--end-group dl)
|
||||
|
||||
target_link_libraries(lte-softmodem PRIVATE pthread m CONFIG_LIB rt)
|
||||
target_link_libraries(lte-softmodem PRIVATE ${T_LIB})
|
||||
@@ -1757,13 +1765,17 @@ add_executable(oairu
|
||||
${OPENAIR_DIR}/executables/lte-ru.c
|
||||
${OPENAIR_DIR}/executables/ru_control.c
|
||||
${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
|
||||
${OPENAIR_DIR}/executables/main_ru.c
|
||||
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
|
||||
)
|
||||
target_link_libraries(oairu PRIVATE
|
||||
-Wl,--start-group
|
||||
SCHED_RU_LIB PHY_COMMON PHY_RU UTIL radio_common softmodem_common
|
||||
-Wl,--end-group z dl)
|
||||
-Wl,--end-group dl)
|
||||
|
||||
target_link_libraries(oairu PRIVATE pthread m CONFIG_LIB rt ${T_LIB})
|
||||
target_link_libraries(oairu PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
@@ -1792,7 +1804,7 @@ target_link_libraries(lte-uesoftmodem PRIVATE
|
||||
SECURITY UTIL SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
|
||||
PHY_UE PHY_RU L2_UE L2_LTE SIMU NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
|
||||
${NAS_UE_LIB} ITTI radio_common softmodem_common
|
||||
-Wl,--end-group z dl)
|
||||
-Wl,--end-group dl)
|
||||
|
||||
target_link_libraries(lte-uesoftmodem PRIVATE pthread m CONFIG_LIB rt)
|
||||
target_link_libraries(lte-uesoftmodem PRIVATE ${T_LIB})
|
||||
@@ -1808,11 +1820,12 @@ add_executable(nr-oru
|
||||
${OPENAIR_DIR}/openair1/PHY/INIT/nr_parms.c
|
||||
${OPENAIR_DIR}/openair1/SCHED_NR/phy_frame_config_nr.c
|
||||
${OPENAIR_DIR}/openair1/SCHED_NR/nr_prach_procedures.c
|
||||
${OPENAIR_DIR}/openair1/SCHED_NR/nr_ru_procedures.c
|
||||
${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c
|
||||
${OPENAIR_DIR}/executables/main_nr_ru.c
|
||||
)
|
||||
target_link_libraries(nr-oru PRIVATE
|
||||
UTIL SCHED_RU_LIB PHY_COMMON PHY_RU PHY_NR shlib_loader z dl
|
||||
UTIL NR_PHY_RU PHY_NR shlib_loader dl
|
||||
radio_common softmodem_common)
|
||||
target_link_libraries(nr-oru PRIVATE pthread m CONFIG_LIB rt ${T_LIB} utils
|
||||
barrier actor)
|
||||
@@ -1836,12 +1849,12 @@ add_executable(nr-softmodem
|
||||
|
||||
target_link_libraries(nr-softmodem PRIVATE
|
||||
-Wl,--start-group
|
||||
UTIL SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECURITY
|
||||
ITTI ${NAS_UE_LIB} lte_rrc nr_rrc
|
||||
UTIL SCTP_CLIENT SCHED_LIB SCHED_NR_LIB PHY_NR PHY PHY_NR_COMMON NR_PHY_RU GTPV1U SECURITY
|
||||
ITTI ${NAS_UE_LIB} nr_rrc
|
||||
ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU
|
||||
x2ap f1ap m2ap m3ap e1ap radio_common
|
||||
time_management softmodem_common
|
||||
-Wl,--end-group z dl)
|
||||
-Wl,--end-group dl)
|
||||
|
||||
target_link_libraries(nr-softmodem PRIVATE pthread m CONFIG_LIB rt)
|
||||
target_link_libraries(nr-softmodem PRIVATE ${T_LIB})
|
||||
@@ -1881,7 +1894,7 @@ target_link_libraries(nr-cuup PRIVATE
|
||||
GTPV1U e1ap f1ap
|
||||
time_management softmodem_common
|
||||
alg
|
||||
z dl pthread ${T_LIB})
|
||||
dl pthread ${T_LIB})
|
||||
target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
|
||||
if(E2_AGENT)
|
||||
target_link_libraries(nr-cuup PRIVATE e2_agent e2_agent_arg e2_ran_func_cuup)
|
||||
@@ -1905,11 +1918,11 @@ add_executable(nr-uesoftmodem
|
||||
|
||||
target_link_libraries(nr-uesoftmodem PRIVATE
|
||||
-Wl,--start-group
|
||||
nr_rrc SECURITY UTIL SCHED_RU_LIB SCHED_NR_UE_LIB
|
||||
PHY_COMMON PHY_NR_COMMON PHY_NR_UE NR_L2_UE MAC_NR_COMMON NFAPI_LIB
|
||||
nr_rrc SECURITY UTIL SCHED_NR_UE_LIB
|
||||
PHY_NR_COMMON PHY_NR_UE NR_L2_UE MAC_NR_COMMON NFAPI_LIB
|
||||
ITTI SIMU radio_common
|
||||
time_management softmodem_common
|
||||
-Wl,--end-group z dl)
|
||||
-Wl,--end-group dl)
|
||||
|
||||
target_link_libraries(nr-uesoftmodem PRIVATE pthread m CONFIG_LIB rt nr_ue_phy_meas)
|
||||
target_link_libraries(nr-uesoftmodem PRIVATE ${T_LIB})
|
||||
@@ -1983,14 +1996,14 @@ target_link_libraries(physim_common PRIVATE UTIL)
|
||||
|
||||
add_executable(nr_dlschsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c)
|
||||
target_link_libraries(nr_dlschsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${T_LIB} ITTI dl physim_common
|
||||
)
|
||||
target_link_libraries(nr_dlschsim PRIVATE asn1_nr_rrc_hdrs)
|
||||
|
||||
add_executable(nr_pbchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c)
|
||||
target_link_libraries(nr_pbchsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${T_LIB} ITTI dl physim_common
|
||||
)
|
||||
target_link_libraries(nr_pbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
@@ -2000,14 +2013,14 @@ add_executable(nr_psbchsim
|
||||
${NFAPI_USER_DIR}/nfapi.c
|
||||
)
|
||||
target_link_libraries(nr_psbchsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB -Wl,--end-group
|
||||
m pthread ${T_LIB} ITTI dl physim_common softmodem_common
|
||||
)
|
||||
target_link_libraries(nr_psbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
|
||||
add_executable(nr_pucchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c)
|
||||
target_link_libraries(nr_pucchsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${T_LIB} ITTI dl physim_common
|
||||
)
|
||||
target_link_libraries(nr_pucchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
@@ -2019,15 +2032,15 @@ add_executable(nr_dlsim
|
||||
${PHY_INTERFACE_DIR}/queue_t.c
|
||||
)
|
||||
target_link_libraries(nr_dlsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -Wl,--end-group
|
||||
m pthread ${T_LIB} ITTI dl nr_ue_phy_meas physim_common
|
||||
-Wl,--start-group UTIL SIMU PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -Wl,--end-group
|
||||
m pthread ${T_LIB} ITTI dl nr_ue_phy_meas physim_common NR_L2_UE
|
||||
softmodem_common
|
||||
)
|
||||
target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
|
||||
add_executable(nr_prachsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c)
|
||||
target_link_libraries(nr_prachsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB CONFIG_LIB -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_NR_COMMON PHY_NR NR_PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB CONFIG_LIB -Wl,--end-group
|
||||
m pthread ${T_LIB} ITTI dl physim_common)
|
||||
target_link_libraries(nr_prachsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
|
||||
@@ -2035,7 +2048,7 @@ add_executable(nr_ulschsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c
|
||||
)
|
||||
target_link_libraries(nr_ulschsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${T_LIB} ITTI dl physim_common
|
||||
)
|
||||
target_link_libraries(nr_ulschsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
@@ -2048,8 +2061,8 @@ add_executable(nr_ulsim
|
||||
)
|
||||
|
||||
target_link_libraries(nr_ulsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -Wl,--end-group
|
||||
m pthread ${T_LIB} ITTI dl nr_ue_phy_meas physim_common softmodem_common
|
||||
-Wl,--start-group UTIL SIMU PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -Wl,--end-group
|
||||
m pthread ${T_LIB} ITTI dl nr_ue_phy_meas physim_common softmodem_common NR_L2_UE
|
||||
)
|
||||
target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
|
||||
@@ -2059,7 +2072,7 @@ add_executable(nr_srssim
|
||||
)
|
||||
|
||||
target_link_libraries(nr_srssim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ITTI dl nr_ue_phy_meas physim_common softmodem_common
|
||||
)
|
||||
|
||||
@@ -2128,7 +2141,7 @@ if (${T_TRACER})
|
||||
SECURITY SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
|
||||
NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
|
||||
MISC_NFAPI_LTE_LIB
|
||||
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU
|
||||
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU NR_PHY_RU
|
||||
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE MAC_NR_COMMON MAC_UE_NR ngap
|
||||
GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE SIMU
|
||||
dfts config_internals nr_common crc_byte)
|
||||
|
||||
20
build/.pre-commit-config.yaml
Normal file
20
build/.pre-commit-config.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
repos:
|
||||
# Clang-Format: Ensures code style is consistent
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: 'v22.1.3'
|
||||
hooks:
|
||||
- id: clang-format
|
||||
|
||||
# Cppcheck: Static analysis to find bugs
|
||||
- repo: https://github.com/pocc/pre-commit-hooks
|
||||
rev: 'v1.3.5'
|
||||
hooks:
|
||||
- id: cppcheck
|
||||
|
||||
# Basic sanity checks (trailing whitespace, end of file, etc.)
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: 'v6.0.0'
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: check-case-conflict
|
||||
- id: end-of-file-fixer
|
||||
@@ -219,28 +219,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("cppcheck") {
|
||||
steps {
|
||||
script {
|
||||
triggerSlaveJob ('RAN-cppcheck', 'cppcheck')
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
// Using a unique variable name for each test stage to avoid overwriting on a global variable
|
||||
// due to parallel-time concurrency
|
||||
cppcheckStatus = finalizeSlaveJob('RAN-cppcheck')
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
currentBuild.result = 'FAILURE'
|
||||
failingStages += cppcheckStatus
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("ARM-Cross-Compile") {
|
||||
steps {
|
||||
script {
|
||||
|
||||
@@ -22,7 +22,7 @@ import constants as CONST
|
||||
#-----------------------------------------------------------
|
||||
|
||||
|
||||
def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER):
|
||||
def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,CLUSTER):
|
||||
|
||||
force_local = False
|
||||
date_fmt = None
|
||||
@@ -53,7 +53,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER):
|
||||
RAN.ranRepository=matchReg.group(1)
|
||||
HTML.ranRepository=matchReg.group(1)
|
||||
CONTAINERS.ranRepository=matchReg.group(1)
|
||||
SCA.ranRepository=matchReg.group(1)
|
||||
CLUSTER.ranRepository=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNB_AllowMerge=(.+)$|^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE):
|
||||
if re.match(r'^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE):
|
||||
@@ -66,7 +65,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER):
|
||||
RAN.ranAllowMerge=True
|
||||
HTML.ranAllowMerge=True
|
||||
CONTAINERS.ranAllowMerge=True
|
||||
SCA.ranAllowMerge=True
|
||||
CLUSTER.ranAllowMerge=True
|
||||
elif re.match(r'^\-\-eNBBranch=(.+)$|^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE):
|
||||
if re.match(r'^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE):
|
||||
@@ -77,7 +75,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER):
|
||||
RAN.ranBranch=matchReg.group(1)
|
||||
HTML.ranBranch=matchReg.group(1)
|
||||
CONTAINERS.ranBranch=matchReg.group(1)
|
||||
SCA.ranBranch=matchReg.group(1)
|
||||
CLUSTER.ranBranch=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNBCommitID=(.*)$|^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE):
|
||||
if re.match(r'^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE):
|
||||
@@ -88,7 +85,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER):
|
||||
RAN.ranCommitID=matchReg.group(1)
|
||||
HTML.ranCommitID=matchReg.group(1)
|
||||
CONTAINERS.ranCommitID=matchReg.group(1)
|
||||
SCA.ranCommitID=matchReg.group(1)
|
||||
CLUSTER.ranCommitID=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNBTargetBranch=(.*)$|^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE):
|
||||
if re.match(r'^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE):
|
||||
@@ -99,7 +95,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER):
|
||||
RAN.ranTargetBranch=matchReg.group(1)
|
||||
HTML.ranTargetBranch=matchReg.group(1)
|
||||
CONTAINERS.ranTargetBranch=matchReg.group(1)
|
||||
SCA.ranTargetBranch=matchReg.group(1)
|
||||
CLUSTER.ranTargetBranch=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNBIPAddress=(.+)$|^\-\-eNB[1-2]IPAddress=(.+)$', myArgv, re.IGNORECASE):
|
||||
print("parameters --eNB*IPAddress ignored")
|
||||
@@ -112,7 +107,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER):
|
||||
matchReg = re.match(r'^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE)
|
||||
RAN.eNBSourceCodePath=matchReg.group(1)
|
||||
CONTAINERS.eNBSourceCodePath=matchReg.group(1)
|
||||
SCA.eNBSourceCodePath=matchReg.group(1)
|
||||
CLUSTER.eNBSourceCodePath=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE):
|
||||
print("parameter --eNB1SourceCodePath ignored")
|
||||
|
||||
@@ -143,7 +143,7 @@ ltebox-nano:
|
||||
- "sudo su -c 'screen -dm -S simulated_hss /opt/hss_sim0609/starthss'"
|
||||
- "sleep 1"
|
||||
- "sudo /opt/ltebox/tools/start_mme && sudo /opt/ltebox/tools/start_xGw &"
|
||||
- "sleep 1"
|
||||
- "sleep 2"
|
||||
Undeploy: "sudo /opt/ltebox/tools/stop_xGw; sudo /opt/ltebox/tools/stop_mme; sudo killall screen"
|
||||
LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{mmeLog.0,s1apcLog.0,s1apsLog.0,s11cLog.0,libLog.0,xGwLog.0} %%log_dir%%"
|
||||
|
||||
@@ -154,7 +154,7 @@ sabox-nepes:
|
||||
- "sudo su -c 'screen -dm -S simulated_5g_hss /opt/hss_sim0609/start_5g_hss'"
|
||||
- "sleep 1"
|
||||
- "sudo /opt/ltebox/tools/start_sabox < /dev/null &> /dev/null"
|
||||
- "sleep 1"
|
||||
- "sleep 2"
|
||||
LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{amfLog.0,ngapcLog.0,ngapcommonLog.0,ngapsLog.0,xGwLog.0,upfLog.0} %%log_dir%%"
|
||||
Undeploy: "sudo /opt/ltebox/tools/stop_sabox; sudo killall screen"
|
||||
|
||||
@@ -165,7 +165,7 @@ ltebox-nepes:
|
||||
- "sudo su -c 'screen -dm -S simulated_hss /opt/hss_sim0609/starthss'"
|
||||
- "sleep 1"
|
||||
- "sudo /opt/ltebox/tools/start_mme && sudo /opt/ltebox/tools/start_xGw &"
|
||||
- "sleep 1"
|
||||
- "sleep 2"
|
||||
Undeploy: "sudo /opt/ltebox/tools/stop_xGw; sudo /opt/ltebox/tools/stop_mme; sudo killall screen"
|
||||
LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{mmeLog.0,s1apcLog.0,s1apsLog.0,s11cLog.0,libLog.0,xGwLog.0} %%log_dir%%"
|
||||
|
||||
|
||||
@@ -184,11 +184,6 @@ class Containerize():
|
||||
self.services = ''
|
||||
self.deploymentTag = ''
|
||||
|
||||
self.cli = ''
|
||||
self.cliBuildOptions = ''
|
||||
self.dockerfileprefix = ''
|
||||
self.host = ''
|
||||
|
||||
self.num_attempts = 1
|
||||
|
||||
self.flexricTag = ''
|
||||
@@ -203,18 +198,7 @@ class Containerize():
|
||||
cmd = cls_cmd.getConnection(node)
|
||||
log_files = []
|
||||
|
||||
# Checking the hostname to get adapted on cli and dockerfileprefixes
|
||||
cmd.run('hostnamectl')
|
||||
result = re.search('Ubuntu|Red Hat', cmd.getBefore())
|
||||
self.host = result.group(0)
|
||||
if self.host == 'Ubuntu':
|
||||
self.cli = 'docker'
|
||||
self.dockerfileprefix = '.ubuntu'
|
||||
self.cliBuildOptions = ''
|
||||
elif self.host == 'Red Hat':
|
||||
self.cli = 'sudo podman'
|
||||
self.dockerfileprefix = '.rhel9'
|
||||
self.cliBuildOptions = '--disable-compression'
|
||||
dockerfileprefix = '.ubuntu'
|
||||
|
||||
# we always build the ran-build image with all targets
|
||||
# Creating a tupple with the imageName, the DockerFile prefix pattern, targetName and sanitized option
|
||||
@@ -232,23 +216,20 @@ class Containerize():
|
||||
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup', ''))
|
||||
imageNames.append(('oai-lte-ue', 'lteUE', 'oai-lte-ue', ''))
|
||||
imageNames.append(('oai-nr-ue', 'nrUE', 'oai-nr-ue', ''))
|
||||
if self.host == 'Red Hat':
|
||||
imageNames.append(('oai-physim', 'phySim', 'oai-physim', ''))
|
||||
if self.host == 'Ubuntu':
|
||||
imageNames.append(('oai-lte-ru', 'lteRU', 'oai-lte-ru', ''))
|
||||
# Building again the 5G images with Address Sanitizer
|
||||
imageNames.append(('ran-build', 'build', 'ran-build-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-enb', 'eNB', 'oai-enb-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-lte-ue', 'lteUE', 'oai-lte-ue-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-nr-ue', 'nrUE', 'oai-nr-ue-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('ran-build-fhi72', 'build.fhi72', 'ran-build-fhi72', ''))
|
||||
imageNames.append(('oai-gnb', 'gNB.fhi72', 'oai-gnb-fhi72', ''))
|
||||
imageNames.append(('oai-nr-oru', 'nrORU.fhi72', 'oai-nr-oru', ''))
|
||||
imageNames.append(('oai-lte-ru', 'lteRU', 'oai-lte-ru', ''))
|
||||
# Building again the 5G images with Address Sanitizer
|
||||
imageNames.append(('ran-build', 'build', 'ran-build-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-enb', 'eNB', 'oai-enb-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-lte-ue', 'lteUE', 'oai-lte-ue-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-nr-ue', 'nrUE', 'oai-nr-ue-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('ran-build-fhi72', 'build.fhi72', 'ran-build-fhi72', ''))
|
||||
imageNames.append(('oai-gnb', 'gNB.fhi72', 'oai-gnb-fhi72', ''))
|
||||
imageNames.append(('oai-nr-oru', 'nrORU.fhi72', 'oai-nr-oru', ''))
|
||||
result = re.search('build_cross_arm64', self.imageKind)
|
||||
if result is not None:
|
||||
self.dockerfileprefix = '.ubuntu.cross-arm64'
|
||||
dockerfileprefix = '.ubuntu.cross-arm64'
|
||||
result = re.search('native_armv9', self.imageKind)
|
||||
if result is not None:
|
||||
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb', ''))
|
||||
@@ -263,10 +244,6 @@ class Containerize():
|
||||
imageNames.append(('oai-nr-ue', 'nrUE', 'oai-nr-ue', ''))
|
||||
|
||||
cmd.cd(lSourcePath)
|
||||
# if asterix, copy the entitlement and subscription manager configurations
|
||||
if self.host == 'Red Hat':
|
||||
cmd.run('mkdir -p ./etc-pki-entitlement')
|
||||
cmd.run('cp /etc/pki/entitlement/*.pem ./etc-pki-entitlement/')
|
||||
|
||||
baseImage = 'ran-base'
|
||||
baseTag = 'develop'
|
||||
@@ -275,7 +252,7 @@ class Containerize():
|
||||
if (self.ranAllowMerge):
|
||||
imageTag = 'ci-temp'
|
||||
if self.ranTargetBranch == 'develop':
|
||||
cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base{self.dockerfileprefix} | grep --colour=never -i INDEX')
|
||||
cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base{dockerfileprefix} | grep --colour=never -i INDEX')
|
||||
result = re.search('index', cmd.getBefore())
|
||||
if result is not None:
|
||||
forceBaseImageBuild = True
|
||||
@@ -289,31 +266,30 @@ class Containerize():
|
||||
forceBaseImageBuild = True
|
||||
|
||||
# Let's remove any previous run artifacts if still there
|
||||
cmd.run(f"{self.cli} image prune --force")
|
||||
cmd.run(f"docker image prune --force")
|
||||
for image,pattern,name,option in imageNames:
|
||||
cmd.run(f"{self.cli} image rm {name}:{imageTag}", reportNonZero=False)
|
||||
cmd.run(f"docker image rm {name}:{imageTag}", reportNonZero=False)
|
||||
|
||||
cmd.run(f'docker login -u oaicicd -p oaicicd {DEFAULT_REGISTRY}')
|
||||
ubuntuImage = "ubuntu:noble"
|
||||
# Build the base image only on Push Events (not on Merge Requests)
|
||||
# On when the base image docker file is being modified.
|
||||
if forceBaseImageBuild:
|
||||
cmd.run(f"{self.cli} image rm {baseImage}:{baseTag}")
|
||||
cmd.run(f"docker image rm {baseImage}:{baseTag}")
|
||||
logfile = f'{lSourcePath}/cmake_targets/log/ran-base.docker.log'
|
||||
if self.host == 'Ubuntu':
|
||||
option = f" --build-arg UBUNTU_IMAGE={DEFAULT_REGISTRY}/{ubuntuImage}"
|
||||
cmd.run(f"{self.cli} build {self.cliBuildOptions} --target {baseImage} --tag {baseImage}:{baseTag} --file docker/Dockerfile.base{self.dockerfileprefix} {option} . &> {logfile}", timeout=1600)
|
||||
option = f" --build-arg UBUNTU_IMAGE={DEFAULT_REGISTRY}/{ubuntuImage}"
|
||||
cmd.run(f"docker build --target {baseImage} --tag {baseImage}:{baseTag} --file docker/Dockerfile.base{dockerfileprefix} {option} . &> {logfile}", timeout=1600)
|
||||
t = ("ran-base", archiveArtifact(cmd, ctx, logfile))
|
||||
log_files.append(t)
|
||||
|
||||
# First verify if the base image was properly created.
|
||||
ret = cmd.run(f"{self.cli} image inspect --format=\'Size = {{{{.Size}}}} bytes\' {baseImage}:{baseTag}")
|
||||
ret = cmd.run(f"docker image inspect --format=\'Size = {{{{.Size}}}} bytes\' {baseImage}:{baseTag}")
|
||||
allImagesSize = {}
|
||||
if ret.returncode != 0:
|
||||
logging.error('\u001B[1m Could not build properly ran-base\u001B[0m')
|
||||
# Recover the name of the failed container?
|
||||
cmd.run(f"{self.cli} ps --quiet --filter \"status=exited\" -n1 | xargs --no-run-if-empty {self.cli} rm -f")
|
||||
cmd.run(f"{self.cli} image prune --force")
|
||||
cmd.run(f"docker ps --quiet --filter \"status=exited\" -n1 | xargs --no-run-if-empty docker rm -f")
|
||||
cmd.run(f"docker image prune --force")
|
||||
cmd.close()
|
||||
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
|
||||
HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK)
|
||||
@@ -333,32 +309,31 @@ class Containerize():
|
||||
for image,pattern,name,option in imageNames:
|
||||
# the archived Dockerfiles have "ran-base:latest" as base image
|
||||
# we need to update them with proper tag
|
||||
cmd.run(f'git checkout -- docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||
cmd.run(f'sed -i -e "s#{baseImage}:latest#{baseImage}:{baseTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||
cmd.run(f'git checkout -- docker/Dockerfile.{pattern}{dockerfileprefix}')
|
||||
cmd.run(f'sed -i -e "s#{baseImage}:latest#{baseImage}:{baseTag}#" docker/Dockerfile.{pattern}{dockerfileprefix}')
|
||||
# target images should use the proper ran-build image
|
||||
if image != 'ran-build' and "-asan" in name:
|
||||
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build-asan:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build-asan:{imageTag}#" docker/Dockerfile.{pattern}{dockerfileprefix}')
|
||||
elif "fhi72" in name or name == "oai-nr-oru":
|
||||
cmd.run(f'sed -i -e "s#ran-build-fhi72:latest#ran-build-fhi72:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||
cmd.run(f'sed -i -e "s#ran-build-fhi72:latest#ran-build-fhi72:{imageTag}#" docker/Dockerfile.{pattern}{dockerfileprefix}')
|
||||
elif image != 'ran-build':
|
||||
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{dockerfileprefix}')
|
||||
if image == 'oai-gnb-aerial':
|
||||
cmd.run('cp -f /opt/nvidia-ipc/nvipc_src.2026.01.07.tar.gz .')
|
||||
logfile = f'{lSourcePath}/cmake_targets/log/{name}.docker.log'
|
||||
if self.host == 'Ubuntu':
|
||||
option = option + f" --build-arg UBUNTU_IMAGE={DEFAULT_REGISTRY}/{ubuntuImage}"
|
||||
ret = cmd.run(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {name}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} {option} . > {logfile} 2>&1', timeout=1200)
|
||||
option = option + f" --build-arg UBUNTU_IMAGE={DEFAULT_REGISTRY}/{ubuntuImage}"
|
||||
ret = cmd.run(f'docker build --target {image} --tag {name}:{imageTag} --file docker/Dockerfile.{pattern}{dockerfileprefix} {option} . > {logfile} 2>&1', timeout=1200)
|
||||
t = (name, archiveArtifact(cmd, ctx, logfile))
|
||||
log_files.append(t)
|
||||
if image == 'oai-gnb-aerial':
|
||||
cmd.run('rm -f nvipc_src.2026.01.07.tar.gz')
|
||||
# check the status of the build
|
||||
ret = cmd.run(f"{self.cli} image inspect --format=\'Size = {{{{.Size}}}} bytes\' {name}:{imageTag}")
|
||||
ret = cmd.run(f"docker image inspect --format=\'Size = {{{{.Size}}}} bytes\' {name}:{imageTag}")
|
||||
if ret.returncode != 0:
|
||||
logging.error('\u001B[1m Could not build properly ' + name + '\u001B[0m')
|
||||
status = False
|
||||
# Here we should check if the last container corresponds to a failed command and destroy it
|
||||
cmd.run(f"{self.cli} ps --quiet --filter \"status=exited\" -n1 | xargs --no-run-if-empty {self.cli} rm -f")
|
||||
cmd.run(f"docker ps --quiet --filter \"status=exited\" -n1 | xargs --no-run-if-empty docker rm -f")
|
||||
allImagesSize[name] = 'N/A -- Build Failed'
|
||||
break
|
||||
else:
|
||||
@@ -372,16 +347,16 @@ class Containerize():
|
||||
logging.debug(f'{name} size is unknown')
|
||||
allImagesSize[name] = 'unknown'
|
||||
# Now pruning dangling images in between target builds
|
||||
cmd.run(f"{self.cli} image prune --force")
|
||||
cmd.run(f"docker image prune --force")
|
||||
cmd.run(f'docker logout {DEFAULT_REGISTRY}')
|
||||
# Remove all intermediate build images and clean up
|
||||
cmd.run(f"{self.cli} image rm ran-build:{imageTag} ran-build-asan:{imageTag} ran-build-fhi72:{imageTag} || true")
|
||||
cmd.run(f"{self.cli} volume prune --force")
|
||||
cmd.run(f"docker image rm ran-build:{imageTag} ran-build-asan:{imageTag} ran-build-fhi72:{imageTag} || true")
|
||||
cmd.run(f"docker volume prune --force")
|
||||
|
||||
# Remove some cached artifacts to prevent out of diskspace problem
|
||||
logging.debug(cmd.run("df -h").stdout)
|
||||
logging.debug(cmd.run("docker system df").stdout)
|
||||
cmd.run(f"{self.cli} buildx prune --filter until=1h --force")
|
||||
cmd.run(f"docker buildx prune --filter until=1h --force")
|
||||
logging.debug(cmd.run("df -h").stdout)
|
||||
logging.debug(cmd.run("docker system df").stdout)
|
||||
|
||||
@@ -489,20 +464,12 @@ class Containerize():
|
||||
cmd = cls_cmd.getConnection(node)
|
||||
cmd.cd(lSourcePath)
|
||||
|
||||
ret = cmd.run('hostnamectl')
|
||||
result = re.search('Ubuntu', ret.stdout)
|
||||
host = result.group(0)
|
||||
if host != 'Ubuntu':
|
||||
cmd.close()
|
||||
raise Exception("Can build unit tests only on Ubuntu server")
|
||||
logging.debug('running on Ubuntu as expected')
|
||||
|
||||
# check that ran-base image exists as we expect it
|
||||
baseImage = 'ran-base'
|
||||
baseTag = 'develop'
|
||||
if self.ranAllowMerge:
|
||||
if self.ranTargetBranch == 'develop':
|
||||
cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base{self.dockerfileprefix} | grep --colour=never -i INDEX')
|
||||
cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base.ubuntu | grep --colour=never -i INDEX')
|
||||
result = re.search('index', cmd.getBefore())
|
||||
if result is not None:
|
||||
baseTag = 'ci-temp'
|
||||
|
||||
@@ -379,90 +379,6 @@ class HTMLManagement():
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.close()
|
||||
|
||||
def CreateHtmlTestRowCppCheckResults(self, CCR):
|
||||
if (self.htmlFooterCreated or (not self.htmlHeaderCreated)):
|
||||
return
|
||||
self.htmlFile = open('test_results.html', 'a')
|
||||
vId = 0
|
||||
for version in CCR.versions:
|
||||
self.htmlFile.write(' <tr bgcolor = "#F0F0F0" >\n')
|
||||
self.htmlFile.write(' <td colspan="6"><b> Results for cppcheck v ' + version + ' </b></td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> NB ERRORS</b></td>\n')
|
||||
if CCR.nbErrors[vId] == 0:
|
||||
myColor = 'lightgreen'
|
||||
elif CCR.nbErrors[vId] < 20:
|
||||
myColor = 'orange'
|
||||
else:
|
||||
myColor = 'lightcoral'
|
||||
self.htmlFile.write(' <td colspan="3" bgcolor = "' + myColor + '"><b>' + str(CCR.nbErrors[vId]) + '</b></td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> NB WARNINGS</b></td>\n')
|
||||
if CCR.nbWarnings[vId] == 0:
|
||||
myColor = 'lightgreen'
|
||||
elif CCR.nbWarnings[vId] < 20:
|
||||
myColor = 'orange'
|
||||
else:
|
||||
myColor = 'lightcoral'
|
||||
self.htmlFile.write(' <td colspan="3" bgcolor = "' + myColor + '"><b>' + str(CCR.nbWarnings[vId]) + '</b></td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr bgcolor = "#F0F0F0" >\n')
|
||||
self.htmlFile.write(' <td colspan="6"> ----------------- </td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> Memory leak</b></td>\n')
|
||||
self.htmlFile.write(' <td colspan="3">' + str(CCR.nbMemLeaks[vId]) + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> Possible null pointer deference</b></td>\n')
|
||||
self.htmlFile.write(' <td colspan="3">' + str(CCR.nbNullPtrs[vId]) + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> Uninitialized variable</b></td>\n')
|
||||
self.htmlFile.write(' <td colspan="3">' + str(CCR.nbUninitVars[vId]) + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> Undefined behaviour shifting</b></td>\n')
|
||||
self.htmlFile.write(' <td colspan="3">' + str(CCR.nbTooManyBitsShift[vId]) + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> Signed integer overflow</b></td>\n')
|
||||
self.htmlFile.write(' <td colspan="3">' + str(CCR.nbIntegerOverflow[vId]) + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr bgcolor = "#F0F0F0" >\n')
|
||||
self.htmlFile.write(' <td colspan="6"> </td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> Printf formatting issues</b></td>\n')
|
||||
self.htmlFile.write(' <td colspan="3">' + str(CCR.nbInvalidPrintf[vId]) + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> Modulo result is predetermined</b></td>\n')
|
||||
self.htmlFile.write(' <td colspan="3">' + str(CCR.nbModuloAlways[vId]) + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> Opposite Condition -> dead code</b></td>\n')
|
||||
self.htmlFile.write(' <td colspan="3">' + str(CCR.nbOppoInnerCondition[vId]) + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td colspan="2" bgcolor = "lightcyan" ><b> Wrong Scanf Nb Args</b></td>\n')
|
||||
self.htmlFile.write(' <td colspan="3">' + str(CCR.nbWrongScanfArg[vId]) + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
vId += 1
|
||||
|
||||
def CreateHtmlTestRowPhySimTestResult(self, testSummary, testResult):
|
||||
if (self.htmlFooterCreated or (not self.htmlHeaderCreated)):
|
||||
return
|
||||
|
||||
@@ -27,160 +27,30 @@ import constants as CONST
|
||||
import cls_cmd
|
||||
from cls_ci_helper import archiveArtifact
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Class Declaration
|
||||
#-----------------------------------------------------------
|
||||
class CppCheckResults():
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self.variants = ['bionic', 'focal']
|
||||
self.versions = ['','']
|
||||
self.nbErrors = [0,0]
|
||||
self.nbWarnings = [0,0]
|
||||
self.nbNullPtrs = [0,0]
|
||||
self.nbMemLeaks = [0,0]
|
||||
self.nbUninitVars = [0,0]
|
||||
self.nbInvalidPrintf = [0,0]
|
||||
self.nbModuloAlways = [0,0]
|
||||
self.nbTooManyBitsShift = [0,0]
|
||||
self.nbIntegerOverflow = [0,0]
|
||||
self.nbWrongScanfArg = [0,0]
|
||||
self.nbPtrAddNotNull = [0,0]
|
||||
self.nbOppoInnerCondition = [0,0]
|
||||
|
||||
class StaticCodeAnalysis():
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self.ranRepository = ''
|
||||
self.ranBranch = ''
|
||||
self.ranAllowMerge = False
|
||||
self.ranCommitID = ''
|
||||
self.ranTargetBranch = ''
|
||||
self.eNBSourceCodePath = ''
|
||||
|
||||
def CppCheckAnalysis(self, ctx, node, HTML):
|
||||
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
|
||||
HELP.GenericHelp(CONST.Version)
|
||||
sys.exit('Insufficient Parameter')
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
|
||||
if not lSourcePath or not node:
|
||||
raise ValueError(f"{lSourcePath=} {node=}")
|
||||
logging.debug('Building on server: ' + node)
|
||||
cmd = cls_cmd.getConnection(node)
|
||||
# on RedHat/CentOS .git extension is mandatory
|
||||
result = re.search(r'([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository)
|
||||
if result is not None:
|
||||
full_ran_repo_name = self.ranRepository.replace('git/', 'git')
|
||||
else:
|
||||
full_ran_repo_name = self.ranRepository + '.git'
|
||||
|
||||
cmd.cd(lSourcePath)
|
||||
logDir = f'{lSourcePath}/cmake_targets/log'
|
||||
cmd.run(f'mkdir -p {logDir}')
|
||||
cmd.run('docker image rm oai-cppcheck:bionic oai-cppcheck:focal')
|
||||
cmd.run(f'sed -e "s@xenial@bionic@" {lSourcePath}/ci-scripts/docker/Dockerfile.cppcheck.xenial > {lSourcePath}/ci-scripts/docker/Dockerfile.cppcheck.bionic')
|
||||
cmd.run(f'docker build --tag oai-cppcheck:bionic --file {lSourcePath}/ci-scripts/docker/Dockerfile.cppcheck.bionic . > {logDir}/cppcheck-bionic.txt 2>&1')
|
||||
cmd.run(f'sed -e "s@xenial@focal@" {lSourcePath}/ci-scripts/docker/Dockerfile.cppcheck.xenial > {lSourcePath}/ci-scripts/docker/Dockerfile.cppcheck.focal')
|
||||
cmd.run(f'docker build --tag oai-cppcheck:focal --file {lSourcePath}/ci-scripts/docker/Dockerfile.cppcheck.focal . > {logDir}/cppcheck-focal.txt 2>&1')
|
||||
cmd.run('docker image rm oai-cppcheck:bionic oai-cppcheck:focal')
|
||||
|
||||
bionic = archiveArtifact(cmd, ctx, f'{logDir}/cppcheck-bionic.txt')
|
||||
focal = archiveArtifact(cmd, ctx, f'{logDir}/cppcheck-focal.txt')
|
||||
cmd.close()
|
||||
|
||||
CCR = CppCheckResults()
|
||||
CCR_ref = CppCheckResults()
|
||||
vId = 0
|
||||
for variant in CCR.variants:
|
||||
filename = ctx.baseFilename() + '-cppcheck-'+ variant + '.txt'
|
||||
logging.info(f"will check file '{filename}'")
|
||||
if not os.path.isfile(filename):
|
||||
raise FileNotFoundError(f"{filename} is not a file")
|
||||
else:
|
||||
xmlStart = False
|
||||
with open(filename, 'r') as logfile:
|
||||
for line in logfile:
|
||||
ret = re.search(r'cppcheck version="(?P<version>[0-9\.]+)"', str(line))
|
||||
if ret is not None:
|
||||
CCR.versions[vId] = ret.group('version')
|
||||
if re.search('RUN cat cmake_targets/log/cppcheck.xml', str(line)) is not None:
|
||||
xmlStart = True
|
||||
if xmlStart:
|
||||
if re.search('severity="error"', str(line)) is not None:
|
||||
CCR.nbErrors[vId] += 1
|
||||
if re.search('severity="warning"', str(line)) is not None:
|
||||
CCR.nbWarnings[vId] += 1
|
||||
if re.search('id="memleak"', str(line)) is not None:
|
||||
CCR.nbMemLeaks[vId] += 1
|
||||
if re.search('id="nullPointer"', str(line)) is not None:
|
||||
CCR.nbNullPtrs[vId] += 1
|
||||
if re.search('id="uninitvar"', str(line)) is not None:
|
||||
CCR.nbUninitVars[vId] += 1
|
||||
if re.search('id="invalidPrintfArgType_sint"|id="invalidPrintfArgType_uint"', str(line)) is not None:
|
||||
CCR.nbInvalidPrintf[vId] += 1
|
||||
if re.search('id="moduloAlwaysTrueFalse"', str(line)) is not None:
|
||||
CCR.nbModuloAlways[vId] += 1
|
||||
if re.search('id="shiftTooManyBitsSigned"', str(line)) is not None:
|
||||
CCR.nbTooManyBitsShift[vId] += 1
|
||||
if re.search('id="integerOverflow"', str(line)) is not None:
|
||||
CCR.nbIntegerOverflow[vId] += 1
|
||||
if re.search('id="wrongPrintfScanfArgNum"|id="invalidScanfArgType_int"', str(line)) is not None:
|
||||
CCR.nbWrongScanfArg[vId] += 1
|
||||
if re.search('id="pointerAdditionResultNotNull"', str(line)) is not None:
|
||||
CCR.nbPtrAddNotNull[vId] += 1
|
||||
if re.search('id="oppositeInnerCondition"', str(line)) is not None:
|
||||
CCR.nbOppoInnerCondition[vId] += 1
|
||||
vMsg = ''
|
||||
vMsg += '======== Variant ' + variant + ' - ' + CCR.versions[vId] + ' ========\n'
|
||||
vMsg += ' ' + str(CCR.nbErrors[vId]) + ' errors\n'
|
||||
vMsg += ' ' + str(CCR.nbWarnings[vId]) + ' warnings\n'
|
||||
vMsg += ' -- Details --\n'
|
||||
vMsg += ' Memory leak: ' + str(CCR.nbMemLeaks[vId]) + '\n'
|
||||
vMsg += ' Possible null pointer deference: ' + str(CCR.nbNullPtrs[vId]) + '\n'
|
||||
vMsg += ' Uninitialized variable: ' + str(CCR.nbUninitVars[vId]) + '\n'
|
||||
vMsg += ' Undefined behaviour shifting: ' + str(CCR.nbTooManyBitsShift[vId]) + '\n'
|
||||
vMsg += ' Signed integer overflow: ' + str(CCR.nbIntegerOverflow[vId]) + '\n'
|
||||
vMsg += '\n'
|
||||
vMsg += ' Printf formatting issue: ' + str(CCR.nbInvalidPrintf[vId]) + '\n'
|
||||
vMsg += ' Modulo result is predetermined: ' + str(CCR.nbModuloAlways[vId]) + '\n'
|
||||
vMsg += ' Opposite Condition -> dead code: ' + str(CCR.nbOppoInnerCondition[vId]) + '\n'
|
||||
vMsg += ' Wrong Scanf Nb Args: ' + str(CCR.nbWrongScanfArg[vId]) + '\n'
|
||||
for vLine in vMsg.split('\n'):
|
||||
logging.debug(vLine)
|
||||
vId += 1
|
||||
|
||||
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
|
||||
HTML.CreateHtmlTestRowCppCheckResults(CCR)
|
||||
logging.info('\u001B[1m Static Code Analysis Pass\u001B[0m')
|
||||
|
||||
return True
|
||||
|
||||
def LicenceAndFormattingCheck(self, ctx, node, HTML):
|
||||
def LicenceAndFormattingCheck(ctx, node, HTML, d, branch, allowMerge, targetBranch):
|
||||
# Workspace is no longer recreated from scratch.
|
||||
# It implies that this method shall be called last within a build pipeline
|
||||
# where workspace is already created
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
|
||||
if not node or not lSourcePath:
|
||||
raise ValueError(f"{lSourcePath=} {node=}")
|
||||
if not node or not d:
|
||||
raise ValueError(f"{d=} {node=}")
|
||||
logging.debug('Building on server: ' + node)
|
||||
cmd = cls_cmd.getConnection(node)
|
||||
check_options = ''
|
||||
if self.ranAllowMerge:
|
||||
check_options = f'--build-arg MERGE_REQUEST=true --build-arg SRC_BRANCH={self.ranBranch}'
|
||||
if self.ranTargetBranch == '':
|
||||
if self.ranBranch != 'develop' and self.ranBranch != 'origin/develop':
|
||||
if allowMerge:
|
||||
check_options = f'--build-arg MERGE_REQUEST=true --build-arg SRC_BRANCH={branch}'
|
||||
if targetBranch == '':
|
||||
if branch != 'develop' and branch != 'origin/develop':
|
||||
check_options += ' --build-arg TARGET_BRANCH=develop'
|
||||
else:
|
||||
check_options += f' --build-arg TARGET_BRANCH={self.ranTargetBranch}'
|
||||
check_options += f' --build-arg TARGET_BRANCH={targetBranch}'
|
||||
|
||||
logDir = f'{lSourcePath}/cmake_targets/log/'
|
||||
logDir = f'{d}/cmake_targets/log/'
|
||||
cmd.run(f'mkdir -p {logDir}')
|
||||
cmd.run('docker image rm oai-formatting-check:latest')
|
||||
cmd.run(f'docker build --target oai-formatting-check --tag oai-formatting-check:latest {check_options} --file {lSourcePath}/ci-scripts/docker/Dockerfile.formatting.ubuntu {lSourcePath} > {logDir}/oai-formatting-check.txt 2>&1')
|
||||
cmd.run(f'docker build --target oai-formatting-check --tag oai-formatting-check:latest {check_options} --file {d}/ci-scripts/docker/Dockerfile.formatting.ubuntu {d} > {logDir}/oai-formatting-check.txt 2>&1')
|
||||
|
||||
cmd.run('docker image rm oai-formatting-check:latest')
|
||||
cmd.run('docker image prune --force')
|
||||
|
||||
@@ -17,6 +17,7 @@ gNBs =
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ({ sst = 1, sd = 0xffffff }) });
|
||||
cu_sibs = ( 2, 3, 4 );
|
||||
@include "neighbour-config.conf"
|
||||
|
||||
nr_cellid = 12345678L;
|
||||
|
||||
@@ -5,6 +5,57 @@
|
||||
# for the 2-cell rfsim setup (gNB_ID 0xe00 & 0xb00) #
|
||||
############################################################
|
||||
|
||||
############################################################
|
||||
# SIB2 #
|
||||
############################################################
|
||||
|
||||
sib2_config : {
|
||||
q_Hyst = 0;
|
||||
cellReselectionPriority = 0;
|
||||
threshServingLowP = 0;
|
||||
threshServingLowQ = 0;
|
||||
s_NonIntraSearchP = -1;
|
||||
s_NonIntraSearchQ = -1;
|
||||
q_RxLevMin = -56;
|
||||
q_QualMin = -1;
|
||||
s_IntraSearchP = 22;
|
||||
s_IntraSearchQ = -1;
|
||||
t_ReselectionNR = 1;
|
||||
deriveSSB_IndexFromCell = 1;
|
||||
|
||||
speed_t_Evaluation = 0;
|
||||
speed_t_HystNormal = 0;
|
||||
speed_n_CellChangeMedium = 1;
|
||||
speed_n_CellChangeHigh = 2;
|
||||
speed_sf_Medium = 1;
|
||||
speed_sf_High = 0;
|
||||
};
|
||||
|
||||
############################################################
|
||||
# Per-frequency SIB4 inter-frequency configuration #
|
||||
############################################################
|
||||
|
||||
frequency_list = (
|
||||
{
|
||||
absoluteFrequencySSB = 621312;
|
||||
subcarrierSpacing = 1; # 30 kHz
|
||||
band = 78;
|
||||
|
||||
frequency_config = (
|
||||
{
|
||||
cellReselectionPriority = 5;
|
||||
threshX_HighP = 10;
|
||||
threshX_LowP = 6;
|
||||
threshX_HighQ = -1;
|
||||
threshX_LowQ = -1;
|
||||
q_OffsetFreq = 0;
|
||||
q_RxLevMin = -56;
|
||||
t_ReselectionNR = 1;
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
neighbour_list = (
|
||||
##########################################################
|
||||
# Entry USED BY gNB_ID = 0xe00 (nr_cellid = 1) #
|
||||
@@ -21,6 +72,9 @@ neighbour_list = (
|
||||
band = 78;
|
||||
plmn = { mcc = 208; mnc = 99; mnc_length = 2 };
|
||||
tracking_area_code = 1;
|
||||
q_OffsetCell = 2;
|
||||
q_RxLevMinOffsetCell= 2;
|
||||
q_QualMinOffsetCell = 1;
|
||||
}
|
||||
);
|
||||
},
|
||||
@@ -40,6 +94,9 @@ neighbour_list = (
|
||||
band = 78;
|
||||
plmn = { mcc = 208; mnc = 99; mnc_length = 2 };
|
||||
tracking_area_code = 1;
|
||||
q_OffsetCell = 2;
|
||||
q_RxLevMinOffsetCell= 2;
|
||||
q_QualMinOffsetCell = 1;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
# Dockerfile for the Open-Air-Interface BUILD service
|
||||
# Valid for Ubuntu 22.04
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
FROM ubuntu:xenial AS oai-cppcheck
|
||||
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade --yes && \
|
||||
apt-get install --yes \
|
||||
build-essential \
|
||||
vim \
|
||||
cppcheck
|
||||
|
||||
WORKDIR /oai-ran
|
||||
COPY . .
|
||||
|
||||
WORKDIR /oai-ran/common/utils/T
|
||||
RUN make
|
||||
|
||||
WORKDIR /oai-ran
|
||||
RUN mkdir -p cmake_targets/log && \
|
||||
cppcheck --enable=warning --force --xml --xml-version=2 \
|
||||
--inline-suppr \
|
||||
-i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c \
|
||||
--suppressions-list=ci-scripts/cppcheck_suppressions.list \
|
||||
-I common/utils \
|
||||
-I openair3/NAS/COMMON/UTIL \
|
||||
-j`nproc` . 2> cmake_targets/log/cppcheck.xml 1> cmake_targets/log/cppcheck_build.txt
|
||||
|
||||
RUN grep -E -c 'severity="error' cmake_targets/log/cppcheck.xml
|
||||
|
||||
RUN grep -E -c 'severity="warning' cmake_targets/log/cppcheck.xml
|
||||
|
||||
RUN cat cmake_targets/log/cppcheck.xml
|
||||
@@ -22,7 +22,7 @@ import constants as CONST
|
||||
|
||||
import cls_oaicitest #main class for OAI CI test framework
|
||||
import cls_containerize #class Containerize for all container-based operations on RAN/UE objects
|
||||
import cls_static_code_analysis #class for static code analysis
|
||||
import cls_static_code_analysis as SCA
|
||||
import cls_cluster # class for building/deploying on cluster
|
||||
import cls_native # class for all native/source-based operations
|
||||
from cls_ci_helper import TestCaseCtx
|
||||
@@ -64,7 +64,6 @@ def ExecuteActionWithParam(action, ctx, node):
|
||||
global RAN
|
||||
global HTML
|
||||
global CONTAINERS
|
||||
global SCA
|
||||
global CLUSTER
|
||||
if action == 'Build_eNB' or action == 'Build_Image' or action == 'Build_Proxy' or action == "Build_Cluster_Image" or action == "Build_Run_Tests":
|
||||
RAN.Build_eNB_args=test.findtext('Build_eNB_args')
|
||||
@@ -196,10 +195,7 @@ def ExecuteActionWithParam(action, ctx, node):
|
||||
success = CONTAINERS.Create_Workspace(node, HTML)
|
||||
|
||||
elif action == 'LicenceAndFormattingCheck':
|
||||
success = SCA.LicenceAndFormattingCheck(ctx, node, HTML)
|
||||
|
||||
elif action == 'Cppcheck_Analysis':
|
||||
success = SCA.CppCheckAnalysis(ctx, node, HTML)
|
||||
success = SCA.StaticCodeAnalysis.LicenceAndFormattingCheck(ctx, node, HTML, RAN.eNBSourceCodePath, RAN.ranBranch, RAN.ranAllowMerge, RAN.ranTargetBranch)
|
||||
|
||||
elif action == 'Push_Local_Registry':
|
||||
tag_prefix = test.findtext('tag_prefix') or ""
|
||||
@@ -297,7 +293,6 @@ CiTestObj = cls_oaicitest.OaiCiTest()
|
||||
RAN = ran.RANManagement()
|
||||
HTML = cls_oai_html.HTMLManagement()
|
||||
CONTAINERS = cls_containerize.Containerize()
|
||||
SCA = cls_static_code_analysis.StaticCodeAnalysis()
|
||||
CLUSTER = cls_cluster.Cluster()
|
||||
|
||||
#-----------------------------------------------------------
|
||||
@@ -307,7 +302,7 @@ CLUSTER = cls_cluster.Cluster()
|
||||
import args_parse
|
||||
# Force local execution, move all execution targets to localhost
|
||||
force_local = False
|
||||
mode, force_local, date_fmt = args_parse.ArgsParse(sys.argv,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER)
|
||||
mode, force_local, date_fmt = args_parse.ArgsParse(sys.argv,CiTestObj,RAN,HTML,CONTAINERS,HELP,CLUSTER)
|
||||
fmt = "%(levelname)8s: %(message)s"
|
||||
if date_fmt:
|
||||
fmt = "[%(asctime)s] %(levelname)s %(message)s"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
- Deploy_Object
|
||||
- Stop_Object
|
||||
- Undeploy_Object
|
||||
- Cppcheck_Analysis
|
||||
- Deploy_Run_OC_PhySim
|
||||
- Build_Deploy_PhySim
|
||||
- LicenceAndFormattingCheck
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->
|
||||
|
||||
<testCaseList>
|
||||
<htmlTabRef>build-tab</htmlTabRef>
|
||||
<htmlTabName>CPPCHECK Analysis</htmlTabName>
|
||||
<htmlTabIcon>wrench</htmlTabIcon>
|
||||
|
||||
<testCase>
|
||||
<class>Create_Workspace</class>
|
||||
<desc>Create new Workspace</desc>
|
||||
<node>carabe</node>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Cppcheck_Analysis</class>
|
||||
<desc>Static Code Analysis with cppcheck</desc>
|
||||
<node>carabe</node>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -166,7 +166,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
trf_gen:
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
privileged: true
|
||||
container_name: l2sim4g-trf-gen
|
||||
networks:
|
||||
|
||||
@@ -166,7 +166,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
trf_gen:
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
privileged: true
|
||||
container_name: rfsim4g-trf-gen
|
||||
networks:
|
||||
|
||||
@@ -166,7 +166,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
trf_gen:
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
privileged: true
|
||||
container_name: rfsim4g-trf-gen
|
||||
networks:
|
||||
|
||||
@@ -166,7 +166,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
trf_gen:
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
privileged: true
|
||||
container_name: rfsim4g-trf-gen
|
||||
networks:
|
||||
|
||||
@@ -166,7 +166,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
trf_gen:
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
privileged: true
|
||||
container_name: rfsim4g-trf-gen
|
||||
networks:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -75,7 +75,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -38,11 +38,11 @@ Password:
|
||||
Now pull images.
|
||||
|
||||
```bash
|
||||
$ docker pull mysql:8.0
|
||||
$ docker pull oaisoftwarealliance/oai-amf:v2.1.10
|
||||
$ docker pull oaisoftwarealliance/oai-smf:v2.1.10
|
||||
$ docker pull oaisoftwarealliance/oai-upf:v2.1.10
|
||||
$ docker pull oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
$ docker pull mysql:9.6
|
||||
$ docker pull oaisoftwarealliance/oai-amf:v2.2.1
|
||||
$ docker pull oaisoftwarealliance/oai-smf:v2.2.1
|
||||
$ docker pull oaisoftwarealliance/oai-upf:v2.2.1
|
||||
$ docker pull oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
|
||||
$ docker pull oaisoftwarealliance/oai-gnb:develop
|
||||
$ docker pull oaisoftwarealliance/oai-nr-ue:develop
|
||||
@@ -570,7 +570,7 @@ runs the gnb service with modified gNB executable.
|
||||
```bash
|
||||
docker compose -f docker-compose.yaml -f local-override.yaml up -d oai-gnb
|
||||
```
|
||||
This command rebuilds both the gNB & nrUE and runs the oai-nr-ue container with
|
||||
This command rebuilds both the gNB & nrUE and runs the oai-nr-ue container with
|
||||
modified nrUE executable.
|
||||
```bash
|
||||
docker compose -f docker-compose.yaml -f local-override.yaml up -d oai-nr-ue
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ./oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -23,7 +23,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -35,7 +35,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -47,7 +47,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -70,7 +70,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -23,7 +23,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:ci-tmp-pr-372-26c14bcd
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -35,7 +35,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.9
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -47,7 +47,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.9
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -70,7 +70,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
@@ -25,7 +25,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -37,7 +37,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -49,7 +49,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -72,7 +72,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
|
||||
@@ -12,7 +12,7 @@ services:
|
||||
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -36,7 +36,7 @@ services:
|
||||
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -49,7 +49,7 @@ services:
|
||||
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -62,7 +62,7 @@ services:
|
||||
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
|
||||
@@ -12,7 +12,7 @@ services:
|
||||
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -36,7 +36,7 @@ services:
|
||||
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -49,7 +49,7 @@ services:
|
||||
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -62,7 +62,7 @@ services:
|
||||
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
|
||||
@@ -184,7 +184,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
trf_gen:
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
privileged: true
|
||||
container_name: prod-trf-gen
|
||||
networks:
|
||||
|
||||
@@ -168,7 +168,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
trf_gen:
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
privileged: true
|
||||
container_name: prod-trf-gen
|
||||
networks:
|
||||
|
||||
@@ -168,7 +168,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
trf_gen:
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
privileged: true
|
||||
container_name: prod-trf-gen
|
||||
networks:
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
# file build_oai
|
||||
# brief OAI automated build tool that can be used to install, compile, run OAI.
|
||||
|
||||
set -e
|
||||
|
||||
# Include helper functions
|
||||
THIS_SCRIPT_PATH=$(dirname $(readlink -f "$0"))
|
||||
source "$THIS_SCRIPT_PATH"/tools/build_helper
|
||||
@@ -132,16 +130,9 @@ function main() {
|
||||
--build-tool-opt)
|
||||
BUILD_TOOL_OPT+=" $2"
|
||||
shift 2;;
|
||||
-c | --clean)
|
||||
-c | --clean | -C | --clean-all)
|
||||
CLEAN=1
|
||||
shift;;
|
||||
-C | --clean-all)
|
||||
CLEAN_ALL=1
|
||||
shift;;
|
||||
--clean-kernel)
|
||||
clean_kernel
|
||||
echo_info "Erased iptables config and removed modules from kernel"
|
||||
shift;;
|
||||
--cmake-opt)
|
||||
CMAKE_CMD="$CMAKE_CMD $2"
|
||||
shift 2;;
|
||||
@@ -330,8 +321,8 @@ function main() {
|
||||
echo_info "Enabling build of all optional shared libraries ($OPTIONAL_LIBRARIES)"
|
||||
else
|
||||
for reqlib in $2; do
|
||||
lib=$(echo $OPTIONAL_LIBRARIES | tr ' ' '\n' | grep -w $reqlib) # search given parameter in list
|
||||
[[ $? -ne 0 ]] && echo_fatal "Unknown optional library in $reqlib, valid libraries are $OPTIONAL_LIBRARIES"
|
||||
lib=$(echo $OPTIONAL_LIBRARIES | tr ' ' '\n' | grep -w -- $reqlib) # search given parameter in list
|
||||
[[ $? -ne 0 ]] && echo_fatal "Unknown optional library \"$reqlib\", valid libraries are: $OPTIONAL_LIBRARIES"
|
||||
TARGET_LIST="$TARGET_LIST $lib" # will append the found library
|
||||
CMAKE_CMD="$CMAKE_CMD -DENABLE_${lib^^}=ON"
|
||||
echo_info "Enabling build of optional shared library $lib"
|
||||
@@ -384,13 +375,8 @@ function main() {
|
||||
|
||||
echo "OPENAIR_DIR = $OPENAIR_DIR"
|
||||
|
||||
if [ "$CLEAN_ALL" = "1" ] ; then
|
||||
clean_all_files
|
||||
echo "Erased all previously producted files"
|
||||
fi
|
||||
|
||||
dlog=$OPENAIR_DIR/cmake_targets/log
|
||||
mkdir -p $dlog
|
||||
DIR=$OPENAIR_DIR/cmake_targets
|
||||
[ "$CLEAN" = "1" ] && rm -rf "$DIR/$BUILD_DIR"
|
||||
|
||||
if [ "$INSTALL_EXTERNAL" = "1" ] ; then
|
||||
echo_info "Installing packages"
|
||||
@@ -423,10 +409,6 @@ function main() {
|
||||
check_install_additional_tools
|
||||
fi
|
||||
|
||||
DIR=$OPENAIR_DIR/cmake_targets
|
||||
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build
|
||||
|
||||
if [[ $TARGET_LIST != "" ]] && [[ -f $OPENAIR_DIR/CMakeLists.txt ]]; then
|
||||
# add some default libraries that should always be built
|
||||
# for eNB, gNB, UEs, simulators
|
||||
@@ -441,11 +423,10 @@ function main() {
|
||||
# e.g., cmake_targets/ran_build/build, hence the ../../..
|
||||
CMAKE_CMD="$CMAKE_CMD ../../.."
|
||||
echo_info "Running \"$CMAKE_CMD\""
|
||||
eval $CMAKE_CMD
|
||||
eval $CMAKE_CMD || echo_fatal "cmake configuration failed"
|
||||
cmd="$CMAKE --build . --target ${TARGET_LIST} -- ${BUILD_TOOL_OPT}"
|
||||
echo_info "Running \"${cmd}\"" $green
|
||||
eval $cmd
|
||||
ret=$?
|
||||
eval $cmd || echo_fatal "build failed"
|
||||
|
||||
if [ "$UE" = 1 ] ; then
|
||||
echo_info "Generate LTE USIM default sim content UE specific part"
|
||||
|
||||
@@ -83,7 +83,7 @@ function(run_asn1c ASN1C_GRAMMAR ASN1C_PREFIX)
|
||||
get_filename_component(GRAMMAR_FILE ${ASN1C_GRAMMAR} NAME)
|
||||
set(LOGFILE "${CMAKE_CURRENT_BINARY_DIR}/${GRAMMAR_FILE}.log")
|
||||
add_custom_command(OUTPUT ${ASN1C_OUTPUT}
|
||||
COMMAND ASN1C_PREFIX=${ASN1C_PREFIX} ${ASN1C_EXEC} ${ASN1C_OPTIONS} -D ${CMAKE_CURRENT_BINARY_DIR} ${ASN1C_GRAMMAR} > ${LOGFILE} 2>&1 || cat ${LOGFILE}
|
||||
COMMAND ASN1C_PREFIX=${ASN1C_PREFIX} ${ASN1C_EXEC} ${ASN1C_OPTIONS} -D ${CMAKE_CURRENT_BINARY_DIR} ${ASN1C_GRAMMAR} > ${LOGFILE} 2>&1 || ( cat ${LOGFILE} && false )
|
||||
DEPENDS ${ASN1C_GRAMMAR}
|
||||
COMMENT "Generating ${ASN1C_COMMENT} from ${GRAMMAR_FILE}"
|
||||
)
|
||||
|
||||
@@ -120,32 +120,6 @@ handler_EXIT() {
|
||||
|
||||
trap handler_EXIT EXIT
|
||||
|
||||
###########################
|
||||
# Cleaners
|
||||
###########################
|
||||
|
||||
clean_kernel() {
|
||||
$SUDO modprobe ip_tables
|
||||
$SUDO modprobe x_tables
|
||||
$SUDO iptables -P INPUT ACCEPT
|
||||
$SUDO iptables -F INPUT
|
||||
$SUDO iptables -P OUTPUT ACCEPT
|
||||
$SUDO iptables -F OUTPUT
|
||||
$SUDO iptables -P FORWARD ACCEPT
|
||||
$SUDO iptables -F FORWARD
|
||||
$SUDO iptables -t nat -F
|
||||
$SUDO iptables -t mangle -F
|
||||
$SUDO iptables -t filter -F
|
||||
$SUDO iptables -t raw -F
|
||||
echo_info "Flushed iptables"
|
||||
}
|
||||
|
||||
clean_all_files() {
|
||||
set_openair_env
|
||||
dir=$OPENAIR_DIR/cmake_targets
|
||||
rm -rf $dir/ran_build $dir/ran_build_noLOG
|
||||
}
|
||||
|
||||
############################################
|
||||
# External packages installers
|
||||
############################################
|
||||
|
||||
@@ -133,7 +133,7 @@ int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoption
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix)
|
||||
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
@@ -193,7 +193,7 @@ int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgo
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix)
|
||||
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions)
|
||||
{
|
||||
int status = 0;
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->dblptr), 1);
|
||||
@@ -229,7 +229,7 @@ int config_assign_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix)
|
||||
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
@@ -333,13 +333,13 @@ int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoptio
|
||||
|
||||
case TYPE_UINTARRAY:
|
||||
case TYPE_INTARRAY:
|
||||
return config_setdefault_intlist(cfg, cfgoption, prefix);
|
||||
return config_setdefault_intlist(cfg, cfgoption);
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
return config_setdefault_double(cfg, cfgoption, prefix);
|
||||
return config_setdefault_double(cfg, cfgoption);
|
||||
|
||||
case TYPE_IPV4ADDR:
|
||||
return config_setdefault_ipv4addr(cfg, cfgoption, prefix);
|
||||
return config_setdefault_ipv4addr(cfg, cfgoption);
|
||||
|
||||
case TYPE_LIST:
|
||||
// No default value for list type
|
||||
|
||||
@@ -20,11 +20,11 @@ void config_check_valptr(configmodule_interface_t *cfg, paramdef_t *cfgoptions,
|
||||
/* functions to set a parameter to its default value */
|
||||
int config_setdefault_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
|
||||
int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
|
||||
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
|
||||
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions);
|
||||
int config_setdefault_string(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
|
||||
int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
|
||||
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
|
||||
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
|
||||
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions);
|
||||
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions);
|
||||
void *config_allocate_new(configmodule_interface_t *cfg, int sz, bool autoFree);
|
||||
void config_assign_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *fullname, int val);
|
||||
int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoption, const char *prefix);
|
||||
|
||||
@@ -123,6 +123,10 @@ int config_cmdlineonly_getlist(configmodule_interface_t *cfg,
|
||||
int numparams,
|
||||
const char *prefix)
|
||||
{
|
||||
UNUSED(cfg);
|
||||
UNUSED(params);
|
||||
UNUSED(numparams);
|
||||
UNUSED(prefix);
|
||||
ParamList->numelt = 0;
|
||||
return 0;
|
||||
}
|
||||
@@ -162,15 +166,15 @@ int config_cmdlineonly_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions
|
||||
|
||||
case TYPE_UINTARRAY:
|
||||
case TYPE_INTARRAY:
|
||||
defval = config_setdefault_intlist(cfg, &cfgoptions[i], prefix);
|
||||
defval = config_setdefault_intlist(cfg, &cfgoptions[i]);
|
||||
break;
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
defval = config_setdefault_double(cfg, &cfgoptions[i], prefix);
|
||||
defval = config_setdefault_double(cfg, &cfgoptions[i]);
|
||||
break;
|
||||
|
||||
case TYPE_IPV4ADDR:
|
||||
defval = config_setdefault_ipv4addr(cfg, &cfgoptions[i], prefix);
|
||||
defval = config_setdefault_ipv4addr(cfg, &cfgoptions[i]);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -48,8 +48,8 @@ typedef union checkedparam {
|
||||
int num_okintval; /* number of valid values in the checkingval array */
|
||||
} s1a;
|
||||
struct {
|
||||
int (*f2)(configmodule_interface_t *cfg,
|
||||
paramdef_t *param); /* check an integer against an authorized range, defined by its min and max value */
|
||||
int (*f2)(const configmodule_interface_t *cfg,
|
||||
const paramdef_t *param); /* check an integer against an authorized range, defined by its min and max value */
|
||||
int okintrange[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store min and max values */
|
||||
|
||||
} s2;
|
||||
|
||||
@@ -177,19 +177,41 @@ void print_intvalueerror(paramdef_t *param, char *fname, int *okval, int numokva
|
||||
|
||||
int config_check_intval(configmodule_interface_t *cfg, paramdef_t *param)
|
||||
{
|
||||
UNUSED(cfg);
|
||||
if ( param == NULL ) {
|
||||
fprintf(stderr,"[CONFIG] config_check_intval: NULL param argument\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
for ( int i=0; i<param->chkPptr->s1.num_okintval ; i++) {
|
||||
if( *(param->uptr) == param->chkPptr->s1.okintval[i] ) {
|
||||
return 0;
|
||||
if (param->type == TYPE_INT32 || param->type == TYPE_INT) {
|
||||
if (param->iptr == NULL) {
|
||||
fprintf(stderr, "[CONFIG] config_check_intval: %s: NULL iptr\n", param->optname);
|
||||
return -1;
|
||||
}
|
||||
const int v = *param->iptr;
|
||||
for (int i = 0; i < param->chkPptr->s1.num_okintval; i++) {
|
||||
if (v == param->chkPptr->s1.okintval[i])
|
||||
return 0;
|
||||
}
|
||||
fprintf(stderr, "[CONFIG] config_check_intval: %s: %i invalid value, authorized values:\n ", param->optname, v);
|
||||
for (int i = 0; i < param->chkPptr->s1.num_okintval; i++) {
|
||||
fprintf(stderr, " %i", param->chkPptr->s1.okintval[i]);
|
||||
}
|
||||
fprintf(stderr, " \n");
|
||||
return -1;
|
||||
} else {
|
||||
if (param->uptr == NULL) {
|
||||
fprintf(stderr, "[CONFIG] config_check_intval: %s: NULL uptr\n", param->optname);
|
||||
return -1;
|
||||
}
|
||||
for (int i = 0; i < param->chkPptr->s1.num_okintval; i++) {
|
||||
if (*(param->uptr) == (uint32_t)param->chkPptr->s1.okintval[i]) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
print_intvalueerror(param, "config_check_intval", param->chkPptr->s1.okintval, param->chkPptr->s1.num_okintval);
|
||||
return -1;
|
||||
}
|
||||
|
||||
print_intvalueerror(param,"config_check_intval", param->chkPptr->s1.okintval,param->chkPptr->s1.num_okintval);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_check_modify_integer(configmodule_interface_t *cfg, paramdef_t *param)
|
||||
@@ -210,14 +232,38 @@ int config_check_modify_integer(configmodule_interface_t *cfg, paramdef_t *param
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_check_intrange(configmodule_interface_t *cfg, paramdef_t *param)
|
||||
int config_check_intrange(const configmodule_interface_t *cfg, const paramdef_t *param)
|
||||
{
|
||||
UNUSED(cfg);
|
||||
if( *(param->iptr) >= param->chkPptr->s2.okintrange[0] && *(param->iptr) <= param->chkPptr->s2.okintrange[1] ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
fprintf(stderr,"[CONFIG] config_check_intrange: %s: %i invalid value, authorized range: %i %i\n",
|
||||
param->optname, (int)*(param->uptr), param->chkPptr->s2.okintrange[0], param->chkPptr->s2.okintrange[1]);
|
||||
fprintf(stderr,
|
||||
"[CONFIG] config_check_intrange: %s: %i invalid value, authorized range: %i %i\n",
|
||||
param->optname,
|
||||
(int)*(param->iptr),
|
||||
param->chkPptr->s2.okintrange[0],
|
||||
param->chkPptr->s2.okintrange[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_check_uintrange(const configmodule_interface_t *cfg, const paramdef_t *param)
|
||||
{
|
||||
(void)cfg;
|
||||
const uint32_t *v = param->uptr;
|
||||
const int *range = param->chkPptr->s2.okintrange;
|
||||
|
||||
if (*v >= (uint32_t)range[0] && *v <= (uint32_t)range[1]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
"[CONFIG] config_check_uintrange: %s: %u invalid, authorized range: %i %i\n",
|
||||
param->optname,
|
||||
*v,
|
||||
range[0],
|
||||
range[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -234,6 +280,7 @@ void print_strvalueerror(paramdef_t *param, char *fname, char **okval, int numok
|
||||
|
||||
int config_check_strval(configmodule_interface_t *cfg, paramdef_t *param)
|
||||
{
|
||||
UNUSED(cfg);
|
||||
if ( param == NULL ) {
|
||||
fprintf(stderr,"[CONFIG] config_check_strval: NULL param argument\n");
|
||||
return -1;
|
||||
|
||||
@@ -51,7 +51,8 @@ int config_get_processedint(configmodule_interface_t *cfg, paramdef_t *cfgoption
|
||||
/* functions to be used in parameters definition, to check parameters values */
|
||||
int config_check_intval(configmodule_interface_t *cfg, paramdef_t *param);
|
||||
int config_check_modify_integer(configmodule_interface_t *cfg, paramdef_t *param);
|
||||
int config_check_intrange(configmodule_interface_t *cfg, paramdef_t *param);
|
||||
int config_check_intrange(const configmodule_interface_t *cfg, const paramdef_t *param);
|
||||
int config_check_uintrange(const configmodule_interface_t *cfg, const paramdef_t *param);
|
||||
int config_check_strval(configmodule_interface_t *cfg, paramdef_t *param);
|
||||
int config_checkstr_assign_integer(configmodule_interface_t *cfg, paramdef_t *param);
|
||||
const paramdef_t *config_get_paramdef_from_name(const paramdef_t *pd, int num, const char *name);
|
||||
|
||||
@@ -158,6 +158,7 @@ extern "C" int config_yaml_init(configmodule_interface_t *cfg)
|
||||
|
||||
extern "C" void config_yaml_end(configmodule_interface_t *cfg)
|
||||
{
|
||||
UNUSED(cfg);
|
||||
delete config_yaml::config;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
#define RETURNok (0)
|
||||
#define RETURNerror (-1)
|
||||
#define DEFAULT_NAS_PATH "PWD"
|
||||
#define UNUSED_VARIABLE(vARIABLE) (void)(vARIABLE)
|
||||
#define NUM_PRACH_RX_FOR_NOISE_ESTIMATE 100
|
||||
|
||||
// SDAP
|
||||
|
||||
@@ -241,6 +241,9 @@ typedef struct protocol_ctxt_s {
|
||||
bool brOption;
|
||||
} protocol_ctxt_t;
|
||||
|
||||
/// suppress compiler warning for unused arguments
|
||||
#define UNUSED(x) (void)x;
|
||||
|
||||
#define UE_MODULE_ID_TO_INSTANCE(mODULE_iD) mODULE_iD + RC.nb_inst
|
||||
#define ENB_MODULE_ID_TO_INSTANCE(mODULE_iD) mODULE_iD
|
||||
#define UE_INSTANCE_TO_MODULE_ID(iNSTANCE) iNSTANCE - RC.nb_inst
|
||||
|
||||
@@ -16,7 +16,7 @@ add_subdirectory(nr)
|
||||
add_subdirectory(LOG)
|
||||
add_subdirectory(threadPool)
|
||||
add_subdirectory(time_manager)
|
||||
add_library(utils utils.c system.c time_meas.c time_stat.c tuntap_if.c reverse_bits.c)
|
||||
add_library(utils utils.c system.c time_meas.c time_stat.c tuntap_if.c reverse_bits.c fsn.c)
|
||||
target_include_directories(utils PUBLIC .)
|
||||
target_link_libraries(utils PRIVATE ${T_LIB})
|
||||
add_subdirectory(barrier)
|
||||
|
||||
@@ -519,13 +519,7 @@ void logTerm(void)
|
||||
}
|
||||
|
||||
#include <sys/syscall.h>
|
||||
static inline int log_header(log_component_t *c,
|
||||
char *log_buffer,
|
||||
int buffsize,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line,
|
||||
int level)
|
||||
static inline int log_header(log_component_t *c, char *log_buffer, int buffsize, const char *func, int line, int level)
|
||||
{
|
||||
int flag = g_log->flag;
|
||||
|
||||
@@ -666,7 +660,7 @@ void log_dump(int component,
|
||||
|
||||
if (wbuf != NULL) {
|
||||
va_start(args, format);
|
||||
int pos=log_header(c, wbuf,MAX_LOG_TOTAL,"noFile","noFunc",0, OAILOG_INFO);
|
||||
int pos = log_header(c, wbuf, MAX_LOG_TOTAL, "noFunc", 0, OAILOG_INFO);
|
||||
pos+=vsprintf(wbuf+pos,format, args);
|
||||
va_end(args);
|
||||
|
||||
@@ -875,6 +869,8 @@ void flush_mem_to_file(void)
|
||||
|
||||
static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args)
|
||||
{
|
||||
UNUSED(comp);
|
||||
UNUSED(file);
|
||||
//logRecord_mt(file,func,line, pthread_self(), comp, level, format, ##args)
|
||||
int len = 0;
|
||||
/* The main difference with the version above is the use of this local log_buffer.
|
||||
@@ -887,7 +883,7 @@ static void log_output_memory(log_component_t *c, const char *file, const char *
|
||||
|
||||
// make sure that for log trace the extra info is only printed once, reset when the level changes
|
||||
if (level < OAILOG_TRACE) {
|
||||
int n = log_header(c, log_buffer+len, sizeof(log_buffer), file, func, line, level);
|
||||
int n = log_header(c, log_buffer+len, sizeof(log_buffer), func, line, level);
|
||||
if (n > 0) {
|
||||
len += n;
|
||||
if (len > sizeof(log_buffer)) {
|
||||
|
||||
@@ -14,6 +14,7 @@ It is made of two main parts:
|
||||
|
||||
* [Basic usage](./T/basic.md)
|
||||
* [Record](./T/record.md)
|
||||
* [Record to ClickHouse](./T/record_db.md)
|
||||
* [Replay](./T/replay.md)
|
||||
* [Multiple tracers](./T/multi.md)
|
||||
* [MAC PDUs and wireshark](./T/wireshark.md)
|
||||
|
||||
@@ -67,18 +67,26 @@ the T tracer and only output on the terminal). The default is
|
||||
|
||||
## Run a tracer
|
||||
|
||||
Go into the directory `common/utils/T/tracer` (or
|
||||
`cmake_targets/ran_build/build/common/utils/T/tracer`) and run for example the
|
||||
Go into the directory `common/utils/T/tracer` and run for example the
|
||||
`enb` tracer:
|
||||
|
||||
```shell
|
||||
#in common/utils/T/tracer directory
|
||||
./enb -d ../T_messages.txt
|
||||
```
|
||||
|
||||
You can also run it from `cmake_targets/ran_build/build/` directory:
|
||||
|
||||
```shell
|
||||
# in cmake_targets/ran_build/build directory
|
||||
./common/utils/T/tracer/enb -d ../../../common/utils/T/T_messages.txt
|
||||
```
|
||||
|
||||
To trace a remote program, use the `-ip` option. For example,
|
||||
if you want to trace a program running on `192.168.12.148` do:
|
||||
|
||||
```shell
|
||||
# in common/utils/T/tracer directory
|
||||
./enb -d ../T_messages.txt -ip 192.168.12.148
|
||||
```
|
||||
|
||||
|
||||
181
common/utils/T/DOC/T/record_db.md
Normal file
181
common/utils/T/DOC/T/record_db.md
Normal file
@@ -0,0 +1,181 @@
|
||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||
|
||||
# Record to ClickHouse
|
||||
|
||||
This document describes the database-backed T tracer. Unlike [`record`](./record.md),
|
||||
which writes a `.raw` file, `record_db` writes T tracer events
|
||||
directly into a [ClickHouse database](https://clickhouse.com/docs/intro).
|
||||
|
||||
## What `record_db` does
|
||||
|
||||
`record_db` connects to a running OAI softmodem instance through
|
||||
the standard T tracer TCP interface and:
|
||||
|
||||
- Enables the selected events
|
||||
- Creates one ClickHouse table per enabled event
|
||||
- Batches received rows and inserts them into ClickHouse
|
||||
|
||||
Each table always contains:
|
||||
|
||||
- `TsSwNs`: software receive timestamp created by `record_db`
|
||||
|
||||
If an event has both `frame` and `slot` (or `subframe`) fields, the
|
||||
tool also adds:
|
||||
|
||||
- `TsTxUtcNs`: transmission timestamp reconstructed from frame/slot
|
||||
|
||||
The remaining columns come from the event definition in
|
||||
`T_messages.txt`.
|
||||
|
||||
## Build
|
||||
|
||||
`record_db` pulls external dependencies (`clickhouse-cpp` and `fmtlog`).
|
||||
Also make sure you have `libzstd-dev` version > 1.5.X.
|
||||
|
||||
From the repository using build_oai:
|
||||
|
||||
```shell
|
||||
cd cmake_targets
|
||||
./build_oai --gNB --nrUE --cmake-opt -DT_RECORD_DB=ON
|
||||
```
|
||||
|
||||
Or, from an existing build directory using cmake:
|
||||
|
||||
```shell
|
||||
cd cmake_targets/ran_build/build
|
||||
cmake -DT_RECORD_DB=ON .
|
||||
# use make or ninja
|
||||
make T_tools
|
||||
```
|
||||
|
||||
The binary is then available in:
|
||||
|
||||
```shell
|
||||
cmake_targets/ran_build/build/common/utils/T/tracer/record_db
|
||||
```
|
||||
|
||||
**NOTE*: Unlike other docs on T Tracer for `record_db` we are building in cmake
|
||||
directory rather than in the directory of T.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- a running ClickHouse server reachable from `record_db`
|
||||
- an OAI softmodem started with T tracer enabled, typically with `--T_stdout 2`
|
||||
- the tracer message description file, usually `common/utils/T/T_messages.txt`
|
||||
|
||||
By default `record_db` connects to:
|
||||
|
||||
- T tracer endpoint: `127.0.0.1:2021`
|
||||
- ClickHouse native endpoint: `localhost:9000`
|
||||
- ClickHouse database: `oai`
|
||||
|
||||
## Start the softmodem
|
||||
|
||||
Start the gNB or UE with T tracer enabled as described in
|
||||
[basic usage](./basic.md). For example:
|
||||
|
||||
```shell
|
||||
cd cmake_targets/ran_build/build
|
||||
sudo ./nr-softmodem -O <config-file> --T_stdout 2 --T_nowait
|
||||
```
|
||||
|
||||
Use `--T_port <port>` on the softmodem side if you want a port other
|
||||
than `2021`, and pass the same value to `record_db` with `-p`.
|
||||
|
||||
## Basic example
|
||||
|
||||
To enable all events except the most verbose groups and write them to
|
||||
ClickHouse:
|
||||
|
||||
```shell
|
||||
cd cmake_targets/ran_build/build/
|
||||
./common/utils/T/tracer/record_db -d ../../../common/utils/T/T_messages.txt \
|
||||
-ON \
|
||||
-off VCD \
|
||||
-off HEAVY \
|
||||
-off LEGACY_GROUP_TRACE \
|
||||
-off LEGACY_GROUP_DEBUG
|
||||
```
|
||||
|
||||
To stop recording, press `Ctrl-C`. The tool flushes pending buffered
|
||||
rows before exiting.
|
||||
|
||||
## Select specific events
|
||||
|
||||
The event selection rules are the same as for [`record`](./record.md):
|
||||
|
||||
- `-ON` enables all events
|
||||
- `-OFF` disables all events
|
||||
- `-on <GROUP or ID>` enables one group or one event
|
||||
- `-off <GROUP or ID>` disables one group or one event
|
||||
|
||||
These options are processed in order. For example:
|
||||
|
||||
```shell
|
||||
./common/utils/T/tracer/record_db -d ../../../common/utils/T/T_messages.txt -OFF -on GNB_PHY_UL_FD_PUSCH_IQ -on GNB_PHY_UL_PAYLOAD_RX_BITS
|
||||
```
|
||||
|
||||
This starts from everything disabled and enables only the two listed
|
||||
events.
|
||||
|
||||
## ClickHouse options
|
||||
|
||||
`record_db` accepts the following database-related options:
|
||||
|
||||
```shell
|
||||
-ch-host <host> ClickHouse host, default `localhost`
|
||||
-ch-port <port> ClickHouse native port, default `9000`
|
||||
-ch-db <database> database name, default `oai`
|
||||
-ch-user <user> optional ClickHouse user
|
||||
-ch-pass <password> optional ClickHouse password
|
||||
-ch-droptables drop the target database before starting
|
||||
-debug enable debug logging
|
||||
```
|
||||
|
||||
Example using a remote ClickHouse instance:
|
||||
|
||||
```shell
|
||||
./record_db -d ../T_messages.txt \
|
||||
-ON -off HEAVY \
|
||||
-ip 192.168.1.10 -p 2021 \
|
||||
-ch-host 192.168.1.20 -ch-port 9000 -ch-db oai_traces
|
||||
```
|
||||
|
||||
## Inspect the data
|
||||
|
||||
Once `record_db` is running, connect to ClickHouse and inspect the
|
||||
generated tables:
|
||||
|
||||
```shell
|
||||
clickhouse-client --host localhost --port 9000 --query "SHOW TABLES FROM oai"
|
||||
```
|
||||
|
||||
Count rows in one event table:
|
||||
|
||||
```shell
|
||||
clickhouse-client --host localhost --port 9000 --query "SELECT count(*) FROM oai.GNB_PHY_UL_FD_PUSCH_IQ"
|
||||
```
|
||||
|
||||
Inspect the latest samples:
|
||||
|
||||
```shell
|
||||
clickhouse-client --host localhost --port 9000 --query "SELECT * FROM oai.GNB_PHY_UL_FD_PUSCH_IQ ORDER BY TsSwNs DESC LIMIT 5"
|
||||
```
|
||||
|
||||
## Important behavior
|
||||
|
||||
- Tables are created only for enabled events.
|
||||
- Table names match the event names from `T_messages.txt`.
|
||||
- The current implementation creates tables with ClickHouse
|
||||
`ENGINE = Memory()`.
|
||||
- Because of that engine choice, recorded data remains available while
|
||||
ClickHouse is running, but is not persistent across a ClickHouse
|
||||
restart.
|
||||
- If `-ch-droptables` is used, the whole target database is dropped and
|
||||
recreated before capture starts.
|
||||
|
||||
## Get the full option list
|
||||
|
||||
```shell
|
||||
./record_db -h
|
||||
```
|
||||
@@ -89,6 +89,7 @@ static int get_message(int s)
|
||||
|
||||
static void *T_receive_thread(void *_)
|
||||
{
|
||||
UNUSED(_);
|
||||
int err = 0;
|
||||
while (!err) err = get_message(T_socket);
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
*/
|
||||
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
|
||||
{
|
||||
UNUSED(file);
|
||||
UNUSED(function);
|
||||
UNUSED(line);
|
||||
UNUSED(s);
|
||||
if (assert) {
|
||||
abort();
|
||||
} else {
|
||||
|
||||
@@ -428,7 +428,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
|
||||
for (i = 0; i < 8; i++)
|
||||
timeline_set_subline_background_color(g, timeline_plot, i,
|
||||
new_color(g, i==0 || i==4 ? "#aaf" : "#eee"));
|
||||
timeview = new_view_time(3600, 10, g, timeline_plot);
|
||||
timeview = new_view_time(10, g, timeline_plot);
|
||||
/* DL tick logging */
|
||||
timelog = new_timelog(h, database, "ENB_PHY_DL_TICK");
|
||||
subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000);
|
||||
|
||||
@@ -41,6 +41,7 @@ int eval_eq(struct filter *f, event e)
|
||||
|
||||
int eval_int(struct filter *f, event e)
|
||||
{
|
||||
UNUSED(e);
|
||||
return f->v.v;
|
||||
}
|
||||
|
||||
@@ -152,9 +153,9 @@ filter *filter_evarg(void *database, char *event_name, char *varname)
|
||||
return ret;
|
||||
}
|
||||
|
||||
filter *filter_evfun(void *database, int (*fun)(void *priv, int v),
|
||||
void *priv, filter *x)
|
||||
filter *filter_evfun(void *database, int (*fun)(void *priv, int v), void *priv, filter *x)
|
||||
{
|
||||
UNUSED(database);
|
||||
struct filter *ret = calloc(1, sizeof(struct filter));
|
||||
if (ret == NULL) abort();
|
||||
ret->eval = eval_evfun;
|
||||
|
||||
@@ -13,11 +13,8 @@ filter *filter_and(filter *a, filter *b);
|
||||
filter *filter_eq(filter *a, filter *b);
|
||||
filter *filter_int(int v);
|
||||
filter *filter_evarg(void *database, char *event_name, char *varname);
|
||||
filter *filter_evfun(void *database, int (*fun)(void *priv, int v),
|
||||
void *priv, filter *x);
|
||||
|
||||
filter *filter_evfun(void *database, int (*fun)(void *priv, int v), void *priv, filter *x);
|
||||
int filter_eval(filter *f, event e);
|
||||
|
||||
void free_filter(filter *f);
|
||||
|
||||
#endif /* _FILTER_H_ */
|
||||
|
||||
@@ -52,8 +52,7 @@ event_handler *new_handler(void *database)
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned long register_handler_function(event_handler *_h, int event_id,
|
||||
void (*f)(void *, event), void *p)
|
||||
unsigned long register_handler_function(event_handler *_h, int event_id, void (*f)(void *, event), void *p)
|
||||
{
|
||||
struct _event_handler *h = _h;
|
||||
unsigned long ret = h->next_id;
|
||||
@@ -78,9 +77,11 @@ unsigned long register_handler_function(event_handler *_h, int event_id,
|
||||
return ret;
|
||||
}
|
||||
|
||||
void remove_handler_function(event_handler *h, int event_id,
|
||||
unsigned long handler_id)
|
||||
void remove_handler_function(event_handler *h, int event_id, unsigned long handler_id)
|
||||
{
|
||||
UNUSED(h);
|
||||
UNUSED(event_id);
|
||||
UNUSED(handler_id);
|
||||
printf("%s:%d: TODO\n", __FILE__, __LINE__);
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -11,10 +11,7 @@ typedef void event_handler;
|
||||
|
||||
event_handler *new_handler(void *database);
|
||||
void handle_event(event_handler *h, event e);
|
||||
|
||||
unsigned long register_handler_function(event_handler *_h, int event_id,
|
||||
void (*f)(void *, event), void *p);
|
||||
void remove_handler_function(event_handler *h, int event_id,
|
||||
unsigned long handler_id);
|
||||
unsigned long register_handler_function(event_handler *_h, int event_id, void (*f)(void *, event), void *p);
|
||||
void remove_handler_function(event_handler *h, int event_id, unsigned long handler_id);
|
||||
|
||||
#endif /* _HANDLER_H_ */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "handler.h"
|
||||
#include "database.h"
|
||||
#include "view/view.h"
|
||||
#include "utils.h"
|
||||
#include "../utils.h"
|
||||
#include "filter/filter.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -406,7 +406,7 @@ void sr(void *_d, event e)
|
||||
|
||||
void trace_nr(struct timespec sending_time, ev_data *d, int direction,
|
||||
int rnti_type, int rnti, int frame, int slot, int harq_pid, void *buf,
|
||||
int bufsize, int preamble)
|
||||
int bufsize)
|
||||
{
|
||||
ssize_t ret;
|
||||
int i;
|
||||
@@ -475,7 +475,7 @@ void nr_ul(void *_d, event e)
|
||||
NR_C_RNTI, e.e[d->nr_ul_rnti].i,
|
||||
e.e[d->nr_ul_frame].i, e.e[d->nr_ul_slot].i,
|
||||
e.e[d->nr_ul_harq_pid].i, e.e[d->nr_ul_data].b,
|
||||
e.e[d->nr_ul_data].bsize, NO_PREAMBLE);
|
||||
e.e[d->nr_ul_data].bsize);
|
||||
}
|
||||
|
||||
void nr_dl(void *_d, event e)
|
||||
@@ -494,7 +494,7 @@ void nr_dl(void *_d, event e)
|
||||
e.e[d->nr_dl_rnti].i != 0xffff ? NR_C_RNTI : NR_SI_RNTI,
|
||||
e.e[d->nr_dl_rnti].i, e.e[d->nr_dl_frame].i, e.e[d->nr_dl_slot].i,
|
||||
e.e[d->nr_dl_harq_pid].i, e.e[d->nr_dl_data].b,
|
||||
e.e[d->nr_dl_data].bsize, NO_PREAMBLE);
|
||||
e.e[d->nr_dl_data].bsize);
|
||||
}
|
||||
|
||||
void nr_dl_retx(void *_d, event e)
|
||||
@@ -505,7 +505,7 @@ void nr_dl_retx(void *_d, event e)
|
||||
NR_C_RNTI, e.e[d->nr_dl_retx_rnti].i,
|
||||
e.e[d->nr_dl_retx_frame].i, e.e[d->nr_dl_retx_slot].i,
|
||||
e.e[d->nr_dl_retx_harq_pid].i, e.e[d->nr_dl_retx_data].b,
|
||||
e.e[d->nr_dl_retx_data].bsize, NO_PREAMBLE);
|
||||
e.e[d->nr_dl_retx_data].bsize);
|
||||
}
|
||||
|
||||
void nr_mib(void *_d, event e)
|
||||
@@ -520,7 +520,7 @@ void nr_mib(void *_d, event e)
|
||||
|
||||
trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0,
|
||||
e.e[d->nr_mib_frame].i, e.e[d->nr_mib_slot].i, 0 /* harq pid */,
|
||||
e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize, NO_PREAMBLE);
|
||||
e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize);
|
||||
}
|
||||
|
||||
void nr_ue_mib(void *_d, event e)
|
||||
@@ -535,7 +535,7 @@ void nr_ue_mib(void *_d, event e)
|
||||
|
||||
trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0,
|
||||
e.e[d->nr_ue_mib_frame].i, e.e[d->nr_ue_mib_slot].i, 0 /* harq pid */,
|
||||
e.e[d->nr_ue_mib_data].b, e.e[d->nr_ue_mib_data].bsize, NO_PREAMBLE);
|
||||
e.e[d->nr_ue_mib_data].b, e.e[d->nr_ue_mib_data].bsize);
|
||||
}
|
||||
|
||||
void nr_rar(void *_d, event e)
|
||||
@@ -545,7 +545,7 @@ void nr_rar(void *_d, event e)
|
||||
trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK,
|
||||
NR_RA_RNTI, e.e[d->nr_rar_rnti].i,
|
||||
e.e[d->nr_rar_frame].i, e.e[d->nr_rar_slot].i, 0 /* harq pid */,
|
||||
e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize, NO_PREAMBLE);
|
||||
e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize);
|
||||
}
|
||||
|
||||
void nr_ue_ul(void *_d, event e)
|
||||
@@ -556,7 +556,7 @@ void nr_ue_ul(void *_d, event e)
|
||||
NR_C_RNTI, e.e[d->nr_ue_ul_rnti].i,
|
||||
e.e[d->nr_ue_ul_frame].i, e.e[d->nr_ue_ul_slot].i,
|
||||
e.e[d->nr_ue_ul_harq_pid].i, e.e[d->nr_ue_ul_data].b,
|
||||
e.e[d->nr_ue_ul_data].bsize, NO_PREAMBLE);
|
||||
e.e[d->nr_ue_ul_data].bsize);
|
||||
}
|
||||
|
||||
void nr_ue_dl(void *_d, event e)
|
||||
@@ -575,7 +575,7 @@ void nr_ue_dl(void *_d, event e)
|
||||
e.e[d->nr_ue_dl_rnti].i != 0xffff ? NR_C_RNTI : NR_SI_RNTI,
|
||||
e.e[d->nr_ue_dl_rnti].i, e.e[d->nr_ue_dl_frame].i,
|
||||
e.e[d->nr_ue_dl_slot].i, e.e[d->nr_ue_dl_harq_pid].i,
|
||||
e.e[d->nr_ue_dl_data].b, e.e[d->nr_ue_dl_data].bsize, NO_PREAMBLE);
|
||||
e.e[d->nr_ue_dl_data].b, e.e[d->nr_ue_dl_data].bsize);
|
||||
}
|
||||
|
||||
void nr_ue_rar(void *_d, event e)
|
||||
@@ -584,8 +584,7 @@ void nr_ue_rar(void *_d, event e)
|
||||
trace_nr(e.sending_time, d, DIRECTION_DOWNLINK,
|
||||
RA_RNTI, e.e[d->nr_ue_rar_rnti].i,
|
||||
e.e[d->nr_ue_rar_frame].i, e.e[d->nr_ue_rar_slot].i, 0,
|
||||
e.e[d->nr_ue_rar_data].b, e.e[d->nr_ue_rar_data].bsize,
|
||||
NO_PREAMBLE);
|
||||
e.e[d->nr_ue_rar_data].b, e.e[d->nr_ue_rar_data].bsize);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@@ -961,7 +960,7 @@ static int sock = -1;
|
||||
|
||||
void force_stop(int x)
|
||||
{
|
||||
printf("\ngently quit...\n");
|
||||
printf("\ngently quit(%d)...\n", x);
|
||||
close(sock);
|
||||
sock = -1;
|
||||
run = 0;
|
||||
|
||||
@@ -39,7 +39,7 @@ static int socket = -1;
|
||||
|
||||
void force_stop(int x)
|
||||
{
|
||||
printf("\ngently quit...\n");
|
||||
printf("\ngently quit (%d)...\n", x);
|
||||
close(socket);
|
||||
socket = -1;
|
||||
run = 0;
|
||||
|
||||
@@ -249,7 +249,7 @@ static int socket_fd = -1;
|
||||
|
||||
void force_stop(int x)
|
||||
{
|
||||
logi("gently quit...");
|
||||
logi("gently quit %d", x);
|
||||
close(socket_fd);
|
||||
socket_fd = -1;
|
||||
run = 0;
|
||||
@@ -785,12 +785,7 @@ uint8_t should_insert(EventBuffer &buf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int insert_event(clickhouse_config_t *ch,
|
||||
void *database,
|
||||
int event_id,
|
||||
const char *event_data,
|
||||
int data_length,
|
||||
std::chrono::high_resolution_clock::time_point t_start)
|
||||
int insert_event(clickhouse_config_t *ch, int event_id, const char *event_data, int data_length)
|
||||
{
|
||||
auto t_fn_start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
@@ -1270,14 +1265,12 @@ int main(int n, char **v)
|
||||
if (fullread(socket_fd, v + vpos, length) == -1)
|
||||
goto read_error;
|
||||
|
||||
auto t_start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
if (type == -1) {
|
||||
append_received_config_chunk(v + vpos, length);
|
||||
} else if (type == -2) {
|
||||
verify_config();
|
||||
} else if (type >= 0 && type < number_of_events && is_on[type]) {
|
||||
if (insert_event(&ch_config, database, type, v + vpos, length, t_start) != 0) {
|
||||
if (insert_event(&ch_config, type, v + vpos, length) != 0) {
|
||||
loge("Failed to insert event type {}", type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database,
|
||||
for (i = 0; i < 8; i++)
|
||||
timeline_set_subline_background_color(g, timeline_plot, i,
|
||||
new_color(g, i==0 || i==4 ? "#aaf" : "#eee"));
|
||||
timeview = new_view_time(3600, 10, g, timeline_plot);
|
||||
timeview = new_view_time(10, g, timeline_plot);
|
||||
/* DL tick logging */
|
||||
timelog = new_timelog(h, database, "UE_PHY_DL_TICK");
|
||||
subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef _UTILS_H_
|
||||
#define _UTILS_H_
|
||||
|
||||
#define UNUSED(x) (void)x
|
||||
|
||||
void new_thread(void *(*f)(void *), void *data);
|
||||
void sleepms(int ms);
|
||||
void bps(char *out, float v, char *suffix);
|
||||
|
||||
@@ -100,7 +100,7 @@ static void vcd_main_gui(gui *g, event_handler *h, void *database)
|
||||
for (i = 0; i < nb_functions; i++)
|
||||
timeline_set_subline_background_color(g, w, i,
|
||||
new_color(g, i & 1 ? "#ddd" : "#eee"));
|
||||
timeview = new_view_time(3600, 10, g, w);
|
||||
timeview = new_view_time(10, g, w);
|
||||
i = 0;
|
||||
for (j = 0; j < n; j++) {
|
||||
if (strncmp(ids[j], "VCD_FUNCTION_", 13) != 0) continue;
|
||||
|
||||
@@ -70,6 +70,7 @@ static void *scrolltti_thread(void *_this)
|
||||
static void clear(view *this)
|
||||
{
|
||||
/* TODO */
|
||||
UNUSED(this);
|
||||
}
|
||||
|
||||
static void insert(struct scrolltti *this, double value)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
#include "view.h"
|
||||
#include "../utils.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
@@ -15,6 +16,7 @@ struct stdout {
|
||||
static void clear(view *this)
|
||||
{
|
||||
/* do nothing */
|
||||
UNUSED(this);
|
||||
}
|
||||
|
||||
static void append(view *_this, char *s)
|
||||
|
||||
@@ -71,6 +71,7 @@ static void *textlist_thread(void *_this)
|
||||
static void clear(view *this)
|
||||
{
|
||||
/* TODO */
|
||||
UNUSED(this);
|
||||
}
|
||||
|
||||
static void append(view *_this, char *s)
|
||||
@@ -120,9 +121,11 @@ static void scroll(void *private, gui *g,
|
||||
if (pthread_mutex_unlock(&this->lock)) abort();
|
||||
}
|
||||
|
||||
static void click(void *private, gui *g,
|
||||
char *notification, widget *w, void *notification_data)
|
||||
static void click(void *private, gui *g, char *notification, widget *w, void *notification_data)
|
||||
{
|
||||
UNUSED(notification);
|
||||
UNUSED(g);
|
||||
UNUSED(w);
|
||||
struct textlist *this = private;
|
||||
int *d = notification_data;
|
||||
int button = d[1];
|
||||
|
||||
@@ -164,9 +164,10 @@ static void *ticktime_thread(void *_this)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void scroll(void *private, gui *g,
|
||||
char *notification, widget *w, void *notification_data)
|
||||
static void scroll(void *private, gui *g, char *notification, widget *w, void *notification_data)
|
||||
{
|
||||
UNUSED(g);
|
||||
UNUSED(w);
|
||||
struct ticktime *this = private;
|
||||
int *d = notification_data;
|
||||
int x = d[0];
|
||||
@@ -225,9 +226,11 @@ end:
|
||||
if (pthread_mutex_unlock(&this->lock)) abort();
|
||||
}
|
||||
|
||||
static void click(void *private, gui *g,
|
||||
char *notification, widget *w, void *notification_data)
|
||||
static void click(void *private, gui *g, char *notification, widget *w, void *notification_data)
|
||||
{
|
||||
UNUSED(g);
|
||||
UNUSED(w);
|
||||
UNUSED(notification);
|
||||
struct ticktime *this = private;
|
||||
int *d = notification_data;
|
||||
int button = *d;
|
||||
@@ -365,9 +368,9 @@ struct clock_ticktime {
|
||||
struct ticktime *parent;
|
||||
};
|
||||
|
||||
static void clock_append(view *_this, struct timespec t,
|
||||
int frame, int subframe)
|
||||
static void clock_append(view *_this, struct timespec t, int frame, int subframe)
|
||||
{
|
||||
UNUSED(t);
|
||||
struct clock_ticktime *this = (struct clock_ticktime *)_this;
|
||||
struct ticktime *tt = this->parent;
|
||||
int64_t diff;
|
||||
|
||||
@@ -156,9 +156,10 @@ static void *time_thread(void *_this)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void scroll(void *private, gui *g,
|
||||
char *notification, widget *w, void *notification_data)
|
||||
static void scroll(void *private, gui *g, char *notification, widget *w, void *notification_data)
|
||||
{
|
||||
UNUSED(g);
|
||||
UNUSED(w);
|
||||
struct time *this = private;
|
||||
int *d = notification_data;
|
||||
int x = d[0];
|
||||
@@ -217,9 +218,11 @@ end:
|
||||
if (pthread_mutex_unlock(&this->lock)) abort();
|
||||
}
|
||||
|
||||
static void click(void *private, gui *g,
|
||||
char *notification, widget *w, void *notification_data)
|
||||
static void click(void *private, gui *g, char *notification, widget *w, void *notification_data)
|
||||
{
|
||||
UNUSED(g);
|
||||
UNUSED(w);
|
||||
UNUSED(notification);
|
||||
struct time *this = private;
|
||||
int *d = notification_data;
|
||||
int button = *d;
|
||||
@@ -228,8 +231,7 @@ static void click(void *private, gui *g,
|
||||
if (button == 1) this->autoscroll = 1;
|
||||
}
|
||||
|
||||
view *new_view_time(int number_of_seconds, float refresh_rate,
|
||||
gui *g, widget *w)
|
||||
view *new_view_time(float refresh_rate, gui *g, widget *w)
|
||||
{
|
||||
struct time *ret = calloc(1, sizeof(struct time));
|
||||
if (ret == NULL) abort();
|
||||
|
||||
@@ -94,6 +94,7 @@ static void *tti_thread(void *_this)
|
||||
static void clear(view *this)
|
||||
{
|
||||
/* TODO */
|
||||
UNUSED(this);
|
||||
}
|
||||
|
||||
static void append(view *_this, int frame, int tick, double value)
|
||||
|
||||
@@ -19,14 +19,10 @@ enum xy_mode { XY_LOOP_MODE, XY_FORCED_MODE };
|
||||
|
||||
view *new_view_stdout(void);
|
||||
view *new_view_textlist(int maxsize, float refresh_rate, gui *g, widget *w);
|
||||
view *new_view_xy(int length, float refresh_rate, gui *g, widget *w,
|
||||
int color, enum xy_mode mode);
|
||||
view *new_view_tti(float refresh_rate, gui *g, widget *w, int color,
|
||||
int ticks_per_frame);
|
||||
view *new_view_scrolltti(float refresh_rate, gui *g, widget *w,
|
||||
int color, widget *throughput_label, int ticks_per_frame);
|
||||
view *new_view_time(int number_of_seconds, float refresh_rate,
|
||||
gui *g, widget *w);
|
||||
view *new_view_xy(int length, float refresh_rate, gui *g, widget *w, int color, enum xy_mode mode);
|
||||
view *new_view_tti(float refresh_rate, gui *g, widget *w, int color, int ticks_per_frame);
|
||||
view *new_view_scrolltti(float refresh_rate, gui *g, widget *w, int color, widget *throughput_label, int ticks_per_frame);
|
||||
view *new_view_time(float refresh_rate, gui *g, widget *w);
|
||||
view *new_subview_time(view *time, int line, int color, int size);
|
||||
view *new_view_ticktime(float refresh_rate, gui *g, widget *w);
|
||||
view *new_subview_ticktime(view *ticktime, int line, int color, int size);
|
||||
|
||||
@@ -42,6 +42,7 @@ static void *xy_thread(void *_this)
|
||||
static void clear(view *this)
|
||||
{
|
||||
/* TODO */
|
||||
UNUSED(this);
|
||||
}
|
||||
|
||||
static void append_loop(view *_this, float *x, float *y, int length)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#ifndef ACTOR_H
|
||||
#define ACTOR_H
|
||||
#include "notified_fifo.h"
|
||||
#include "common/utils/threadPool/notified_fifo.h"
|
||||
|
||||
#define INIT_ACTOR(ptr, name, core_affinity) init_actor((Actor_t *)ptr, name, core_affinity);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ add_library(ds OBJECT
|
||||
seq_arr.c
|
||||
hashtable.c
|
||||
obj_hashtable.c
|
||||
spsc_q.c
|
||||
)
|
||||
|
||||
target_include_directories(ds PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
@@ -10,42 +10,15 @@
|
||||
#include "assertions.h"
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
char *hashtable_rc_code2string(hashtable_rc_t rcP)
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
{
|
||||
switch (rcP) {
|
||||
case HASH_TABLE_OK:
|
||||
return "HASH_TABLE_OK";
|
||||
break;
|
||||
|
||||
case HASH_TABLE_INSERT_OVERWRITTEN_DATA:
|
||||
return "HASH_TABLE_INSERT_OVERWRITTEN_DATA";
|
||||
break;
|
||||
|
||||
case HASH_TABLE_KEY_NOT_EXISTS:
|
||||
return "HASH_TABLE_KEY_NOT_EXISTS";
|
||||
break;
|
||||
|
||||
case HASH_TABLE_KEY_ALREADY_EXISTS:
|
||||
return "HASH_TABLE_KEY_ALREADY_EXISTS";
|
||||
break;
|
||||
|
||||
case HASH_TABLE_BAD_PARAMETER_HASHTABLE:
|
||||
return "HASH_TABLE_BAD_PARAMETER_HASHTABLE";
|
||||
break;
|
||||
|
||||
default:
|
||||
return "UNKNOWN hashtable_rc_t";
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
* free int function
|
||||
* hash_free_int_func() is used when this hashtable is used to store int values as data (pointer = value).
|
||||
*/
|
||||
|
||||
void hash_free_int_func(void *memoryP) {}
|
||||
void hash_free_int_func(void *memoryP)
|
||||
{
|
||||
UNUSED(memoryP);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
@@ -144,41 +117,6 @@ hashtable_rc_t hashtable_is_key_exists (const hash_table_t *const hashtblP, cons
|
||||
|
||||
return HASH_TABLE_KEY_NOT_EXISTS;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
hashtable_rc_t hashtable_dump_content (const hash_table_t *const hashtblP, char *const buffer_pP, int *const remaining_bytes_in_buffer_pP )
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
{
|
||||
hash_node_t *node = NULL;
|
||||
unsigned int i = 0;
|
||||
|
||||
if (hashtblP == NULL) {
|
||||
*remaining_bytes_in_buffer_pP = snprintf(
|
||||
buffer_pP,
|
||||
*remaining_bytes_in_buffer_pP,
|
||||
"HASH_TABLE_BAD_PARAMETER_HASHTABLE");
|
||||
return HASH_TABLE_BAD_PARAMETER_HASHTABLE;
|
||||
}
|
||||
|
||||
while ((i < hashtblP->size) && (*remaining_bytes_in_buffer_pP > 0)) {
|
||||
if (hashtblP->nodes[i] != NULL) {
|
||||
node=hashtblP->nodes[i];
|
||||
|
||||
while(node) {
|
||||
*remaining_bytes_in_buffer_pP = snprintf(
|
||||
buffer_pP,
|
||||
*remaining_bytes_in_buffer_pP,
|
||||
"Key 0x%"PRIx64" Element %p\n",
|
||||
node->key,
|
||||
node->data);
|
||||
node=node->next;
|
||||
}
|
||||
}
|
||||
|
||||
i += 1;
|
||||
}
|
||||
|
||||
return HASH_TABLE_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
|
||||
@@ -44,12 +44,10 @@ typedef struct hash_table_iterator_s {
|
||||
const hash_table_t* const hashtbl;
|
||||
} hash_table_iterator_s;
|
||||
|
||||
char *hashtable_rc_code2string(hashtable_rc_t rcP);
|
||||
void hash_free_int_func(void *memoryP);
|
||||
hash_table_t *hashtable_create (const hash_size_t size, hash_size_t (*hashfunc)(const hash_key_t ), void (*freefunc)(void *));
|
||||
hashtable_rc_t hashtable_destroy(hash_table_t **hashtbl);
|
||||
hashtable_rc_t hashtable_is_key_exists (const hash_table_t *const hashtbl, const uint64_t key);
|
||||
hashtable_rc_t hashtable_dump_content (const hash_table_t *const hashtblP, char *const buffer_pP, int *const remaining_bytes_in_buffer_pP );
|
||||
hashtable_rc_t hashtable_insert (hash_table_t *const hashtbl, const hash_key_t key, void *data);
|
||||
hashtable_rc_t hashtable_remove (hash_table_t *const hashtbl, const hash_key_t key);
|
||||
hashtable_rc_t hashtable_get (const hash_table_t *const hashtbl, const hash_key_t key, void **dataP);
|
||||
|
||||
90
common/utils/ds/spsc_q.c
Normal file
90
common/utils/ds/spsc_q.c
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "spsc_q.h"
|
||||
|
||||
spsc_q_t spsc_q_alloc(size_t cnt, size_t elsiz)
|
||||
{
|
||||
/* internally, use one element more: the ringbuffer is full if
|
||||
* (write_idx + 1) % cnt == read_idx, so it's full if one element is still
|
||||
* free (because otherwise write_idx == read_idx, but this is the empty
|
||||
* condition) */
|
||||
cnt += 1;
|
||||
spsc_q_t rb = {.cnt = cnt, .elsiz = elsiz};
|
||||
rb.buf = calloc(cnt, elsiz);
|
||||
return rb;
|
||||
}
|
||||
|
||||
void spsc_q_free(spsc_q_t *rb)
|
||||
{
|
||||
free(rb->buf);
|
||||
memset(rb, 0, sizeof(*rb));
|
||||
}
|
||||
|
||||
bool spsc_q_put(spsc_q_t *rb, const void *src, size_t elsiz)
|
||||
{
|
||||
assert(elsiz == rb->elsiz);
|
||||
size_t w = atomic_load_explicit(&rb->write_idx, memory_order_relaxed);
|
||||
size_t r = atomic_load_explicit(&rb->read_idx, memory_order_acquire);
|
||||
if ((w + 1) % rb->cnt == r) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t *bufpos = &rb->buf[w * rb->elsiz];
|
||||
memcpy(bufpos, src, elsiz);
|
||||
atomic_store_explicit(&rb->write_idx, (w + 1) % rb->cnt, memory_order_release);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool spsc_q_get_if(spsc_q_t *rb, pred p, void *user, void *dest, size_t elsiz)
|
||||
{
|
||||
assert(elsiz == rb->elsiz);
|
||||
size_t w = atomic_load_explicit(&rb->write_idx, memory_order_acquire);
|
||||
size_t r = atomic_load_explicit(&rb->read_idx, memory_order_relaxed);
|
||||
if (w == r) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t *bufpos = &rb->buf[rb->read_idx * rb->elsiz];
|
||||
if (!p(bufpos, user)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dest)
|
||||
memcpy(dest, bufpos, elsiz);
|
||||
atomic_store_explicit(&rb->read_idx, (r + 1) % rb->cnt, memory_order_release);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool always(const void *data, void *user)
|
||||
{
|
||||
(void) data;
|
||||
(void) user;
|
||||
return true;
|
||||
}
|
||||
bool spsc_q_get(spsc_q_t *rb, void *dest, size_t elsiz)
|
||||
{
|
||||
return spsc_q_get_if(rb, always, NULL, dest, elsiz);
|
||||
}
|
||||
|
||||
int spsc_q_get_while(spsc_q_t *rb, pred p, void *user, void *dest, size_t elsiz, size_t max_len)
|
||||
{
|
||||
assert(elsiz == rb->elsiz);
|
||||
size_t count = 0;
|
||||
while (count < max_len && spsc_q_get_if(rb, p, user, dest + elsiz * count, elsiz))
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
int spsc_q_drop_while(spsc_q_t *rb, pred p, void *user)
|
||||
{
|
||||
size_t dropped = 0;
|
||||
while (spsc_q_get_if(rb, p, user, NULL, rb->elsiz))
|
||||
dropped++;
|
||||
return dropped;
|
||||
}
|
||||
37
common/utils/ds/spsc_q.h
Normal file
37
common/utils/ds/spsc_q.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#ifndef SPSC_Q_H_
|
||||
#define SPSC_Q_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdatomic.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
// use atomic_size_t to help interworking with C++
|
||||
using std::atomic_size_t;
|
||||
#endif
|
||||
|
||||
typedef struct spsc_q {
|
||||
uint8_t *buf;
|
||||
size_t elsiz;
|
||||
size_t cnt;
|
||||
|
||||
atomic_size_t write_idx;
|
||||
atomic_size_t read_idx;
|
||||
} spsc_q_t;
|
||||
|
||||
spsc_q_t spsc_q_alloc(size_t cnt, size_t elsiz);
|
||||
void spsc_q_free(spsc_q_t *rb);
|
||||
|
||||
bool spsc_q_put(spsc_q_t *rb, const void *src, size_t elsiz);
|
||||
bool spsc_q_get(spsc_q_t *rb, void *dest, size_t elsiz);
|
||||
|
||||
typedef bool (*pred)(const void *data, void *user);
|
||||
bool spsc_q_get_if(spsc_q_t *rb, pred p, void *user, void *dest, size_t elsiz);
|
||||
int spsc_q_drop_while(spsc_q_t *rb, pred p, void *user);
|
||||
int spsc_q_get_while(spsc_q_t *rb, pred p, void *user, void *dest, size_t elsiz, size_t max_len);
|
||||
|
||||
#endif /* SPSC_Q_H_ */
|
||||
@@ -8,5 +8,11 @@ add_test(NAME test_seq_arr COMMAND test_seq_arr) # no options required
|
||||
add_executable(test_hashtable test_hashtable.cpp)
|
||||
add_dependencies(tests test_hashtable)
|
||||
target_link_libraries(test_hashtable PRIVATE ds GTest::gtest)
|
||||
add_test(NAME test_hashtable
|
||||
COMMAND ./test_hashtable)
|
||||
add_test(NAME test_hashtable COMMAND ./test_hashtable)
|
||||
|
||||
add_executable(test_spsc_q test_spsc_q.cpp)
|
||||
target_link_libraries(test_spsc_q ds GTest::gtest)
|
||||
add_dependencies(tests test_spsc_q)
|
||||
add_test(NAME test_spsc_q COMMAND test_spsc_q)
|
||||
add_executable(test_spsc_q_perf test_spsc_q_perf.cpp)
|
||||
target_link_libraries(test_spsc_q_perf PRIVATE ds benchmark::benchmark)
|
||||
|
||||
135
common/utils/ds/tests/test_spsc_q.cpp
Normal file
135
common/utils/ds/tests/test_spsc_q.cpp
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
extern "C" {
|
||||
#include "spsc_q.h"
|
||||
}
|
||||
|
||||
TEST(spsc_q, basic_test) {
|
||||
spsc_q_t rb = spsc_q_alloc(2, sizeof(int));
|
||||
|
||||
int a = 1;
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
EXPECT_FALSE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
|
||||
int b;
|
||||
EXPECT_TRUE(spsc_q_get(&rb, &b, sizeof(b)));
|
||||
EXPECT_EQ(a, b);
|
||||
EXPECT_TRUE(spsc_q_get(&rb, &b, sizeof(b)));
|
||||
EXPECT_EQ(a, b);
|
||||
EXPECT_FALSE(spsc_q_get(&rb, &b, sizeof(b)));
|
||||
|
||||
spsc_q_free(&rb);
|
||||
}
|
||||
|
||||
TEST(spsc_q, cont_write) {
|
||||
spsc_q_t rb = spsc_q_alloc(10, sizeof(int));
|
||||
|
||||
int a = 1;
|
||||
for (int i = 0; i < 1111; ++i) {
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
a++;
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
a++;
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
a++;
|
||||
|
||||
int b;
|
||||
EXPECT_TRUE(spsc_q_get(&rb, &b, sizeof(b)));
|
||||
EXPECT_EQ(b, a - 3);
|
||||
EXPECT_TRUE(spsc_q_get(&rb, &b, sizeof(b)));
|
||||
EXPECT_EQ(b, a - 2);
|
||||
EXPECT_TRUE(spsc_q_get(&rb, &b, sizeof(b)));
|
||||
EXPECT_EQ(b, a - 1);
|
||||
}
|
||||
|
||||
spsc_q_free(&rb);
|
||||
}
|
||||
|
||||
bool count(const void *data, void *user)
|
||||
{
|
||||
EXPECT_TRUE(data != NULL);
|
||||
int *c = (int *)user;
|
||||
(*c)++;
|
||||
return true; /* count all */
|
||||
}
|
||||
TEST(spsc_q, iterator) {
|
||||
spsc_q_t rb = spsc_q_alloc(10, sizeof(int));
|
||||
int n = 8;
|
||||
for (int i = 0; i < n; ++i)
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &i, sizeof(i)));
|
||||
|
||||
int c = 0;
|
||||
int results[n];
|
||||
int ret = spsc_q_get_while(&rb, count, &c, results, sizeof(*results), n);
|
||||
EXPECT_EQ(c, n);
|
||||
EXPECT_EQ(ret, n);
|
||||
for (int i = 0; i < n; ++i)
|
||||
EXPECT_EQ(results[i], i);
|
||||
|
||||
int b;
|
||||
EXPECT_FALSE(spsc_q_get(&rb, &b, sizeof(b))); /* empty! */
|
||||
|
||||
spsc_q_free(&rb);
|
||||
}
|
||||
|
||||
bool drop(const void *data, void *user)
|
||||
{
|
||||
const int *e = (const int *)data;
|
||||
int *c = (int *)user;
|
||||
EXPECT_EQ(*e, *c);
|
||||
(*c)++;
|
||||
return true; /* drop all */
|
||||
}
|
||||
TEST(spsc_q, drop) {
|
||||
spsc_q_t rb = spsc_q_alloc(10, sizeof(int));
|
||||
int n = 8;
|
||||
for (int i = 0; i < n; ++i)
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &i, sizeof(i)));
|
||||
|
||||
int c = 0;
|
||||
int ret = spsc_q_drop_while(&rb, drop, &c);
|
||||
EXPECT_EQ(c, n);
|
||||
EXPECT_EQ(ret, n);
|
||||
|
||||
int b;
|
||||
EXPECT_FALSE(spsc_q_get(&rb, &b, sizeof(b))); /* empty! */
|
||||
|
||||
spsc_q_free(&rb);
|
||||
}
|
||||
|
||||
|
||||
TEST(spsc_q, full) {
|
||||
int n = 3;
|
||||
spsc_q_t rb = spsc_q_alloc(n, sizeof(int));
|
||||
int a = 1;
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
a++;
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
a++;
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
a++;
|
||||
EXPECT_FALSE(spsc_q_put(&rb, &a, sizeof(a))); /* full! */
|
||||
|
||||
int b;
|
||||
EXPECT_TRUE(spsc_q_get(&rb, &b, sizeof(b)));
|
||||
EXPECT_EQ(b, a - n);
|
||||
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
a++;
|
||||
EXPECT_FALSE(spsc_q_put(&rb, &a, sizeof(a))); /* full! */
|
||||
|
||||
EXPECT_TRUE(spsc_q_get(&rb, &b, sizeof(b)));
|
||||
EXPECT_EQ(b, a - n);
|
||||
|
||||
spsc_q_free(&rb);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
75
common/utils/ds/tests/test_spsc_q_perf.cpp
Normal file
75
common/utils/ds/tests/test_spsc_q_perf.cpp
Normal file
@@ -0,0 +1,75 @@
|
||||
#include "benchmark/benchmark.h"
|
||||
#include "stdio.h"
|
||||
#include "assert.h"
|
||||
#include "pthread.h"
|
||||
|
||||
extern "C" {
|
||||
#include "spsc_q.h"
|
||||
}
|
||||
|
||||
typedef struct q_args {
|
||||
spsc_q_t q;
|
||||
int range;
|
||||
} q_args_t;
|
||||
|
||||
static void *producer(void *arg)
|
||||
{
|
||||
q_args_t *a = (q_args_t *) arg;
|
||||
int i = 0;
|
||||
while (i <= a->range) {
|
||||
if (spsc_q_put(&a->q, &i, sizeof(i)))
|
||||
i++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *consumer(void *arg)
|
||||
{
|
||||
q_args_t *a = (q_args_t *) arg;
|
||||
int i = 0;
|
||||
while (i != a->range) {
|
||||
int r;
|
||||
if (spsc_q_get(&a->q, &r, sizeof(r))) {
|
||||
assert(r == i);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void run_test(int range, int q_size)
|
||||
{
|
||||
q_args_t args = {
|
||||
.q = spsc_q_alloc(q_size, sizeof(int)),
|
||||
.range = range,
|
||||
};
|
||||
|
||||
pthread_t p, c;
|
||||
int ret;
|
||||
// start
|
||||
ret = pthread_create(&p, NULL, producer, &args);
|
||||
assert(ret == 0);
|
||||
ret = pthread_create(&c, NULL, consumer, &args);
|
||||
assert(ret == 0);
|
||||
|
||||
ret = pthread_join(p, NULL);
|
||||
assert(ret == 0);
|
||||
ret = pthread_join(c, NULL);
|
||||
assert(ret == 0);
|
||||
// stop
|
||||
// data/time => throughput
|
||||
|
||||
spsc_q_free(&args.q);
|
||||
}
|
||||
|
||||
static void BM_spsc_q(benchmark::State &state)
|
||||
{
|
||||
int range = 500000;
|
||||
int q_size = state.range(0);
|
||||
for (auto _ : state)
|
||||
run_test(range, q_size);
|
||||
}
|
||||
|
||||
BENCHMARK(BM_spsc_q)->RangeMultiplier(2)->Range(10, 160);
|
||||
|
||||
BENCHMARK_MAIN();
|
||||
55
common/utils/fsn.c
Normal file
55
common/utils/fsn.c
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include "fsn.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
static int num_slots[5] = {10, 20, 40, 80, 160};
|
||||
|
||||
fsn_t fsn_add_delta(fsn_t fsn, uint32_t delta)
|
||||
{
|
||||
const int slots_frame = num_slots[fsn.mu];
|
||||
int next_f = fsn.f + delta / slots_frame;
|
||||
int next_s = fsn.s + delta % slots_frame;
|
||||
fsn_t res = {
|
||||
.f = (next_f + next_s / slots_frame) % 1024,
|
||||
.s = next_s % slots_frame,
|
||||
.mu = fsn.mu,
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
int fsn_get_diff(fsn_t a, fsn_t b)
|
||||
{
|
||||
assert(a.mu == b.mu);
|
||||
const int slots_frame = num_slots[a.mu];
|
||||
int diff = (a.f * slots_frame + a.s) - (b.f * slots_frame + b.s);
|
||||
if (diff < -512 * slots_frame)
|
||||
diff += 1024 * slots_frame;
|
||||
else if (diff > 512 * slots_frame)
|
||||
diff -= 1024 * slots_frame;
|
||||
return diff;
|
||||
}
|
||||
|
||||
fsn_t fsn_get_max(fsn_t a, fsn_t b)
|
||||
{
|
||||
if (fsn_get_diff(a, b) <= 0) {
|
||||
return b;
|
||||
} else {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
bool fsn_equal(fsn_t a, fsn_t b)
|
||||
{
|
||||
assert(a.mu == b.mu);
|
||||
return a.f == b.f && a.s == b.s && a.mu == b.mu;
|
||||
}
|
||||
|
||||
bool fsn_in_the_past(fsn_t old, fsn_t new)
|
||||
{
|
||||
int diff = fsn_get_diff(old, new);
|
||||
return diff < 0;
|
||||
}
|
||||
36
common/utils/fsn.h
Normal file
36
common/utils/fsn.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#ifndef FSN_H_
|
||||
#define FSN_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/// helper type to encapsulate a frame/slot combination in a single type.
|
||||
typedef struct fsn {
|
||||
uint16_t f; /// frame
|
||||
uint16_t s; /// slot
|
||||
uint8_t mu; /// numerology
|
||||
} fsn_t;
|
||||
|
||||
/* \brief Add delta slots to fsn. Note that this depends also on the stored
|
||||
* numerology inside fsn. */
|
||||
fsn_t fsn_add_delta(fsn_t fsn, uint32_t delta);
|
||||
|
||||
/* \brief Get difference of slots for a and b.
|
||||
* \note asserts if numerology not the same. */
|
||||
int fsn_get_diff(fsn_t a, fsn_t b);
|
||||
|
||||
/* \brief Gets the larger of two fsns */
|
||||
fsn_t fsn_get_max(fsn_t a, fsn_t b);
|
||||
|
||||
/* \brief Compare if both fsn_t's are equal */
|
||||
bool fsn_equal(fsn_t a, fsn_t b);
|
||||
|
||||
/* \brief Determine if told is in the past of tnew. The threshold is 512
|
||||
* frames. */
|
||||
bool fsn_in_the_past(fsn_t told, fsn_t tnew);
|
||||
|
||||
#endif /* FSN_H_ */
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <stdlib.h>
|
||||
#include "assertions.h"
|
||||
#include "common/utils/utils.h"
|
||||
#include "common/utils/ds/byte_array.h"
|
||||
|
||||
#define MAX_SI_GROUPS 3
|
||||
#define NR_MAX_PDSCH_TBS 3824
|
||||
@@ -79,10 +80,32 @@ static inline const char *rnti_types(nr_rnti_type_t rr)
|
||||
// the total shift is 2 * 15, in dB scale thats 10log10(2^(15*2))
|
||||
#define SQ15_SQUARED_NORM_FACTOR_DB 90.3089986992
|
||||
|
||||
typedef enum {
|
||||
NR_SIB_1 = 1,
|
||||
NR_SIB_2,
|
||||
NR_SIB_3,
|
||||
NR_SIB_4,
|
||||
NR_SIB_5,
|
||||
NR_SIB_6,
|
||||
NR_SIB_7,
|
||||
NR_SIB_8,
|
||||
NR_SIB_9,
|
||||
NR_SIB_10,
|
||||
NR_SIB_11,
|
||||
NR_SIB_12,
|
||||
NR_SIB_13,
|
||||
NR_SIB_14,
|
||||
NR_SIB_15,
|
||||
NR_SIB_16,
|
||||
NR_SIB_17,
|
||||
NR_SIB_18,
|
||||
NR_SIB_19,
|
||||
NR_SIB_20,
|
||||
NR_SIB_21,
|
||||
} nr_sib_type_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t *SIB_buffer;
|
||||
int SIB_size;
|
||||
int SIB_type;
|
||||
nr_sib_type_t SIB_type;
|
||||
} nr_SIBs_t;
|
||||
|
||||
typedef struct nr_bandentry_s {
|
||||
|
||||
@@ -284,12 +284,8 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
|
||||
|
||||
// Legacy, pthread_create + thread_top_init() should be replaced by threadCreate
|
||||
// threadCreate encapsulates the posix pthread api
|
||||
void thread_top_init(char *thread_name,
|
||||
int affinity,
|
||||
uint64_t runtime,
|
||||
uint64_t deadline,
|
||||
uint64_t period) {
|
||||
|
||||
void thread_top_init(char *thread_name)
|
||||
{
|
||||
int policy, s, j;
|
||||
struct sched_param sparam;
|
||||
char cpu_affinity[1024];
|
||||
|
||||
@@ -36,11 +36,7 @@ void threadCreate(pthread_t *t, void *(*func)(void *), void *param, char *name,
|
||||
#define OAI_PRIORITY_RT ((sched_get_priority_min(SCHED_OAI)+sched_get_priority_max(SCHED_OAI))/2)
|
||||
#define OAI_PRIORITY_RT_MAX sched_get_priority_max(SCHED_OAI)-2
|
||||
|
||||
void thread_top_init(char *thread_name,
|
||||
int affinity,
|
||||
uint64_t runtime,
|
||||
uint64_t deadline,
|
||||
uint64_t period);
|
||||
void thread_top_init(char *thread_name);
|
||||
|
||||
/****************************************************
|
||||
* Functions to check system at runtime.
|
||||
|
||||
@@ -81,7 +81,6 @@ int get_phybsize(void) {
|
||||
};
|
||||
int add_telnetcmd(char *modulename,telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd );
|
||||
int setoutput(char *buff, int debug, telnet_printfunc_t prnt);
|
||||
int wsetoutput(char *buff, int debug, telnet_printfunc_t prnt, ...);
|
||||
int setparam(char *buff, int debug, telnet_printfunc_t prnt);
|
||||
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...);
|
||||
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt);
|
||||
@@ -245,12 +244,9 @@ void redirstd(char *newfname,telnet_printfunc_t prnt ) {
|
||||
}
|
||||
}
|
||||
|
||||
int wsetoutput(char *buffer, int debug, telnet_printfunc_t prnt, ...)
|
||||
int setoutput(char *buff, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||
UNUSED(debug);
|
||||
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
|
||||
char *logfname;
|
||||
char stdout_str[64];
|
||||
@@ -288,10 +284,16 @@ int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||
|
||||
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...)
|
||||
{
|
||||
UNUSED(buff);
|
||||
UNUSED(debug);
|
||||
UNUSED(prnt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int setparam(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||
int setparam(char *buff, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(prnt);
|
||||
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
|
||||
memset(cmds,0,sizeof(cmds));
|
||||
sscanf(buff,"%9s %9s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] );
|
||||
@@ -322,7 +324,9 @@ int setparam(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||
return CMDSTATUS_NOTFOUND;
|
||||
} /* setparam */
|
||||
|
||||
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
|
||||
memset(cmds,0,sizeof(cmds));
|
||||
sscanf(buff,"%9s %9s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] );
|
||||
@@ -502,7 +506,7 @@ void telnet_pushcmd(telnetshell_cmddef_t *cmd, char *cmdbuff, telnet_printfunc_t
|
||||
pushNotifiedFIFO(cmd->qptr, msg);
|
||||
}
|
||||
|
||||
int process_command(char *buf, int iteration)
|
||||
int process_command(char *buf)
|
||||
{
|
||||
int i,j,k;
|
||||
char modulename[TELNET_CMD_MAXSIZE];
|
||||
@@ -581,7 +585,7 @@ int process_command(char *buf, int iteration)
|
||||
char tbuff[64];
|
||||
client_printf(CSI "1J" CSI "1;10H " STDFMT "%s %i/%i\n",
|
||||
get_time(tbuff,sizeof(tbuff)),lc,telnetparams.loopcount );
|
||||
process_command(buf + strlen("loop") + 1, lc);
|
||||
process_command(buf + strlen("loop") + 1);
|
||||
errno=0;
|
||||
int rs = read(telnetparams.new_socket,dummybuff,sizeof(dummybuff));
|
||||
|
||||
@@ -710,7 +714,7 @@ void run_telnetsrv(void) {
|
||||
}
|
||||
|
||||
if (strlen(buf) > 2 ) {
|
||||
status = process_command(buf, 0);
|
||||
status = process_command(buf);
|
||||
} else
|
||||
status=CMDSTATUS_NOCMD;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ static int get_single_ue_rnti(void)
|
||||
|
||||
int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (buf)
|
||||
ERROR_MSG_RET("no parameter allowed\n");
|
||||
|
||||
@@ -42,6 +43,7 @@ int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
//void rrc_gNB_trigger_new_bearer(int rnti);
|
||||
int add_bearer(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
int rnti = -1;
|
||||
if (!buf) {
|
||||
rnti = get_single_ue_rnti();
|
||||
@@ -67,6 +69,7 @@ int add_bearer(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
//void rrc_gNB_trigger_release_bearer(int rnti);
|
||||
int release_bearer(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
int rnti = -1;
|
||||
if (!buf) {
|
||||
rnti = get_single_ue_rnti();
|
||||
|
||||
@@ -47,6 +47,7 @@ static int get_single_ue_rnti_mac(void)
|
||||
|
||||
int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (buf)
|
||||
ERROR_MSG_RET("no parameter allowed\n");
|
||||
|
||||
@@ -81,6 +82,7 @@ rrc_gNB_ue_context_t *get_single_rrc_ue(void)
|
||||
|
||||
int get_reestab_count(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (!RC.nrrrc)
|
||||
ERROR_MSG_RET("no RRC present, cannot list counts\n");
|
||||
rrc_gNB_ue_context_t *ue = NULL;
|
||||
@@ -119,6 +121,7 @@ int fetch_rnti(char *buf, telnet_printfunc_t prnt)
|
||||
|
||||
int trigger_reestab(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (!RC.nrmac)
|
||||
ERROR_MSG_RET("no MAC/RLC present, cannot trigger reestablishment\n");
|
||||
int rnti = fetch_rnti(buf, prnt);
|
||||
@@ -134,6 +137,7 @@ extern nr_rrc_du_container_t *get_du_for_ue(gNB_RRC_INST *rrc, uint32_t ue_id);
|
||||
/** @brief Get connected DU by the UE ID */
|
||||
int fetch_du_by_ue_id(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (!RC.nrrrc)
|
||||
ERROR_MSG_RET("no RRC present, cannot list counts\n");
|
||||
|
||||
@@ -169,6 +173,7 @@ extern void nr_HO_F1_trigger_telnet(gNB_RRC_INST *rrc, uint32_t rrc_ue_id);
|
||||
*/
|
||||
int rrc_gNB_trigger_f1_ho(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (!RC.nrrrc)
|
||||
ERROR_MSG_RET("no RRC present, cannot list counts\n");
|
||||
rrc_gNB_ue_context_t *ue = NULL;
|
||||
@@ -198,6 +203,7 @@ extern void nr_HO_N2_trigger_telnet(gNB_RRC_INST *rrc, uint32_t neighbour_pci, u
|
||||
* @return 0 on success, -1 on failure */
|
||||
int rrc_gNB_trigger_n2_ho(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (!RC.nrrrc)
|
||||
ERROR_MSG_RET("no RRC present, cannot list counts\n");
|
||||
|
||||
@@ -238,6 +244,7 @@ int rrc_gNB_trigger_n2_ho(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
|
||||
int force_ul_failure(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (!RC.nrmac)
|
||||
ERROR_MSG_RET("no MAC/RLC present, force_ul_failure failed\n");
|
||||
int rnti = fetch_rnti(buf, prnt);
|
||||
@@ -263,6 +270,7 @@ int force_ue_release(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
|
||||
static int get_current_bwp(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
int rnti = fetch_rnti(buf, prnt);
|
||||
if (rnti < 0)
|
||||
ERROR_MSG_RET("could not identify UE (no UE, no such RNTI, or multiple UEs)\n");
|
||||
@@ -288,6 +296,7 @@ static int get_current_bwp(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
* @return 0 on success; negative value on error. */
|
||||
static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (buf == NULL) {
|
||||
ERROR_MSG_RET("Missing input. Usage: trigger_pdu_session_release [ue_id=gNB_ue_ngap_id(int,opt)],pdusession_id(int)[,pdusession_id(int)...]\n");
|
||||
}
|
||||
@@ -360,6 +369,7 @@ static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfu
|
||||
|
||||
static int trigger_bwp_switch(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
char *sbwpId = strtok(buf, " ");
|
||||
int bwpId = atoi(sbwpId);
|
||||
char *srnti = strtok(NULL, " ");
|
||||
|
||||
@@ -52,6 +52,7 @@ static int get_default_ue_id(void)
|
||||
*/
|
||||
int get_sync_state(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
int ue_id = -1;
|
||||
if (!buf) {
|
||||
ERROR_MSG_RET("no UE ID provided to telnet command\n");
|
||||
@@ -71,6 +72,9 @@ int get_sync_state(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
*/
|
||||
int force_rlf(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(buf);
|
||||
UNUSED(prnt);
|
||||
NR_UE_RRC_INST_t *rrc = get_NR_UE_rrc_inst(0);
|
||||
handle_rlf_detection(rrc);
|
||||
return 0;
|
||||
@@ -81,6 +85,9 @@ int force_rlf(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
*/
|
||||
int force_RRC_IDLE(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(buf);
|
||||
UNUSED(prnt);
|
||||
NR_UE_RRC_INST_t *rrc = get_NR_UE_rrc_inst(0);
|
||||
nr_rrc_going_to_IDLE(rrc, OTHER, NULL);
|
||||
return 0;
|
||||
@@ -89,6 +96,9 @@ int force_RRC_IDLE(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
/** @brief Trigger RA with Msg3 C-RNTI */
|
||||
int force_crnti_ra(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(buf);
|
||||
UNUSED(prnt);
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
trigger_MAC_UE_RA(mac, NULL);
|
||||
return 0;
|
||||
@@ -96,6 +106,9 @@ int force_crnti_ra(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
|
||||
static int force_deregistration(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(buf);
|
||||
UNUSED(prnt);
|
||||
MessageDef *msg = itti_alloc_new_message(TASK_NAS_NRUE, 0, NAS_DEREGISTRATION_REQ);
|
||||
NAS_DEREGISTRATION_REQ(msg).cause = AS_DETACH;
|
||||
itti_send_msg_to_task(TASK_NAS_NRUE, 0, msg);
|
||||
@@ -105,6 +118,8 @@ static int force_deregistration(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
extern float get_prs_max_dl_toa(prs_meas_t *prs_meas);
|
||||
static int get_dl_toa(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(buf);
|
||||
// TODO multiple antennas, resources, gNBs?
|
||||
int gNB_id = 0;
|
||||
int rsc_id = 0;
|
||||
@@ -124,6 +139,7 @@ static int get_dl_toa(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
|
||||
static int add_pdu_session(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
int ue_id = -1;
|
||||
int pdusession_id = -1;
|
||||
|
||||
|
||||
@@ -46,11 +46,15 @@ void dump_uestats(int debug, telnet_printfunc_t prnt, uint8_t prntflag) {
|
||||
}
|
||||
|
||||
void display_uestats(int debug, telnet_printfunc_t prnt, int ue) {
|
||||
UNUSED(debug);
|
||||
UNUSED(prnt);
|
||||
UNUSED(ue);
|
||||
for (int cc=0; cc<1 ; cc++) {
|
||||
}
|
||||
}
|
||||
|
||||
void display_phycounters(char *buf, int debug, telnet_printfunc_t prnt) {
|
||||
UNUSED(buf);
|
||||
prnt(" DLSCH kb DLSCH kb/s\n");
|
||||
dump_uestats(debug, prnt,0);
|
||||
}
|
||||
|
||||
@@ -206,6 +206,7 @@ int measurcmd_cpustats(char *buf, int debug, telnet_printfunc_t prnt) {
|
||||
}
|
||||
|
||||
void measurcmd_async_help(telnet_printfunc_t prnt) {
|
||||
UNUSED(prnt);
|
||||
}
|
||||
|
||||
int measurcmd_async(char *buf, int debug, telnet_printfunc_t prnt) {
|
||||
|
||||
@@ -62,6 +62,7 @@ typedef struct ue_stat {
|
||||
|
||||
static int get_stats(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (buf)
|
||||
ERROR_MSG_RET("no parameter allowed\n");
|
||||
|
||||
@@ -209,6 +210,7 @@ static int read_long(const char *buf, const char *end, const char *id, long *val
|
||||
bool running = true; // in the beginning, the softmodem is started automatically
|
||||
static int set_config(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (!buf)
|
||||
ERROR_MSG_RET("need param: o1 config param1 val1 [param2 val2 ...]\n");
|
||||
if (running)
|
||||
@@ -271,6 +273,7 @@ static int set_config(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
|
||||
static int set_bwconfig(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (running)
|
||||
ERROR_MSG_RET("cannot set parameters while L1 is running\n");
|
||||
if (!buf)
|
||||
@@ -344,6 +347,8 @@ static int set_bwconfig(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
extern int stop_L1(module_id_t gnb_id);
|
||||
static int stop_modem(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(buf);
|
||||
if (!running)
|
||||
ERROR_MSG_RET("cannot stop, nr-softmodem not running\n");
|
||||
|
||||
@@ -366,6 +371,8 @@ static int stop_modem(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
extern int start_L1L2(module_id_t gnb_id);
|
||||
static int start_modem(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(buf);
|
||||
if (running)
|
||||
ERROR_MSG_RET("cannot start, nr-softmodem already running\n");
|
||||
start_L1L2(0);
|
||||
@@ -377,6 +384,8 @@ static int start_modem(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
extern void du_clear_all_ue_states();
|
||||
static int remove_mac_ues(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(buf);
|
||||
du_clear_all_ue_states();
|
||||
prnt("OK\n");
|
||||
return 0;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
void decode_procstat(char *record, int debug, telnet_printfunc_t prnt, webdatadef_t *tdata)
|
||||
{
|
||||
UNUSED(debug);
|
||||
char prntline[160];
|
||||
char *procfile_fields;
|
||||
char *strtokptr;
|
||||
@@ -169,10 +170,11 @@ char arecord[1024];
|
||||
|
||||
int nullprnt(char *fmt, ...)
|
||||
{
|
||||
UNUSED(fmt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void proccmd_get_threaddata(char *buf, int debug, telnet_printfunc_t fprnt, webdatadef_t *tdata)
|
||||
void proccmd_get_threaddata(int debug, telnet_printfunc_t fprnt, webdatadef_t *tdata)
|
||||
{
|
||||
char aname[256];
|
||||
|
||||
@@ -222,9 +224,9 @@ char aname[256];
|
||||
closedir(proc_dir);
|
||||
} /* proccmd_get_threaddata */
|
||||
|
||||
void print_threads(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
void print_threads(int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
proccmd_get_threaddata(buf, debug, prnt, NULL);
|
||||
proccmd_get_threaddata(debug, prnt, NULL);
|
||||
}
|
||||
|
||||
#define FLAG_PRINT_DEBUG_DUMP(flag) \
|
||||
@@ -349,7 +351,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
|
||||
}
|
||||
}
|
||||
if (strcasestr(cmdbuff, "threadsched") != NULL) {
|
||||
proccmd_get_threaddata(cmdbuff, debug, prnt, (webdatadef_t *)data);
|
||||
proccmd_get_threaddata(debug, prnt, (webdatadef_t *)data);
|
||||
}
|
||||
} // show
|
||||
|
||||
@@ -373,7 +375,7 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
if (debug > 0)
|
||||
prnt(" proccmd_show received %s\n",buf);
|
||||
if (strcasestr(buf,"thread") != NULL) {
|
||||
print_threads(buf,debug,prnt);
|
||||
print_threads(debug, prnt);
|
||||
}
|
||||
if (strcasestr(buf,"loglvl") != NULL) {
|
||||
prnt("\n component level enabled output\n");
|
||||
@@ -466,7 +468,7 @@ if (buf == NULL) {
|
||||
prnt(" proccmd_thread: %i params = %i,%s,%i\n",res,bv1,sv1,bv2);
|
||||
if(res != 3)
|
||||
{
|
||||
print_threads(buf, debug, prnt);
|
||||
print_threads(debug, prnt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ static int get_single_ue_id(void)
|
||||
*/
|
||||
int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
ue_id_t ue_id = -1;
|
||||
|
||||
if (!buf) {
|
||||
@@ -91,6 +92,8 @@ int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
*/
|
||||
int rrc_gNB_trigger_release_all(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(buf);
|
||||
rrc_gNB_ue_context_t *ue_context_p = NULL;
|
||||
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[0];
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user