Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
bea2ec5c
Commit
bea2ec5c
authored
Jun 04, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use snprintf() in dump_mac_stats()
parent
f8f20827
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
49 deletions
+67
-49
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+1
-1
openair2/LAYER2/NR_MAC_gNB/main.c
openair2/LAYER2/NR_MAC_gNB/main.c
+66
-48
No files found.
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
bea2ec5c
...
...
@@ -534,7 +534,7 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options,
void
nr_sr_reporting
(
gNB_MAC_INST
*
nrmac
,
frame_t
frameP
,
sub_frame_t
slotP
);
size_t
dump_mac_stats
(
gNB_MAC_INST
*
gNB
,
char
*
output
,
in
t
strlen
,
bool
reset_rsrp
);
size_t
dump_mac_stats
(
gNB_MAC_INST
*
gNB
,
char
*
output
,
size_
t
strlen
,
bool
reset_rsrp
);
void
process_CellGroup
(
NR_CellGroupConfig_t
*
CellGroup
,
NR_UE_sched_ctrl_t
*
sched_ctrl
);
...
...
openair2/LAYER2/NR_MAC_gNB/main.c
View file @
bea2ec5c
...
...
@@ -78,11 +78,12 @@ void clear_mac_stats(gNB_MAC_INST *gNB) {
}
}
size_t
dump_mac_stats
(
gNB_MAC_INST
*
gNB
,
char
*
output
,
in
t
strlen
,
bool
reset_rsrp
)
size_t
dump_mac_stats
(
gNB_MAC_INST
*
gNB
,
char
*
output
,
size_
t
strlen
,
bool
reset_rsrp
)
{
int
num
=
1
;
const
char
*
begin
=
output
;
const
char
*
end
=
output
+
strlen
;
int
stroff
=
0
;
pthread_mutex_lock
(
&
gNB
->
UE_info
.
mutex
);
UE_iterator
(
gNB
->
UE_info
.
list
,
UE
)
{
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE
->
UE_sched_ctrl
;
...
...
@@ -90,23 +91,28 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen, bool reset_rs
const
int
avg_rsrp
=
stats
->
num_rsrp_meas
>
0
?
stats
->
cumul_rsrp
/
stats
->
num_rsrp_meas
:
0
;
stroff
+=
sprintf
(
output
+
stroff
,
"UE RNTI %04x (%d) PH %d dB PCMAX %d dBm, average RSRP %d (%d meas)
\n
"
,
output
+=
snprintf
(
output
,
end
-
output
,
"UE RNTI %04x (%d) PH %d dB PCMAX %d dBm, average RSRP %d (%d meas)
\n
"
,
UE
->
rnti
,
num
++
,
sched_ctrl
->
ph
,
sched_ctrl
->
pcmax
,
avg_rsrp
,
stats
->
num_rsrp_meas
);
stroff
+=
sprintf
(
output
+
stroff
,
"UE %04x: CQI %d, RI %d, PMI (%d,%d)
\n
"
,
output
+=
snprintf
(
output
,
end
-
output
,
"UE %04x: CQI %d, RI %d, PMI (%d,%d)
\n
"
,
UE
->
rnti
,
UE
->
UE_sched_ctrl
.
CSI_report
.
cri_ri_li_pmi_cqi_report
.
wb_cqi_1tb
,
UE
->
UE_sched_ctrl
.
CSI_report
.
cri_ri_li_pmi_cqi_report
.
ri
+
1
,
UE
->
UE_sched_ctrl
.
CSI_report
.
cri_ri_li_pmi_cqi_report
.
pmi_x1
,
UE
->
UE_sched_ctrl
.
CSI_report
.
cri_ri_li_pmi_cqi_report
.
pmi_x2
);
stroff
+=
sprintf
(
output
+
stroff
,
"UE %04x: dlsch_rounds %"
PRIu64
"/%"
PRIu64
"/%"
PRIu64
"/%"
PRIu64
", dlsch_errors %"
PRIu64
", pucch0_DTX %d, BLER %.5f MCS %d
\n
"
,
output
+=
snprintf
(
output
,
end
-
output
,
"UE %04x: dlsch_rounds %"
PRIu64
"/%"
PRIu64
"/%"
PRIu64
"/%"
PRIu64
", dlsch_errors %"
PRIu64
", pucch0_DTX %d, BLER %.5f MCS %d
\n
"
,
UE
->
rnti
,
stats
->
dl
.
rounds
[
0
],
stats
->
dl
.
rounds
[
1
],
stats
->
dl
.
rounds
[
2
],
stats
->
dl
.
rounds
[
3
],
stats
->
dl
.
errors
,
...
...
@@ -117,8 +123,14 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen, bool reset_rs
stats
->
num_rsrp_meas
=
0
;
stats
->
cumul_rsrp
=
0
;
}
stroff
+=
sprintf
(
output
+
stroff
,
"UE %04x: dlsch_total_bytes %"
PRIu64
"
\n
"
,
UE
->
rnti
,
stats
->
dl
.
total_bytes
);
stroff
+=
sprintf
(
output
+
stroff
,
"UE %04x: ulsch_rounds %"
PRIu64
"/%"
PRIu64
"/%"
PRIu64
"/%"
PRIu64
", ulsch_DTX %d, ulsch_errors %"
PRIu64
", BLER %.5f MCS %d
\n
"
,
output
+=
snprintf
(
output
,
end
-
output
,
"UE %04x: dlsch_total_bytes %"
PRIu64
"
\n
"
,
UE
->
rnti
,
stats
->
dl
.
total_bytes
);
output
+=
snprintf
(
output
,
end
-
output
,
"UE %04x: ulsch_rounds %"
PRIu64
"/%"
PRIu64
"/%"
PRIu64
"/%"
PRIu64
", ulsch_DTX %d, ulsch_errors %"
PRIu64
", BLER %.5f MCS %d
\n
"
,
UE
->
rnti
,
stats
->
ul
.
rounds
[
0
],
stats
->
ul
.
rounds
[
1
],
stats
->
ul
.
rounds
[
2
],
stats
->
ul
.
rounds
[
3
],
...
...
@@ -126,24 +138,30 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen, bool reset_rs
stats
->
ul
.
errors
,
sched_ctrl
->
ul_bler_stats
.
bler
,
sched_ctrl
->
ul_bler_stats
.
mcs
);
stroff
+=
sprintf
(
output
+
stroff
,
output
+=
snprintf
(
output
,
end
-
output
,
"UE %04x: ulsch_total_bytes_scheduled %"
PRIu64
", ulsch_total_bytes_received %"
PRIu64
"
\n
"
,
UE
->
rnti
,
stats
->
ulsch_total_bytes_scheduled
,
stats
->
ul
.
total_bytes
);
for
(
int
lc_id
=
0
;
lc_id
<
63
;
lc_id
++
)
{
if
(
stats
->
dl
.
lc_bytes
[
lc_id
]
>
0
)
{
stroff
+=
sprintf
(
output
+
stroff
,
"UE %04x: LCID %d: %"
PRIu64
" bytes TX
\n
"
,
UE
->
rnti
,
lc_id
,
stats
->
dl
.
lc_bytes
[
lc_id
]);
LOG_D
(
NR_MAC
,
"UE %04x: LCID %d: %"
PRIu64
" bytes TX
\n
"
,
UE
->
rnti
,
lc_id
,
stats
->
dl
.
lc_bytes
[
lc_id
]);
}
if
(
stats
->
ul
.
lc_bytes
[
lc_id
]
>
0
)
{
stroff
+=
sprintf
(
output
+
stroff
,
"UE %04x: LCID %d: %"
PRIu64
" bytes RX
\n
"
,
UE
->
rnti
,
lc_id
,
stats
->
ul
.
lc_bytes
[
lc_id
]);
LOG_D
(
NR_MAC
,
"UE %04x: LCID %d: %"
PRIu64
" bytes RX
\n
"
,
UE
->
rnti
,
lc_id
,
stats
->
ul
.
lc_bytes
[
lc_id
]);
}
if
(
stats
->
dl
.
lc_bytes
[
lc_id
]
>
0
)
output
+=
snprintf
(
output
,
end
-
output
,
"UE %04x: LCID %d: %"
PRIu64
" bytes TX
\n
"
,
UE
->
rnti
,
lc_id
,
stats
->
dl
.
lc_bytes
[
lc_id
]);
if
(
stats
->
ul
.
lc_bytes
[
lc_id
]
>
0
)
output
+=
snprintf
(
output
,
end
-
output
,
"UE %04x: LCID %d: %"
PRIu64
" bytes RX
\n
"
,
UE
->
rnti
,
lc_id
,
stats
->
ul
.
lc_bytes
[
lc_id
]);
}
}
pthread_mutex_unlock
(
&
gNB
->
UE_info
.
mutex
);
return
stroff
;
return
output
-
begin
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment