Commit 983041c1 authored by Raymond Knopp's avatar Raymond Knopp

mscgen logs

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7386 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 74a53a0f
......@@ -393,7 +393,7 @@ add_boolean_option(OAISIM False "specific to oaisim")
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c")
add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams")
add_boolean_option(MESSAGE_CHART_GENERATOR True "For generating sequence diagrams")
########################
# Include order
......
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "Debug" )
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False )
set ( BYTE_ORDER=LITTLE_ENDIAN )
set ( DEBUG_OMG False )
......
......@@ -56,6 +56,7 @@ function help()
echo_error " -h, --help Print this help."
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
echo_error " -T, --target-ul-mcs mcs Uplink target MCS."
......@@ -67,7 +68,9 @@ function help()
function main()
{
local -i run_gdb=0
local -i run_mscgen=0
local exe_arguments=""
local MSC_DIR="/tmp"
until [ -z "$1" ]
do
......@@ -112,6 +115,18 @@ function main()
echo "setting ITTI dump file to: $ITTI_DUMP_FILE"
exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE"
;;
-m | --mscgen)
MSC_DIR=$2
# can omit file name if last arg on the line
if [ -d "$MSC_DIR" ]; then
echo "setting mscgen log files to dir: $MSC_DIR"
run_mscgen=1
shift 2;
else
echo_error "Mscgen log dir does not exist"
exit -1
fi
;;
-M | --target-dl-mcs)
echo "setting target dl MCS to $2"
exe_arguments="$exe_arguments -m $2"
......@@ -166,6 +181,21 @@ function main()
cat ~/.gdb_lte_softmodem
gdb -n -x ~/.gdb_lte_softmodem 2>&1 > /tmp/gdb_lte_softmodem.stdout.txt
fi
if [ $run_mscgen -eq 1 ]; then
cd $MSC_DIR
last_created_file=`ls -t mscgen* | head -1 | tr -d ':'`
$OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN
sync
last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'`
if [ x"$last_created_file" != x"$last_created_file2" ]; then
if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then
command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png
fi
fi
fi
}
......
......@@ -179,15 +179,20 @@ int msc_init(msc_env_t envP)
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S1AP_ENB");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_EPC) || (envP == MSC_MME)) {
msc_fd[i] = fopen("/tmp/openair.msc.s1ap_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.s1ap_enb.log : %s", strerror(errno));
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.s1ap_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.s1ap_enb.log : %s", strerror(errno));
} else {
msc_fd[i] = fopen("/tmp/openair.msc.s1ap_enb.epc.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.s1ap_enb.epc.log : %s", strerror(errno));
}
msc_log_declare_proto(i);
}
break;
case MSC_GTPU_ENB:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "GTPU_ENB");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA) || (envP == MSC_EPC) || (envP == MSC_SP_GW)) {
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.gtpu_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.gtpu_enb.log : %s", strerror(errno));
msc_log_declare_proto(i);
......@@ -197,8 +202,13 @@ int msc_init(msc_env_t envP)
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "GTPU_SGW");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_EPC) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.gtpu_sgw.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.gtpu_sgw.log : %s", strerror(errno));
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.gtpu_sgw.utran.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.gtpu_sgw.utran.log : %s", strerror(errno));
} else {
msc_fd[i] = fopen("/tmp/openair.msc.gtpu_sgw.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.gtpu_sgw.log : %s", strerror(errno));
}
msc_log_declare_proto(i);
}
break;
......@@ -206,8 +216,13 @@ int msc_init(msc_env_t envP)
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S1AP_MME");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_EPC) || (envP == MSC_MME) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.s1ap_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.s1ap_mme.log : %s", strerror(errno));
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.s1ap_mme.utran.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.s1ap_mme.utran.log : %s", strerror(errno));
} else {
msc_fd[i] = fopen("/tmp/openair.msc.s1ap_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.s1ap_mme.log : %s", strerror(errno));
}
msc_log_declare_proto(i);
}
break;
......@@ -223,8 +238,13 @@ int msc_init(msc_env_t envP)
case MSC_NAS_MME:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_MME");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
msc_fd[i] = fopen("/tmp/openair.msc.nas_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.nas_mme.log : %s", strerror(errno));
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.nas_mme.utran.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.nas_mme.utran.log : %s", strerror(errno));
} else {
msc_fd[i] = fopen("/tmp/openair.msc.nas_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.nas_mme.log : %s", strerror(errno));
}
msc_log_declare_proto(i);
break;
case MSC_NAS_EMM_MME:
......
......@@ -781,6 +781,13 @@ gtpv1u_create_s1u_tunnel(
GTPV1U_ENB_CREATE_TUNNEL_RESP(message_p).status = 0xFF;
}
}
MSC_LOG_TX_MESSAGE(
MSC_GTPU_ENB,
MSC_RRC_ENB,
NULL,0,
"0 GTPV1U_ENB_CREATE_TUNNEL_RESP rnti %x teid %x",
GTPV1U_ENB_CREATE_TUNNEL_RESP(message_p).rnti,
s1u_teid);
LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue rnti %x status %d\n",
create_tunnel_req_pP->rnti,
......@@ -867,6 +874,15 @@ static int gtpv1u_delete_s1u_tunnel(
GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti,
GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).enb_S1u_teid,
GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).status);
MSC_LOG_TX_MESSAGE(
MSC_GTPU_ENB,
MSC_RRC_ENB,
NULL,0,
"0 GTPV1U_ENB_DELETE_TUNNEL_RESP rnti %x teid %x",
GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti,
teid_eNB);
return itti_send_msg_to_task(TASK_RRC_ENB, instanceP, message_p);
}
......
......@@ -38,8 +38,6 @@ mme_app_itti_auth_fail(
{
MessageDef *message_p;
MSC_LOG_TX_MESSAGE(MSC_MMEAPP_MME, MSC_NAS_MME,NULL,0,
"NAS_AUTHENTICATION_PARAM_FAIL ue %06"PRIX32" cause %u",ue_id, cause);
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_PARAM_FAIL);
......
......@@ -56,6 +56,7 @@
#include "assertions.h"
#include "conversions.h"
#include "msc.h"
static
int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
......@@ -130,7 +131,7 @@ s1ap_message_decoded_callback messages_callback[][3] = {
#endif
};
static const char *direction2String[] = {
static const char *s1ap_direction2String[] = {
"", /* Nothing */
"Originating message", /* originating message */
"Successfull outcome", /* successfull outcome */
......@@ -210,7 +211,7 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
if (messages_callback[message.procedureCode][message.direction-1] == NULL) {
S1AP_ERROR("[SCTP %d] No handler for procedureCode %d in %s\n",
assoc_id, message.procedureCode,
direction2String[message.direction]);
s1ap_direction2String[message.direction]);
return -1;
}
......@@ -552,6 +553,15 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
enb_ue_s1ap_id = ueContextReleaseCommand_p->uE_S1AP_IDs.choice.uE_S1AP_ID_pair.eNB_UE_S1AP_ID;
mme_ue_s1ap_id = ueContextReleaseCommand_p->uE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID;
MSC_LOG_RX_MESSAGE(
MSC_S1AP_ENB,
MSC_S1AP_MME,
NULL,0,
"0 UEContextRelease/%s eNB_ue_s1ap_id "S1AP_UE_ID_FMT" mme_ue_s1ap_id "S1AP_UE_ID_FMT" len %u",
s1ap_direction2String[s1ap_message_p->direction],
enb_ue_s1ap_id,
mme_ue_s1ap_id);
if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance,
enb_ue_s1ap_id)) == NULL) {
S1AP_ERROR("[SCTP %d] Received UE context release command for non "
......@@ -565,6 +575,13 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
*/
return -1;
} else {
MSC_LOG_TX_MESSAGE(
MSC_S1AP_ENB,
MSC_RRC_ENB,
NULL,0,
"0 S1AP_UE_CONTEXT_RELEASE_COMMAND/%s eNB_ue_s1ap_id "S1AP_UE_ID_FMT" ",
enb_ue_s1ap_id);
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_UE_CONTEXT_RELEASE_COMMAND);
S1AP_UE_CONTEXT_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
......
......@@ -140,9 +140,9 @@ int s6a_init(const mme_config_t *mme_config_p)
/* Set gnutls debug level ? */
if (gnutls_debug) {
//gnutls_global_set_log_function((gnutls_log_func)fd_gnutls_debug);
//gnutls_global_set_log_level (gnutls_debug);
//S6A_DEBUG("Enabled GNUTLS debug at level %d", gnutls_debug);
gnutls_global_set_log_function((gnutls_log_func)fd_gnutls_debug);
gnutls_global_set_log_level (gnutls_debug);
S6A_DEBUG("Enabled GNUTLS debug at level %d", gnutls_debug);
}
/* Starting freeDiameter core */
......
......@@ -906,7 +906,7 @@ pdcp_run (
RRC_DCCH_DATA_REQ (msg_p).sdu_size,
RRC_DCCH_DATA_REQ (msg_p).sdu_p,
RRC_DCCH_DATA_REQ (msg_p).mode);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
LOG_E(PDCP, "PDCP data request failed!\n");
// Message buffer has been processed, free it now.
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_REQ (msg_p).sdu_p);
......
......@@ -3990,7 +3990,7 @@ rrc_eNB_decode_dcch(
// followup with the remaining procedure
#warning "LG Removed rrc_eNB_generate_UECapabilityEnquiry after receiving securityModeFailure"
// LG commented rrc_eNB_generate_UECapabilityEnquiry(ctxt_pP, ue_context_p);
rrc_eNB_generate_UECapabilityEnquiry(ctxt_pP, ue_context_p);
break;
case UL_DCCH_MessageType__c1_PR_ueCapabilityInformation:
......
......@@ -1066,6 +1066,13 @@ void rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ (
LOG_W(RRC,
"[eNB] In S1AP_UE_CONTEXT_RELEASE_COMMAND: invalid UE\n");
} else {
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
MSC_S1AP_ENB,
NULL,0,
"0 S1AP_UE_CONTEXT_RELEASE_REQ eNB_ue_s1ap_id 0x%06"PRIX32" ",
ue_context_pP->ue_context.eNB_ue_s1ap_id);
MessageDef *msg_context_release_req_p = NULL;
msg_context_release_req_p = itti_alloc_new_message(TASK_RRC_ENB, S1AP_UE_CONTEXT_RELEASE_REQ);
S1AP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
......@@ -1095,6 +1102,18 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
instance,
eNB_ue_s1ap_id);
MSC_LOG_EVENT(
MSC_RRC_ENB,
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" context not found",
eNB_ue_s1ap_id);
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
MSC_S1AP_ENB,
NULL,0,
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ",
eNB_ue_s1ap_id);
msg_complete_p = itti_alloc_new_message(TASK_RRC_ENB, S1AP_UE_CONTEXT_RELEASE_COMPLETE);
S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
itti_send_msg_to_task(TASK_S1AP, instance, msg_complete_p);
......@@ -1113,6 +1132,13 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
int mod_id = 0;
MessageDef *msg_delete_tunnels_p = NULL;
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
MSC_GTPU_ENB,
NULL,0,
"0 GTPV1U_ENB_DELETE_TUNNEL_REQ rnti %x ",
eNB_ue_s1ap_id);
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, GTPV1U_ENB_DELETE_TUNNEL_REQ);
memset(&GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p),
0,
......@@ -1132,6 +1158,14 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
itti_send_msg_to_task(TASK_GTPV1_U, instance, msg_delete_tunnels_p);
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
MSC_S1AP_ENB,
NULL,0,
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ",
eNB_ue_s1ap_id);
MessageDef *msg_complete_p = NULL;
msg_complete_p = itti_alloc_new_message(TASK_RRC_ENB, S1AP_UE_CONTEXT_RELEASE_COMPLETE);
S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
......
......@@ -99,14 +99,12 @@ if "E_UTRAN" == args.profile.strip():
args.dir+'/openair.msc.rrc_enb.log',
args.dir+'/openair.msc.s1ap_enb.log',
args.dir+'/openair.msc.gtpu_enb.log',
args.dir+'/openair.msc.mme_app.log',
args.dir+'/openair.msc.nas_mme.log',
args.dir+'/openair.msc.gtpu_sgw.log',
args.dir+'/openair.msc.s1ap_mme.log']
args.dir+'/openair.msc.gtpu_sgw.utran.log',
args.dir+'/openair.msc.s1ap_mme.utran.log',
args.dir+'/openair.msc.nas_mme.utran.log']
elif "EPC" == args.profile.strip():
g_filenames = [
args.dir+'/openair.msc.s1ap_enb.log',
args.dir+'/openair.msc.gtpu_enb.log',
args.dir+'/openair.msc.s1ap_enb.epc.log',
args.dir+'/openair.msc.mme_app.log',
args.dir+'/openair.msc.nas_mme.log',
args.dir+'/openair.msc.nas_emm_mme.log',
......@@ -289,13 +287,13 @@ parse_oai_log_files()
g_page_index = 0
g_message_index = 0
g_now = datetime.datetime.now()
g_now_formated = 'mscgen_' + g_now.strftime("%Y-%m-%d_%H.%M.%S")
g_now_formated = 'mscgen_' + args.profile.strip() + '_'+ g_now.strftime("%Y-%m-%d_%H.%M.%S")
#g_currentdir = os.curdir
g_resultdir = os.path.join(args.dir, g_now_formated)
os.mkdir(g_resultdir)
os.chdir(g_resultdir)
g_base_file_name = 'oai_mscgen_page_'
g_base_file_name = args.profile.strip() + '_mscgen_page_'
g_file = get_new_file_descriptor()
msc_chart_write_header(g_file)
......
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