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
Michael Black
OpenXG-RAN
Commits
bbf4cc31
Commit
bbf4cc31
authored
Feb 07, 2019
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve flexibility of measure implementation
parent
eb6e5ffe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
40 deletions
+60
-40
common/utils/telnetsrv/telnetsrv_measurements.c
common/utils/telnetsrv/telnetsrv_measurements.c
+34
-16
common/utils/telnetsrv/telnetsrv_measurments.h
common/utils/telnetsrv/telnetsrv_measurments.h
+26
-24
No files found.
common/utils/telnetsrv/telnetsrv_measurements.c
View file @
bbf4cc31
...
...
@@ -50,18 +50,27 @@
#include "openair2/LAYER2/MAC/mac.h"
#include "openair1/PHY/phy_extern.h"
static
telnet_measurgroupdef_t
*
measurgroups
[
TELNET_MAXMEASURGROUPS
];
static
int
telnet_num_measurgroups
=
0
;
void
measurcmd_display_macstats
(
telnet_printfunc_t
prnt
);
void
measurcmd_display_macstats_ue
(
telnet_printfunc_t
prnt
);
void
measurcmd_display_rlcstats
(
telnet_printfunc_t
prnt
);
static
telnet_measurgroupdef_t
measurgroups
[]
=
{
{
"enb"
,
GROUP_LTESTATS
,
0
,
measurcmd_display_macstats
,
{
NULL
}},
{
"enbues"
,
GROUP_LTESTATS
,
0
,
measurcmd_display_macstats_ue
,{
NULL
}},
{
"rlc"
,
GROUP_LTESTATS
,
0
,
measurcmd_display_rlcstats
,
{
NULL
}},
};
#define TELNET_NUM_MEASURGROUPS (sizeof(measurgroups)/sizeof(telnet_measurgroupdef_t))
static
int
eNB_id
=
0
;
static
char
*
grouptypes
[]
=
{
"ltemac"
,
"cpustats"
};
static
char
*
grouptypes
[]
=
{
"ltestats"
,
"cpustats"
};
#define TELNET_NUM_MEASURTYPES (sizeof(grouptypes)/sizeof(char *))
#define HDR "---------------------------------"
void
measurcmd_display_groups
(
telnet_printfunc_t
prnt
)
{
prnt
(
" %*s %10s %s
\n
"
,
TELNET_MAXMEASURNAME_LEN
-
1
,
"name"
,
"type"
,
"nombre de mesures"
);
for
(
int
i
=
0
;
i
<
telnet_num_measurgroups
;
i
++
)
prnt
(
"%02d %*s %10s %i
\n
"
,
i
,
TELNET_MAXMEASURNAME_LEN
-
1
,
measurgroups
[
i
]
->
groupname
,
grouptypes
[
measurgroups
[
i
]
->
type
],
measurgroups
[
i
]
->
size
);
for
(
int
i
=
0
;
i
<
TELNET_NUM_MEASURGROUPS
;
i
++
)
prnt
(
"%02d %*s %10s %i
\n
"
,
i
,
TELNET_MAXMEASURNAME_LEN
-
1
,
measurgroups
[
i
]
.
groupname
,
grouptypes
[
measurgroups
[
i
]
.
type
],
measurgroups
[
i
].
size
);
}
/* measurcmd_display_groups */
uint64_t
measurcmd_getstatvalue
(
telnet_ltemeasurdef_t
*
measur
,
telnet_printfunc_t
prnt
)
{
...
...
@@ -105,7 +114,7 @@ void measurcmd_display_macstats_ue(telnet_printfunc_t prnt) {
for
(
int
i
=
0
;
i
<
UE_list
->
numactiveCCs
[
UE_id
];
i
++
)
{
int
CC_id
=
UE_list
->
ordered_CCids
[
i
][
UE_id
];
prnt
(
"%s UE %i Id %i CCid %i %s
\n
"
,
HDR
,
i
,
UE_id
,
CC_id
,
HDR
);
eNB_UE_STATS
*
macstatptr
=
&
(
UE_list
->
eNB_UE_stats
[
CC_id
][
UE_id
]);
eNB_UE_STATS
*
mac
ue
statptr
=
&
(
UE_list
->
eNB_UE_stats
[
CC_id
][
UE_id
]);
telnet_ltemeasurdef_t
statsptr
[]
=
LTEMAC_UEMEASURE
;
measurcmd_display_measures
(
prnt
,
statsptr
,
sizeof
(
statsptr
)
/
sizeof
(
telnet_ltemeasurdef_t
));
}
...
...
@@ -178,19 +187,28 @@ int idx1, idx2;
if
(
s
>
0
)
{
if
(
strcmp
(
subcmd
,
"groups"
)
==
0
)
measurcmd_display_groups
(
prnt
);
else
if
(
strcmp
(
subcmd
,
"lte"
)
==
0
)
{
measurcmd_display_macstats
(
prnt
);
measurcmd_display_macstats_ue
(
prnt
);
measurcmd_display_rlcstats
(
prnt
);
else
{
for
(
int
i
=
0
;
i
<
TELNET_NUM_MEASURTYPES
;
i
++
)
{
if
(
strcmp
(
subcmd
,
grouptypes
[
i
])
==
0
)
{
for
(
int
j
=
0
;
j
<
TELNET_NUM_MEASURGROUPS
;
j
++
)
{
if
(
i
==
measurgroups
[
j
].
type
)
{
measurgroups
[
j
].
displayfunc
(
prnt
);
}
}
/* for j...*/
}
}
/* for i...*/
for
(
int
i
=
0
;
i
<
TELNET_NUM_MEASURGROUPS
;
i
++
)
{
if
(
strcmp
(
subcmd
,
measurgroups
[
i
].
groupname
)
==
0
)
{
measurgroups
[
i
].
displayfunc
(
prnt
);
break
;
}
}
}
else
prnt
(
"%s: Unknown command
\n
"
,
buf
);
free
(
subcmd
);
}
free
(
subcmd
);
}
/* s>0 */
return
0
;
}
/*-------------------------------------------------------------------------------------*/
void
add_measur_cmds
(
void
)
...
...
common/utils/telnetsrv/telnetsrv_measurments.h
View file @
bbf4cc31
...
...
@@ -56,12 +56,14 @@ typedef struct ltemeasurdef {
unsigned
int
statemask
;
}
telnet_ltemeasurdef_t
;
#define GROUP_LTE
MACSTATS
0
#define GROUP_LTE
STATS
0
#define GROUP_CPUSTATS 1
typedef
void
(
*
measur_dislayfunc_t
)(
telnet_printfunc_t
prnt
);
typedef
struct
mesurgroupdef
{
char
groupname
[
TELNET_MAXMEASURNAME_LEN
];
unsigned
char
type
;
unsigned
char
size
;
measur_dislayfunc_t
displayfunc
;
union
{
telnet_cpumeasurdef_t
*
cpustats
;
telnet_ltemeasurdef_t
*
ltestats
;
...
...
@@ -106,29 +108,29 @@ typedef struct mesurgroupdef {
#define LTEMAC_UEMEASURE \
{ \
{"dlsch_mcs1", &(macstatptr->dlsch_mcs1),TELNET_VARTYPE_INT8,0},\
{"dlsch_mcs2", &(macstatptr->dlsch_mcs2),TELNET_VARTYPE_INT8,0},\
{"rbs_used", &(macstatptr->rbs_used),TELNET_VARTYPE_INT32,0},\
{"rbs_used_retx", &(macstatptr->rbs_used_retx),TELNET_VARTYPE_INT16,0},\
{"total_rbs_used", &(macstatptr->total_rbs_used),TELNET_VARTYPE_INT16,0},\
{"ncce_used", &(macstatptr->ncce_used),TELNET_VARTYPE_INT16,0},\
{"ncce_used_retx", &(macstatptr->ncce_used_retx),TELNET_VARTYPE_INT16,0},\
{"TBS", &(macstatptr->TBS),TELNET_VARTYPE_INT32,0},\
{"total_pdu_bytes", &(macstatptr->total_pdu_bytes),TELNET_VARTYPE_INT64,0},\
{"total_num_pdus", &(macstatptr->total_num_pdus),TELNET_VARTYPE_INT32,0},\
{"overhead_bytes", &(macstatptr->overhead_bytes),TELNET_VARTYPE_INT64,0},\
{"crnti", &(macstatptr->crnti),TELNET_VARTYPE_INT16,0},\
{"normalized_rx_power", &(macstatptr->normalized_rx_power),TELNET_VARTYPE_INT32,0},\
{"target_rx_power", &(macstatptr->target_rx_power),TELNET_VARTYPE_INT32,0},\
{"ulsch_mcs1", &(macstatptr->ulsch_mcs1),TELNET_VARTYPE_INT8,0},\
{"ulsch_mcs2", &(macstatptr->ulsch_mcs2),TELNET_VARTYPE_INT8,0},\
{"rbs_used_rx", &(macstatptr->rbs_used_rx),TELNET_VARTYPE_INT32,0},\
{"rbs_used_retx_rx", &(macstatptr->rbs_used_retx_rx),TELNET_VARTYPE_INT32,0},\
{"total_rbs_used_rx", &(macstatptr->total_rbs_used_rx),TELNET_VARTYPE_INT32,0},\
{"ulsch_TBS", &(macstatptr->ulsch_TBS),TELNET_VARTYPE_INT32,0},\
{"total_pdu_bytes_rx", &(macstatptr->total_pdu_bytes_rx),TELNET_VARTYPE_INT64,0},\
{"total_num_pdus_rx", &(macstatptr->total_num_pdus_rx),TELNET_VARTYPE_INT32,0},\
{"num_errors_rx", &(macstatptr->num_errors_rx),TELNET_VARTYPE_INT32,0},\
{"dlsch_mcs1", &(mac
ue
statptr->dlsch_mcs1),TELNET_VARTYPE_INT8,0},\
{"dlsch_mcs2", &(mac
ue
statptr->dlsch_mcs2),TELNET_VARTYPE_INT8,0},\
{"rbs_used", &(mac
ue
statptr->rbs_used),TELNET_VARTYPE_INT32,0},\
{"rbs_used_retx", &(mac
ue
statptr->rbs_used_retx),TELNET_VARTYPE_INT16,0},\
{"total_rbs_used", &(mac
ue
statptr->total_rbs_used),TELNET_VARTYPE_INT16,0},\
{"ncce_used", &(mac
ue
statptr->ncce_used),TELNET_VARTYPE_INT16,0},\
{"ncce_used_retx", &(mac
ue
statptr->ncce_used_retx),TELNET_VARTYPE_INT16,0},\
{"TBS", &(mac
ue
statptr->TBS),TELNET_VARTYPE_INT32,0},\
{"total_pdu_bytes", &(mac
ue
statptr->total_pdu_bytes),TELNET_VARTYPE_INT64,0},\
{"total_num_pdus", &(mac
ue
statptr->total_num_pdus),TELNET_VARTYPE_INT32,0},\
{"overhead_bytes", &(mac
ue
statptr->overhead_bytes),TELNET_VARTYPE_INT64,0},\
{"crnti", &(mac
ue
statptr->crnti),TELNET_VARTYPE_INT16,0},\
{"normalized_rx_power", &(mac
ue
statptr->normalized_rx_power),TELNET_VARTYPE_INT32,0},\
{"target_rx_power", &(mac
ue
statptr->target_rx_power),TELNET_VARTYPE_INT32,0},\
{"ulsch_mcs1", &(mac
ue
statptr->ulsch_mcs1),TELNET_VARTYPE_INT8,0},\
{"ulsch_mcs2", &(mac
ue
statptr->ulsch_mcs2),TELNET_VARTYPE_INT8,0},\
{"rbs_used_rx", &(mac
ue
statptr->rbs_used_rx),TELNET_VARTYPE_INT32,0},\
{"rbs_used_retx_rx", &(mac
ue
statptr->rbs_used_retx_rx),TELNET_VARTYPE_INT32,0},\
{"total_rbs_used_rx", &(mac
ue
statptr->total_rbs_used_rx),TELNET_VARTYPE_INT32,0},\
{"ulsch_TBS", &(mac
ue
statptr->ulsch_TBS),TELNET_VARTYPE_INT32,0},\
{"total_pdu_bytes_rx", &(mac
ue
statptr->total_pdu_bytes_rx),TELNET_VARTYPE_INT64,0},\
{"total_num_pdus_rx", &(mac
ue
statptr->total_num_pdus_rx),TELNET_VARTYPE_INT32,0},\
{"num_errors_rx", &(mac
ue
statptr->num_errors_rx),TELNET_VARTYPE_INT32,0},\
}
#define LTE_RLCMEASURE \
...
...
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