fix LOG_X macros
Some of them might not be correctly handled. I put /* TODO: XXX */ where I didn't know if the fix was correct.
This commit is contained in:
@@ -199,7 +199,11 @@ display_node_list (node_list * node_vector)
|
||||
//use a python script to postprocess the positions, check the
|
||||
|
||||
// support: view node mobility of one node during the entire simulation OR only one snapshot
|
||||
LOG_F(OMG,"%d; %.3f; %.3f; %.3f\n",
|
||||
/* TODO: this LOG_F generates a warning, below is a fix that removes a %.3f, maybe it's not the correct fix */
|
||||
/*LOG_F(OMG,"%d; %.3f; %.3f; %.3f\n",
|
||||
tmp->node->id,
|
||||
tmp->node->x_pos, tmp->node->y_pos);*/
|
||||
LOG_F(OMG,"%d; %.3f; %.3f\n",
|
||||
tmp->node->id,
|
||||
tmp->node->x_pos, tmp->node->y_pos);
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ static void *opt_listener_thread(void *arg)
|
||||
pthread_exit(NULL);
|
||||
} else {
|
||||
/* Normal read -> discard PDU */
|
||||
LOG_D(OPT, "Incoming data received from: %s:%u with length %d\n",
|
||||
LOG_D(OPT, "Incoming data received from: %s:%u with length %zd\n",
|
||||
inet_ntoa(opt_listener.address.sin_addr),
|
||||
ntohs(opt_listener.address.sin_port), ret);
|
||||
}
|
||||
@@ -198,7 +198,9 @@ int opt_create_listener_socket(char *ip_address, uint16_t port)
|
||||
ret = bind(opt_listener.sd, (struct sockaddr*) &opt_listener.address, sizeof(opt_listener.address));
|
||||
|
||||
if (ret != 0) {
|
||||
LOG_E(OPT, "Failed to bind socket to (%s:%u): %s\n", strerror(errno));
|
||||
LOG_E(OPT, "Failed to bind socket to (%s:%u): %s\n",
|
||||
inet_ntoa(opt_listener.address.sin_addr),
|
||||
ntohs(opt_listener.address.sin_port), strerror(errno));
|
||||
opt_type = OPT_NONE;
|
||||
close(opt_listener.sd);
|
||||
opt_listener.sd = -1;
|
||||
@@ -358,7 +360,7 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
|
||||
(const struct sockaddr *)&g_serv_addr, sizeof(g_serv_addr));
|
||||
|
||||
if (bytesSent != frameOffset) {
|
||||
LOG_W(OPT, "sendto() failed (not a thread-safe func)- expected %d bytes, got %d (errno=%d)\n",
|
||||
LOG_W(OPT, "sendto() failed (not a thread-safe func)- expected %d bytes, got %ld (errno=%d)\n",
|
||||
frameOffset, bytesSent, errno);
|
||||
//exit(1);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ void average_total_jitter(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(OTG,"average_jitter_dl %d average_jitter_ul %lf \n",otg_info->average_jitter_dl,otg_info->average_jitter_ul );
|
||||
LOG_I(OTG,"average_jitter_dl %lf average_jitter_ul %lf \n",otg_info->average_jitter_dl,otg_info->average_jitter_ul );
|
||||
// otg_info->average_jitter_dl/= (float)NB_UE_INST;
|
||||
// otg_info->average_jitter_ul/= (float)NB_UE_INST;
|
||||
}
|
||||
|
||||
@@ -106,8 +106,10 @@ int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buff
|
||||
|
||||
if (dst_instance != dst_instanceP) {
|
||||
//#warning "LG: TODO think about multicast traffic"
|
||||
LOG_W(OTG,"[SRC %d][DST %d] [FLOW_idx %d][APP TYPE %d] RX INFO pkt at time %d: flag 0x %x, seq number %d, tx time %d, size (hdr %d, pdcp %d) not for dest instance %u\n",
|
||||
dst_instanceP);
|
||||
/* TODO: fix this LOG, a lot of missing parameters, replaced by a simple basic version */
|
||||
/*LOG_W(OTG,"[SRC %d][DST %d] [FLOW_idx %d][APP TYPE %d] RX INFO pkt at time %d: flag 0x %x, seq number %d, tx time %d, size (hdr %d, pdcp %d) not for dest instance %u\n",
|
||||
dst_instanceP);*/
|
||||
LOG_W(OTG,"dst_instance != dst_instanceP\n");
|
||||
}
|
||||
|
||||
if(otg_hdr_rx->traffic_type > MAX_NUM_APPLICATION) {
|
||||
@@ -246,7 +248,7 @@ int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buff
|
||||
ctime - otg_hdr_rx->time,
|
||||
nb_loss_pkts);
|
||||
|
||||
LOG_I(OTG,"INFO LATENCY :: [SRC %d][DST %d] radio access %.2f (tx time %d, ctime %d), OWD:%.2f (ms):\n",
|
||||
LOG_I(OTG,"INFO LATENCY :: [SRC %d][DST %d] radio access %.2f (tx time %d, ctime %d), OWD:%d (ms):\n",
|
||||
src_instance,
|
||||
dst_instance,
|
||||
otg_multicast_info->radio_access_delay[src_instance][dst_instance],
|
||||
|
||||
@@ -305,10 +305,10 @@ unsigned char *packet_gen(
|
||||
otg_info->tx_num_pkt[src_instance][dst_instance][otg_info->traffic_type[src_instance][dst_instance]]+=1;
|
||||
|
||||
if (size!=strlen(payload))
|
||||
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %d, seq_num %d packet: |%s|%s| \n",
|
||||
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %zu, seq_num %d packet: |%s|%s| \n",
|
||||
src_instance, dst_instance, flag, size, strlen(payload), seq_num, header, payload);
|
||||
else
|
||||
LOG_D(OTG,"[%d][%d] 0x %x][m2m Aggre %d][Flow %d][Type %d/%s] TX INFO pkt at time %d Size= [payload %d] [Total %d] with seq num %d, state=%d : |%s|%s| \n",
|
||||
LOG_D(OTG,"[%d][%d] 0x %x][m2m Aggre %d][Flow %d][Type %d/%s] TX INFO pkt at time %d Size= [payload %d] [Total %zu] with seq num %d, state=%d : |%s|%s| \n",
|
||||
src_instance, dst_instance, flag,
|
||||
otg_info->m2m_aggregation[src_instance][dst_instance],
|
||||
otg_info->flow_id[src_instance][dst_instance],
|
||||
@@ -335,7 +335,7 @@ unsigned char *packet_gen(
|
||||
otg_info->seq_num_background[src_instance][dst_instance]+=1;
|
||||
|
||||
if (otg_info->size_background[src_instance][dst_instance]!=strlen(payload))
|
||||
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %d, seq num %d, packet |%s|%s| \n",
|
||||
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %zu, seq num %d, packet |%s|%s| \n",
|
||||
src_instance,
|
||||
dst_instance,
|
||||
flag,
|
||||
@@ -345,7 +345,7 @@ unsigned char *packet_gen(
|
||||
header,
|
||||
payload);
|
||||
else
|
||||
LOG_D(OTG,"[%d][%d][%s][0x %x] TX INFO pkt at time %d size is %d with seq num %d, state=%d : |%s|%s| \n",
|
||||
LOG_D(OTG,"[%d][%d][0x %x][%d] TX INFO pkt at time %s size is %d with seq num %d, state=%d : |%s|%s| \n",
|
||||
src_instance,
|
||||
dst_instance,
|
||||
flag,
|
||||
@@ -459,10 +459,10 @@ unsigned char *packet_gen_multicast(
|
||||
otg_multicast_info->tx_num_bytes[src_instance][dst_instance][app]);
|
||||
|
||||
if (size!=strlen(payload))
|
||||
LOG_E(OTG,"[src %d][dst %d] The expected packet size does not match the payload size : size %d, strlen %d \n",
|
||||
LOG_E(OTG,"[src %d][dst %d] The expected packet size does not match the payload size : size %d, strlen %zu \n",
|
||||
src_instance, dst_instance, size, strlen(payload));
|
||||
else {
|
||||
LOG_I(OTG,"[src %d][dst %d]TX INFO pkt at time %d Size= [payload %d] [Total %d] with seq num %d: |%s|%s| \n",
|
||||
LOG_I(OTG,"[src %d][dst %d]TX INFO pkt at time %d Size= [payload %d] [Total %zu] with seq num %d: |%s|%s| \n",
|
||||
src_instance,
|
||||
dst_instance,
|
||||
ctime,
|
||||
@@ -838,7 +838,7 @@ unsigned int header_size(const int hdr_size)
|
||||
if (hdr_size>(sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t)))
|
||||
size-=(sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t));
|
||||
else
|
||||
LOG_W(OTG,"OTG Header not included inside packet header (OTG header:%d, Header%d)\n", hdr_size, sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t) );
|
||||
LOG_W(OTG,"OTG Header not included inside packet header (OTG header:%d, Header%zu)\n", hdr_size, sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t) );
|
||||
|
||||
return(size);
|
||||
|
||||
@@ -1211,7 +1211,7 @@ void init_predef_traffic(
|
||||
break;
|
||||
|
||||
case M2M_TRAFFIC : /* example of M2M traffic */
|
||||
LOG_I(OTG," M2M_TRAFFIC, src = %d, dst = %d \n", i, j, g_otg->application_type[i][j][k]);
|
||||
LOG_I(OTG," M2M_TRAFFIC, src = %d, dst = %d, application type = %d\n", i, j, g_otg->application_type[i][j][k]);
|
||||
g_otg->trans_proto[i][j][k] = TCP;
|
||||
g_otg->ip_v[i][j][k] = IPV4;
|
||||
g_otg->pu_size_pkts[i][j][k]=50;
|
||||
@@ -2015,7 +2015,7 @@ void state_management(
|
||||
&& (otg_info->state_transition_prob[src_instance][dst_instance][application]<=1))
|
||||
&& (otg_info->c_holding_time_off[src_instance][dst_instance]>=g_otg->holding_time_off_pe[src_instance][dst_instance])) {
|
||||
otg_info->state[src_instance][dst_instance][application]=PE_STATE;
|
||||
LOG_I(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: OFF-->PE \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance]);
|
||||
LOG_I(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: OFF-->PE \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
|
||||
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user