Commit 10a764c4 authored by gauthier's avatar gauthier

Traces + shift timing bug

parent 83e48d39
......@@ -141,10 +141,14 @@ void et_get_shift_arg( char * line_argument, shift_packet_t * const shift)
while ((line_argument[i] != ':') && (i < len)) {
my_num[i] = line_argument[i];
if (isdigit(line_argument[i])) { // may occur '\"'
my_num[j++] = line_argument[i];
}
i += 1;
}
my_num[i++] = '\0';
AssertFatal(':' == line_argument[i], "Bad format");
i += 1; // ':'
my_num[j++] = '\0';
shift->frame_number = atoi(my_num);
AssertFatal(i<len, "Shift argument %s bad format", line_argument);
......@@ -155,6 +159,7 @@ void et_get_shift_arg( char * line_argument, shift_packet_t * const shift)
i += 1;
}
AssertFatal(i<len, "Shift argument %s bad format", line_argument);
j = 0;
while ((line_argument[i] != '.') && (i < len)) {
my_num[j++] = line_argument[i++];
}
......@@ -830,13 +835,13 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s
while (shift) {
packet = scenario->list_packet;
while (packet) {
// fprintf(stdout, "*shift: %p\n", shift);
// fprintf(stdout, "\tframe_number: %p\n", shift->frame_number);
// fprintf(stdout, "\tshift_seconds: %ld\n", shift->shift_seconds);
// fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds);
// fprintf(stdout, "\tsingle: %d\n\n", shift->single);
// fprintf(stdout, "\tshift_all_packets_seconds: %ld\n", shift_all_packets.tv_sec);
// fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec);
fprintf(stdout, "*shift: %p\n", shift);
fprintf(stdout, "\tframe_number: %d\n", shift->frame_number);
fprintf(stdout, "\tshift_seconds: %ld\n", shift->shift_seconds);
fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds);
fprintf(stdout, "\tsingle: %d\n\n", shift->single);
fprintf(stdout, "\tshift_all_packets_seconds: %ld\n", shift_all_packets.tv_sec);
fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec);
AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0),
"Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u",
......@@ -891,11 +896,11 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s
shift_all_packets.tv_sec = shift->shift_seconds;
shift_all_packets.tv_usec = shift->shift_microseconds;
timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets);
// fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n",
// packet->packet_number,
// packet->original_frame_number,
// packet->time_relative_to_first_packet.tv_sec,
// packet->time_relative_to_first_packet.tv_usec);
fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n",
packet->packet_number,
packet->original_frame_number,
packet->time_relative_to_first_packet.tv_sec,
packet->time_relative_to_first_packet.tv_usec);
AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0),
"Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u",
packet->time_relative_to_first_packet.tv_sec,
......@@ -904,11 +909,11 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s
packet->original_frame_number);
} else if ((0 == shift->single) && (shift->frame_number < packet->original_frame_number)) {
timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets);
// fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n",
// packet->packet_number,
// packet->original_frame_number,
// packet->time_relative_to_first_packet.tv_sec,
// packet->time_relative_to_first_packet.tv_usec);
fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n",
packet->packet_number,
packet->original_frame_number,
packet->time_relative_to_first_packet.tv_sec,
packet->time_relative_to_first_packet.tv_usec);
AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0),
"Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u",
packet->time_relative_to_first_packet.tv_sec,
......@@ -1107,8 +1112,8 @@ et_config_parse_opt_line (
shift = shift->next;
}
shift->single = 1;
et_get_shift_arg(optarg, shift);
printf("Arg Shift packet %s\n", optarg);
et_get_shift_arg(optarg, shift);
}
break;
......
......@@ -467,7 +467,7 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con
int size = 0;
int pos = 0;
int go_deeper_in_tree = 1;
S1AP_DEBUG("%s() mme_ue_s1ap_id %u\n", __FUNCTION__, new_id);
S1AP_INFO("%s() mme_ue_s1ap_id %u\n", __FUNCTION__, new_id);
// modify
for (cur_node = (xmlNode *)node; cur_node; cur_node = cur_node->next) {
......@@ -527,7 +527,7 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con
} while (pos2 < (2*5));
// update ASN1
et_decode_s1ap(s1ap);
S1AP_DEBUG("Updated ASN1 for %s\n", showname);
S1AP_INFO("Updated ASN1 for %s\n", showname);
}
}
}
......@@ -553,6 +553,7 @@ void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xmlNodeSe
xmlNode *s1ap_node = NULL;
size = (nodes) ? nodes->nodeNr : 0;
S1AP_DEBUG("%s() num nodes %u\n", __FUNCTION__, size);
/*
* NOTE: the nodes are processed in reverse order, i.e. reverse document
......@@ -614,14 +615,19 @@ int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_
// Evaluate xpath expression
xpath_obj = xmlXPathEvalExpression(xpath_expression, xpath_ctx);
xmlXPathFreeContext(xpath_ctx);
AssertFatal(xpath_obj != NULL, "Unable to evaluate XPATH expression \"%s\"\n", xpath_expression);
if(xmlXPathNodeSetIsEmpty(xpath_obj->nodesetval)){
xmlXPathFreeObject(xpath_obj);
S1AP_DEBUG("%s() No match packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number, old_id, new_id);
return -1;
}
// update selected nodes
update_xpath_nodes_mme_ue_s1ap_id(&packet->sctp_hdr.u.data_hdr.payload, xpath_obj->nodesetval, new_id);
// Cleanup of XPath data
xmlXPathFreeObject(xpath_obj);
xmlXPathFreeContext(xpath_ctx);
return 0;
}
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