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
lizhongxiao
OpenXG-RAN
Commits
2ff243bd
Commit
2ff243bd
authored
Sep 30, 2022
by
123
Committed by
Your Name
May 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add speed info
parent
6f77ee85
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
13 deletions
+43
-13
openair2/LAYER2/NR_MAC_gNB/main.c
openair2/LAYER2/NR_MAC_gNB/main.c
+43
-13
No files found.
openair2/LAYER2/NR_MAC_gNB/main.c
View file @
2ff243bd
...
@@ -83,25 +83,41 @@ void clear_mac_stats(gNB_MAC_INST *gNB) {
...
@@ -83,25 +83,41 @@ void clear_mac_stats(gNB_MAC_INST *gNB) {
}
}
}
}
#define DUMP_MAC_STATUS_MAX_UE_NUM 5
#define DUMP_MAC_STATUS_MAX_LC_NUM 64
uint64_t
dlsch_total_last
[
DUMP_MAC_STATUS_MAX_UE_NUM
]
=
{
0
};
uint64_t
ulsch_total_last
[
DUMP_MAC_STATUS_MAX_UE_NUM
]
=
{
0
};
uint64_t
mac_lc_dl_last
[
DUMP_MAC_STATUS_MAX_UE_NUM
][
DUMP_MAC_STATUS_MAX_LC_NUM
]
=
{
0
};
uint64_t
mac_lc_ul_last
[
DUMP_MAC_STATUS_MAX_UE_NUM
][
DUMP_MAC_STATUS_MAX_LC_NUM
]
=
{
0
};
size_t
dump_mac_stats
(
gNB_MAC_INST
*
gNB
,
char
*
output
,
size_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
;
int
num
=
1
;
const
char
*
begin
=
output
;
const
char
*
begin
=
output
;
const
char
*
end
=
output
+
strlen
;
const
char
*
end
=
output
+
strlen
;
int
ue_index
=
0
;
/* this function is called from gNB_dlsch_ulsch_scheduler(), so assumes the
pthread_mutex_lock
(
&
gNB
->
UE_info
.
mutex
);
* scheduler to be locked*/
NR_SCHED_ENSURE_LOCKED
(
&
gNB
->
sched_lock
);
NR_SCHED_LOCK
(
&
gNB
->
UE_info
.
mutex
);
UE_iterator
(
gNB
->
UE_info
.
list
,
UE
)
{
UE_iterator
(
gNB
->
UE_info
.
list
,
UE
)
{
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE
->
UE_sched_ctrl
;
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE
->
UE_sched_ctrl
;
NR_mac_stats_t
*
stats
=
&
UE
->
mac_stats
;
NR_mac_stats_t
*
stats
=
&
UE
->
mac_stats
;
const
int
avg_rsrp
=
stats
->
num_rsrp_meas
>
0
?
stats
->
cumul_rsrp
/
stats
->
num_rsrp_meas
:
0
;
const
int
avg_rsrp
=
stats
->
num_rsrp_meas
>
0
?
stats
->
cumul_rsrp
/
stats
->
num_rsrp_meas
:
0
;
u_int64_t
test_u64
=
stats
->
dl
.
total_bytes
-
dlsch_total_last
[
ue_index
];
double
test_double
=
stats
->
dl
.
total_bytes
-
dlsch_total_last
[
ue_index
];
output
+=
snprintf
(
output
,
output
+=
snprintf
(
output
,
end
-
output
,
end
-
output
,
"UE RNTI %04x (%d) PH %d dB PCMAX %d dBm, average RSRP %d (%d meas)
\n
"
,
"SPEED: PHY DL %.3f Mbps, UL %.3f Mbps
\n
"
,
(
double
)(
stats
->
dl
.
total_bytes
-
dlsch_total_last
[
ue_index
])
*
8
/
1280
/
1000
,
// bit/per msec/per sec
(
double
)(
stats
->
ul
.
total_bytes
-
ulsch_total_last
[
ue_index
])
*
8
/
1280
/
1000
);
output
+=
snprintf
(
output
,
end
-
output
,
"SPEED: MAC DL %.3f Mbps, UL %.3f Mbps
\n
"
,
(
double
)(
stats
->
dl
.
lc_bytes
[
4
]
-
mac_lc_dl_last
[
ue_index
][
4
])
*
8
/
1280
/
1000
,
(
double
)(
stats
->
ul
.
lc_bytes
[
4
]
-
mac_lc_ul_last
[
ue_index
][
4
])
*
8
/
1280
/
1000
);
output
+=
snprintf
(
output
,
end
-
output
,
"UE RNTI %04x (%d) PH %d dB PCMAX %d dBm, average RSRP %d (%d meas), UL-SNR %d dB
\n
"
,
UE
->
rnti
,
UE
->
rnti
,
num
++
,
num
++
,
sched_ctrl
->
ph
,
sched_ctrl
->
ph
,
...
@@ -131,11 +147,13 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
...
@@ -131,11 +147,13 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
output
+=
snprintf
(
output
,
output
+=
snprintf
(
output
,
end
-
output
,
end
-
output
,
", dlsch_errors %"
PRIu64
", pucch0_DTX %d, BLER %.
5f MCS %d
\n
"
,
", dlsch_errors %"
PRIu64
", pucch0_DTX %d, BLER %.
3f% MCS %d, RB %d, TBsize %d Byte.
\n
"
,
stats
->
dl
.
errors
,
stats
->
dl
.
errors
,
stats
->
pucch0_DTX
,
stats
->
pucch0_DTX
,
sched_ctrl
->
dl_bler_stats
.
bler
,
sched_ctrl
->
dl_bler_stats
.
bler
*
100
,
sched_ctrl
->
dl_bler_stats
.
mcs
);
sched_ctrl
->
dl_bler_stats
.
mcs
,
stats
->
dl
.
current_rbs
,
stats
->
dl
.
current_bytes
);
if
(
reset_rsrp
)
{
if
(
reset_rsrp
)
{
stats
->
num_rsrp_meas
=
0
;
stats
->
num_rsrp_meas
=
0
;
stats
->
cumul_rsrp
=
0
;
stats
->
cumul_rsrp
=
0
;
...
@@ -153,11 +171,13 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
...
@@ -153,11 +171,13 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
output
+=
snprintf
(
output
,
output
+=
snprintf
(
output
,
end
-
output
,
end
-
output
,
", ulsch_DTX %d, ulsch_errors %"
PRIu64
", BLER %.
5f MCS %d
\n
"
,
", ulsch_DTX %d, ulsch_errors %"
PRIu64
", BLER %.
3f% MCS %d, RB %d, TBsize %d Byte.
\n
"
,
stats
->
ulsch_DTX
,
stats
->
ulsch_DTX
,
stats
->
ul
.
errors
,
stats
->
ul
.
errors
,
sched_ctrl
->
ul_bler_stats
.
bler
,
sched_ctrl
->
ul_bler_stats
.
bler
*
100
,
sched_ctrl
->
ul_bler_stats
.
mcs
);
sched_ctrl
->
ul_bler_stats
.
mcs
,
stats
->
ul
.
current_rbs
,
stats
->
ul
.
current_bytes
);
output
+=
snprintf
(
output
,
output
+=
snprintf
(
output
,
end
-
output
,
end
-
output
,
"UE %04x: ulsch_total_bytes_scheduled %"
PRIu64
", ulsch_total_bytes_received %"
PRIu64
"
\n
"
,
"UE %04x: ulsch_total_bytes_scheduled %"
PRIu64
", ulsch_total_bytes_received %"
PRIu64
"
\n
"
,
...
@@ -179,7 +199,17 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
...
@@ -179,7 +199,17 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
UE
->
rnti
,
UE
->
rnti
,
lc_id
,
lc_id
,
stats
->
ul
.
lc_bytes
[
lc_id
]);
stats
->
ul
.
lc_bytes
[
lc_id
]);
if
(
reset_rsrp
)
{
// only count when called by gNB_dlsch_ulsch_scheduler
mac_lc_dl_last
[
ue_index
][
lc_id
]
=
stats
->
dl
.
lc_bytes
[
lc_id
];
mac_lc_ul_last
[
ue_index
][
lc_id
]
=
stats
->
ul
.
lc_bytes
[
lc_id
];}
}
}
if
(
reset_rsrp
)
{
// only count when called by gNB_dlsch_ulsch_scheduler
dlsch_total_last
[
ue_index
]
=
stats
->
dl
.
total_bytes
;
ulsch_total_last
[
ue_index
]
=
stats
->
ul
.
total_bytes
;}
ue_index
++
;
}
}
NR_SCHED_UNLOCK
(
&
gNB
->
UE_info
.
mutex
);
NR_SCHED_UNLOCK
(
&
gNB
->
UE_info
.
mutex
);
return
output
-
begin
;
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