Merge remote-tracking branch 'origin/develop-ta' into integration_2022_wk41
This commit is contained in:
@@ -510,7 +510,7 @@ int process_command(char *buf) {
|
||||
cmddata->cmdfunc=(qcmdfunc_t)telnetparams.CmdParsers[i].cmd[k].cmdfunc;
|
||||
cmddata->prnt=client_printf;
|
||||
cmddata->debug=telnetparams.telnetdbg;
|
||||
cmddata->cmdbuff=strdup(cmdb);
|
||||
cmddata->cmdbuff=cmdb ? strdup(cmdb) : NULL;
|
||||
pushNotifiedFIFO(telnetparams.CmdParsers[i].cmd[k].qptr, msg);
|
||||
} else {
|
||||
telnetparams.CmdParsers[i].cmd[k].cmdfunc(cmdb, telnetparams.telnetdbg, client_printf);
|
||||
@@ -845,33 +845,42 @@ int telnetsrv_autoinit(void) {
|
||||
* function at init time. the telnet server is delivered with a set of commands which
|
||||
* will be loaded or not depending on the telnet section of the config file
|
||||
*/
|
||||
int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd) {
|
||||
int i;
|
||||
notifiedFIFO_t *afifo=NULL;
|
||||
|
||||
int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd)
|
||||
{
|
||||
if( modulename == NULL || var == NULL || cmd == NULL) {
|
||||
fprintf(stderr,"[TELNETSRV] Telnet server, add_telnetcmd: invalid parameters\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int i;
|
||||
for (i=0; i<TELNET_MAXCMD ; i++) {
|
||||
if (telnetparams.CmdParsers[i].var == NULL) {
|
||||
strncpy(telnetparams.CmdParsers[i].module,modulename,sizeof(telnetparams.CmdParsers[i].module)-1);
|
||||
telnetparams.CmdParsers[i].cmd = cmd;
|
||||
telnetparams.CmdParsers[i].var = var;
|
||||
if (cmd->cmdflags & TELNETSRV_CMDFLAG_PUSHINTPOOLQ) {
|
||||
if (afifo == NULL) {
|
||||
afifo = malloc(sizeof(notifiedFIFO_t));
|
||||
initNotifiedFIFO(afifo);
|
||||
}
|
||||
cmd->qptr = afifo;
|
||||
}
|
||||
cmdparser_t *CmdParser = &telnetparams.CmdParsers[i];
|
||||
if (CmdParser->var == NULL) {
|
||||
strncpy(CmdParser->module, modulename, sizeof(CmdParser->module) - 1);
|
||||
CmdParser->cmd = cmd;
|
||||
CmdParser->var = var;
|
||||
printf("[TELNETSRV] Telnet server: module %i = %s added to shell\n",
|
||||
i,telnetparams.CmdParsers[i].module);
|
||||
i, CmdParser->module);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == TELNET_MAXCMD) {
|
||||
fprintf(stderr, "[TELNETSRV] TELNET_MAXCMD reached, cannot add new module %s\n", modulename);
|
||||
return -1;
|
||||
}
|
||||
|
||||
notifiedFIFO_t *afifo = NULL;
|
||||
for (int k = 0; cmd[k].cmdfunc != NULL ; k++) {
|
||||
if (cmd[k].cmdflags & TELNETSRV_CMDFLAG_PUSHINTPOOLQ) {
|
||||
if (afifo == NULL) {
|
||||
afifo = malloc(sizeof(notifiedFIFO_t));
|
||||
initNotifiedFIFO(afifo);
|
||||
}
|
||||
cmd[k].qptr = afifo;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,12 +58,14 @@ void measurcmd_display_rlcstats(telnet_printfunc_t prnt);
|
||||
void measurcmd_display_phycpu(telnet_printfunc_t prnt);
|
||||
void measurcmd_display_maccpu(telnet_printfunc_t prnt);
|
||||
void measurcmd_display_pdcpcpu(telnet_printfunc_t prnt);
|
||||
void measurcmd_display_phyta(telnet_printfunc_t prnt);
|
||||
|
||||
|
||||
static telnet_measurgroupdef_t nrUEmeasurgroups[] = {
|
||||
// {"ue", GROUP_LTESTATS,0, measurcmd_display_macstats, {NULL}},
|
||||
// {"rlc", GROUP_LTESTATS,0, measurcmd_display_rlcstats, {NULL}},
|
||||
{"phycpu",GROUP_CPUSTATS,0, measurcmd_display_phycpu, {NULL}},
|
||||
{"phyta", GROUP_CPUSTATS, 0, measurcmd_display_phyta, {NULL}},
|
||||
// {"maccpu",GROUP_CPUSTATS,0, measurcmd_display_maccpu, {NULL}},
|
||||
// {"pdcpcpu",GROUP_CPUSTATS,0, measurcmd_display_pdcpcpu, {NULL}},
|
||||
};
|
||||
@@ -89,6 +91,17 @@ void measurcmd_display_phycpu(telnet_printfunc_t prnt) {
|
||||
PRINT_CPUMEAS_STATE,HDR);
|
||||
measurcmd_display_cpumeasures(prnt, cpumeasur, sizeof(cpumeasur)/sizeof(telnet_cpumeasurdef_t));
|
||||
}
|
||||
void measurcmd_display_phyta(telnet_printfunc_t prnt)
|
||||
{
|
||||
PHY_VARS_NR_UE *UE = PHY_vars_UE_g[0][0];
|
||||
prnt("%s PHY TA stats\n", HDR);
|
||||
prnt("N_TA_offset %d\n", UE->N_TA_offset);
|
||||
for (int i = 0; i < UE->n_connected_gNB; ++i) {
|
||||
NR_UL_TIME_ALIGNMENT_t *ta = &UE->ul_time_alignment[i];
|
||||
prnt("gNB %d TA command %d TA total %d TAG ID %d\n", i, ta->ta_command, ta->ta_total, ta->tag_id);
|
||||
}
|
||||
prnt("timing_advance %d (samples)\n", UE->timing_advance);
|
||||
}
|
||||
/*
|
||||
void measurcmd_display_maccpu(telnet_printfunc_t prnt) {
|
||||
eNB_MAC_INST *macvars = RC.mac[eNB_id];
|
||||
|
||||
Reference in New Issue
Block a user