Commit 9a7d4426 authored by Manu Agrawal's avatar Manu Agrawal

Updated logging

parent 83c603e2
......@@ -43,14 +43,14 @@ enum MsgUserId
extern SSConfigContext_t SS_context;
static void ss_dumpReqMsg(struct NR_SYSTEM_CTRL_REQ *msg)
{
LOG_A(NR_RRC, "NrSysProcess: received from the TTCN\n");
LOG_A(NR_RRC, "\tCommon:\n");
LOG_A(NR_RRC, "\t\tCellId=%d\n", msg->Common.CellId);
LOG_A(NR_RRC, "\t\tRoutingInfo=%d\n", msg->Common.RoutingInfo.d);
LOG_A(NR_RRC, "\t\tTimingInfo=%d\n", msg->Common.TimingInfo.d);
LOG_A(NR_RRC, "\t\tCnfFlag=%d\n", msg->Common.ControlInfo.CnfFlag);
LOG_A(NR_RRC, "\t\tFollowOnFlag=%d\n", msg->Common.ControlInfo.FollowOnFlag);
LOG_A(NR_RRC, "\tRequest=%d\n", msg->Request.d);
LOG_A(GNB_APP, "NrSysProcess: received from the TTCN\n");
LOG_A(GNB_APP, "\tCommon:\n");
LOG_A(GNB_APP, "\t\tCellId=%d\n", msg->Common.CellId);
LOG_A(GNB_APP, "\t\tRoutingInfo=%d\n", msg->Common.RoutingInfo.d);
LOG_A(GNB_APP, "\t\tTimingInfo=%d\n", msg->Common.TimingInfo.d);
LOG_A(GNB_APP, "\t\tCnfFlag=%d\n", msg->Common.ControlInfo.CnfFlag);
LOG_A(GNB_APP, "\t\tFollowOnFlag=%d\n", msg->Common.ControlInfo.FollowOnFlag);
LOG_A(GNB_APP, "\tRequest=%d\n", msg->Request.d);
}
void ss_nr_port_man_send_cnf(struct NR_SYSTEM_CTRL_CNF recvCnf)
......@@ -71,7 +71,7 @@ void ss_nr_port_man_send_cnf(struct NR_SYSTEM_CTRL_CNF recvCnf)
cnf.Common.Result.d = recvCnf.Common.Result.d;
cnf.Common.Result.v.Success = recvCnf.Common.Result.v.Success;
cnf.Confirm.d = recvCnf.Confirm.d;
LOG_A(NR_RRC, "[SS-PORTMAN] Attn CNF received cellId %d result %d type %d \n",
LOG_A(GNB_APP, "[SS-PORTMAN] Attn CNF received cellId %d result %d type %d \n",
cnf.Common.CellId,cnf.Common.Result.d, recvCnf.Confirm.d);
switch (recvCnf.Confirm.d)
{
......@@ -80,7 +80,7 @@ void ss_nr_port_man_send_cnf(struct NR_SYSTEM_CTRL_CNF recvCnf)
break;
default:
LOG_A(NR_RRC, "[SYS] Error not handled CNF TYPE to [SS-PORTMAN] %d \n", recvCnf.Confirm.d);
LOG_A(GNB_APP, "[SYS] Error not handled CNF TYPE to [SS-PORTMAN] %d \n", recvCnf.Confirm.d);
}
/* Encode message
......@@ -95,14 +95,14 @@ void ss_nr_port_man_send_cnf(struct NR_SYSTEM_CTRL_CNF recvCnf)
status = acpSendMsg(nrctx_g, msgSize, buffer);
if (status != 0)
{
LOG_A(NR_RRC, "[SS-PORTMAN] acpSendMsg failed. Error : %d on fd: %d\n",
LOG_A(GNB_APP, "[SS-PORTMAN] acpSendMsg failed. Error : %d on fd: %d\n",
status, acpGetSocketFd(nrctx_g));
acpFree(buffer);
return;
}
else
{
LOG_A(NR_RRC, "[SS-PORTMAN] acpSendMsg Success \n");
LOG_A(GNB_APP, "[SS-PORTMAN] acpSendMsg Success \n");
}
// Free allocated buffer
acpFree(buffer);
......@@ -169,14 +169,14 @@ void ss_nr_port_man_send_data(
status = acpSendMsg(nrctx_g, msgSize, buffer);
if (status != 0)
{
LOG_A(NR_RRC, "[SS-PORTMAN] acpSendMsg failed. Error : %d on fd: %d\n",
LOG_A(GNB_APP, "[SS-PORTMAN] acpSendMsg failed. Error : %d on fd: %d\n",
status, acpGetSocketFd(nrctx_g));
acpFree(buffer);
return;
}
else
{
LOG_A(NR_RRC, "[SS-PORTMAN GNB] acpSendMsg Success \n");
LOG_A(GNB_APP, "[SS-PORTMAN GNB] acpSendMsg Success \n");
}
// Free allocated buffer
acpFree(buffer);
......@@ -185,7 +185,7 @@ void ss_nr_port_man_send_data(
void ss_gNB_port_man_init(void)
{
IpAddress_t ipaddr;
LOG_A(NR_RRC, "[SS-PORTMAN-GNB] Starting GNB System Simulator Manager\n");
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] Starting GNB System Simulator Manager\n");
const char *hostIp;
hostIp = RC.ss.hostIp;
......@@ -208,11 +208,11 @@ void ss_gNB_port_man_init(void)
int ret = acpServerInitWithCtx(ipaddr, port, msgTable, aSize, &nrctx_g);
if (ret < 0)
{
LOG_A(NR_RRC, "[SS-PORTMAN-GNB] Connection failure err=%d\n", ret);
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] Connection failure err=%d\n", ret);
return;
}
int fd1 = acpGetSocketFd(nrctx_g);
LOG_A(NR_RRC, "[SS-PORTMAN-GNB] Connection performed : %d\n", fd1);
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] Connection performed : %d\n", fd1);
//itti_subscribe_event_fd(TASK_SS_PORTMAN, fd1);
......@@ -255,33 +255,10 @@ static inline void ss_gNB_read_from_socket(acpCtx_t ctx)
else if (userId == 0)
{
// No message (timeout on socket)
//Send Dummy Wake up ITTI message to SRB task.
if (RC.ss.mode >= SS_SOFTMODEM && RC.ss.State >= SS_STATE_CELL_ACTIVE)
{
#if 0
LOG_A(NR_RRC,"[SS-PORTMAN-5GNR] Sending Wake up signal to SRB task \n");
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, INSTANCE_DEFAULT, SS_RRC_PDU_IND);
if (message_p)
{
/* Populate the message to SS */
SS_RRC_PDU_IND(message_p).sdu_size = 1;
SS_RRC_PDU_IND(message_p).srb_id = -1;
SS_RRC_PDU_IND(message_p).rnti = -1;
SS_RRC_PDU_IND(message_p).frame = -1;
SS_RRC_PDU_IND(message_p).subframe = -1;
int send_res = itti_send_msg_to_task(TASK_SS_SRB, INSTANCE_DEFAULT, message_p);
if (send_res < 0)
{
LOG_A(NR_RRC, "Error in itti_send_msg_to_task");
}
}
#endif
}
}
else
{
LOG_A(NR_RRC, "[SS-PORTMAN-GNB] received msg %d from the client.\n", userId);
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] received msg %d from the client.\n", userId);
if (acpNrSysProcessDecSrv(ctx, buffer, msgSize, &req) != 0)
return;
......@@ -314,20 +291,20 @@ void *ss_port_man_5G_NR_process_itti_msg(void *notUsed)
if (received_msg != NULL)
{
LOG_A(NR_RRC, "[SS-PORTMAN-GNB] Received a message id : %d \n",
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] Received a message id : %d \n",
ITTI_MSG_ID(received_msg));
switch (ITTI_MSG_ID(received_msg))
{
case SS_NRSET_TIM_INFO:
{
LOG_A(NR_RRC, "[SS-PORTMAN-GNB] Received NR timing info \n");
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] Received NR timing info \n");
ss_nr_port_man_send_data(0, 0, &received_msg->ittiMsg.ss_nrset_timinfo);
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
}
break;
case SS_NR_SYS_PORT_MSG_CNF:
{
LOG_A(NR_RRC, "[SS-PORTMAN-GNB] Received SS_NR_SYS_PORT_MSG_CNF \n");
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] Received SS_NR_SYS_PORT_MSG_CNF \n");
ss_nr_port_man_send_cnf(*(SS_NR_SYS_PORT_MSG_CNF(received_msg).cnf));
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
}
......@@ -337,7 +314,7 @@ void *ss_port_man_5G_NR_process_itti_msg(void *notUsed)
break;
default:
LOG_A(NR_RRC, "[SS-PORTMAN-GNB] Received unhandled message %d:%s\n",
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] Received unhandled message %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
}
......
......@@ -70,13 +70,13 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
/* The request has send confirm flag flase so do nothing in this funciton */
if (reqCnfFlag_g == FALSE)
{
LOG_A(NR_RRC, "[SYS-GNB] No confirm required\n");
LOG_A(GNB_APP, "[SYS-GNB] No confirm required\n");
return ;
}
if (message_p)
{
LOG_A(NR_RRC, "[SYS-GNB] Send SS_NR_SYS_PORT_MSG_CNF\n");
LOG_A(GNB_APP, "[SYS-GNB] Send SS_NR_SYS_PORT_MSG_CNF\n");
msgCnf->Common.CellId = SS_context.eutra_cellId;
msgCnf->Common.Result.d = resType;
msgCnf->Common.Result.v.Success = resVal;
......@@ -85,18 +85,18 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
{
case NR_SystemConfirm_Type_Cell:
{
LOG_A(NR_RRC, "[SYS-GNB] Send confirm for cell configuration\n");
LOG_A(GNB_APP, "[SYS-GNB] Send confirm for cell configuration\n");
msgCnf->Confirm.v.Cell = true;
break;
}
default:
LOG_A(NR_RRC, "[SYS-GNB] Error not handled CNF TYPE to [SS-PORTMAN-GNB]");
LOG_A(GNB_APP, "[SYS-GNB] Error not handled CNF TYPE to [SS-PORTMAN-GNB]");
}
SS_NR_SYS_PORT_MSG_CNF(message_p).cnf = msgCnf;
int send_res = itti_send_msg_to_task(TASK_SS_PORTMAN_GNB, INSTANCE_DEFAULT, message_p);
if (send_res < 0)
{
LOG_A(NR_RRC, "[SYS-GNB] Error sending to [SS-PORTMAN-GNB]");
LOG_A(GNB_APP, "[SYS-GNB] Error sending to [SS-PORTMAN-GNB]");
}
}
}
......@@ -109,14 +109,14 @@ static void sys_handle_nr_enquire_timing(ss_nrset_timinfo_t *tinfo)
MessageDef *message_p = itti_alloc_new_message(TASK_SYS_GNB, INSTANCE_DEFAULT, SS_NRSET_TIM_INFO);
if (message_p)
{
LOG_A(NR_RRC, "[SYS-GNB] Reporting info sfn:%d\t slot:%d.\n", tinfo->sfn, tinfo->slot);
LOG_A(GNB_APP, "[SYS-GNB] Reporting info sfn:%d\t slot:%d.\n", tinfo->sfn, tinfo->slot);
SS_NRSET_TIM_INFO(message_p).slot = tinfo->slot;
SS_NRSET_TIM_INFO(message_p).sfn = tinfo->sfn;
int send_res = itti_send_msg_to_task(TASK_SS_PORTMAN_GNB, INSTANCE_DEFAULT, message_p);
if (send_res < 0)
{
LOG_A(NR_RRC, "[SYS-GNB] Error sending to [SS-PORTMAN-GNB]");
LOG_A(GNB_APP, "[SYS-GNB] Error sending to [SS-PORTMAN-GNB]");
}
}
}
......@@ -137,18 +137,18 @@ static void ss_task_sys_nr_handle_req(struct NR_SYSTEM_CTRL_REQ *req, ss_nrset_t
int enterState = RC.ss.State;
if(req->Common.CellId)
SS_context.eutra_cellId = req->Common.CellId;
LOG_A(NR_RRC, "[SYS-GNB] Current SS_STATE %d received SystemRequest_Type %d eutra_cellId %d cnf_flag %d\n",
LOG_A(GNB_APP, "[SYS-GNB] Current SS_STATE %d received SystemRequest_Type %d eutra_cellId %d cnf_flag %d\n",
RC.ss.State, req->Request.d, SS_context.eutra_cellId, req->Common.ControlInfo.CnfFlag);
switch (RC.ss.State)
{
case SS_STATE_NOT_CONFIGURED:
if (req->Request.d == NR_SystemRequest_Type_Cell)
{
LOG_A(NR_RRC, "[SYS-GNB] NR_SystemRequest_Type_Cell received\n");
LOG_A(GNB_APP, "[SYS-GNB] NR_SystemRequest_Type_Cell received\n");
}
else
{
LOG_E(NR_RRC, "[SYS-GNB] Error ! SS_STATE %d Invalid SystemRequest_Type %d received\n",
LOG_E(GNB_APP, "[SYS-GNB] Error ! SS_STATE %d Invalid SystemRequest_Type %d received\n",
RC.ss.State, req->Request.d);
}
break;
......@@ -156,20 +156,20 @@ static void ss_task_sys_nr_handle_req(struct NR_SYSTEM_CTRL_REQ *req, ss_nrset_t
if (req->Request.d == NR_SystemRequest_Type_EnquireTiming)
{
sys_handle_nr_enquire_timing(tinfo);
LOG_A(NR_RRC, "[SYS-GNB] NR_SystemRequest_Type_EnquireTiming received\n");
LOG_A(GNB_APP, "[SYS-GNB] NR_SystemRequest_Type_EnquireTiming received\n");
}
else
{
LOG_E(NR_RRC, "[SYS-GNB] Error ! SS_STATE %d Invalid SystemRequest_Type %d received\n",
LOG_E(GNB_APP, "[SYS-GNB] Error ! SS_STATE %d Invalid SystemRequest_Type %d received\n",
RC.ss.State, req->Request.d);
}
break;
default:
LOG_E(NR_RRC, "[SYS-GNB] Error ! SS_STATE %d Invalid SystemRequest_Type %d received\n",
LOG_E(GNB_APP, "[SYS-GNB] Error ! SS_STATE %d Invalid SystemRequest_Type %d received\n",
RC.ss.State, req->Request.d);
break;
}
LOG_A(NR_RRC, "[SYS-GNB] SS_STATE %d New SS_STATE %d received SystemRequest_Type %d\n",
LOG_A(GNB_APP, "[SYS-GNB] SS_STATE %d New SS_STATE %d received SystemRequest_Type %d\n",
enterState, RC.ss.State, req->Request.d);
}
......@@ -193,7 +193,7 @@ bool valid_nr_sys_msg(struct NR_SYSTEM_CTRL_REQ *req)
bool sendDummyCnf = TRUE;
enum NR_SystemConfirm_Type_Sel cnfType = 0;
LOG_A(NR_RRC, "[SYS-GNB] received req : %d for cell %d RC.ss.state %d \n",
LOG_A(GNB_APP, "[SYS-GNB] received req : %d for cell %d RC.ss.state %d \n",
req->Request.d, req->Common.CellId, RC.ss.State);
switch (req->Request.d)
{
......@@ -220,7 +220,7 @@ bool valid_nr_sys_msg(struct NR_SYSTEM_CTRL_REQ *req)
if (sendDummyCnf)
{
send_sys_cnf(resType, resVal, cnfType, NULL);
LOG_A(NR_RRC, "[SYS-GNB] Sending Dummy OK Req %d cnTfype %d ResType %d ResValue %d\n",
LOG_A(GNB_APP, "[SYS-GNB] Sending Dummy OK Req %d cnTfype %d ResType %d ResValue %d\n",
req->Request.d, cnfType, resType, resVal);
}
return valid;
......@@ -252,7 +252,7 @@ void *ss_gNB_sys_process_itti_msg(void *notUsed)
{
case SS_NRUPD_TIM_INFO:
{
LOG_A(NR_RRC, "TASK_SYS_GNB received SS_NRUPD_TIM_INFO with sfn=%d slot=%d\n", SS_NRUPD_TIM_INFO(received_msg).sfn, SS_NRUPD_TIM_INFO(received_msg).slot);
LOG_A(GNB_APP, "TASK_SYS_GNB received SS_NRUPD_TIM_INFO with sfn=%d slot=%d\n", SS_NRUPD_TIM_INFO(received_msg).sfn, SS_NRUPD_TIM_INFO(received_msg).slot);
tinfo.slot = SS_NRUPD_TIM_INFO(received_msg).slot;
tinfo.sfn = SS_NRUPD_TIM_INFO(received_msg).sfn;
}
......@@ -267,7 +267,7 @@ void *ss_gNB_sys_process_itti_msg(void *notUsed)
}
else
{
LOG_A(NR_RRC, "TASK_SYS_GNB: Not handled SYS_PORT message received \n");
LOG_A(GNB_APP, "TASK_SYS_GNB: Not handled SYS_PORT message received \n");
}
}
break;
......@@ -278,7 +278,7 @@ void *ss_gNB_sys_process_itti_msg(void *notUsed)
break;
}
default:
LOG_A(NR_RRC, "TASK_SYS_GNB: Received unhandled message %d:%s\n",
LOG_A(GNB_APP, "TASK_SYS_GNB: Received unhandled message %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment