Commit 8c339ad6 authored by Navid Nikaein's avatar Navid Nikaein

add makefile support for DB stats, fix minor issues for jitter calculation

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4030 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 9184b5aa
......@@ -131,7 +131,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigne
for (i=0;i<Mdlharq;i++) {
dlsch->harq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
printf("Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
LOG_T(PHY, "Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
MAX_DLSCH_PAYLOAD_BYTES/bw_scaling,bw_scaling, i,dlsch->harq_processes[i]);
if (dlsch->harq_processes[i]) {
bzero(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t));
......
......@@ -45,7 +45,7 @@
#include "local.h"
#include "proto_extern.h"
#include "platform_constants.h"
//#include "platform_constants.h"
//#define NETLINK_DEBUG 1
......
......@@ -74,41 +74,41 @@ typedef enum {
*/
typedef enum {
NO_PREDEFINED_TRAFFIC =0,
M2M,
SCBR,
MCBR,
BCBR,
AUTO_PILOT,
BICYCLE_RACE,
OPENARENA,
TEAM_FORTRESS,
FULL_BUFFER,
M2M_TRAFFIC,
AUTO_PILOT_L, /*AUTO PILOT LOW SPEEDS*/
AUTO_PILOT_M, /*AUTO PILOT MEDIEUM SPEEDS*/
AUTO_PILOT_H, /*AUTO PILOT HIGH SPEEDS*/
AUTO_PILOT_E, /*AUTO PILOT EMERGENCY*/
VIRTUAL_GAME_L, /*VIRTUAL GAME LOW SPEEDS*/
VIRTUAL_GAME_M, /*VIRTUAL GAME MEDIEUM SPEEDS*/
VIRTUAL_GAME_H, /*VIRTUAL GAME HIGH SPEEDS*/
VIRTUAL_GAME_F, /*VIRTUAL GAME FINISH*/
ALARM_HUMIDITY, /* SENSOR BASED ALARM : HUMIDITY */
ALARM_SMOKE, /* SENSOR BASED ALARM : SMOKE */
ALARM_TEMPERATURE,/* SENSOR BASED ALARM : TEMPERATURE */
OPENARENA_DL,
OPENARENA_UL,
VOIP_G711,
VOIP_G729,
IQSIM_MANGO,
IQSIM_NEWSTEO,
OPENARENA_DL_TARMA,
VIDEO_VBR_10MBPS,
VIDEO_VBR_4MBPS,
VIDEO_VBR_2MBPS,
VIDEO_VBR_768KBPS,
VIDEO_VBR_384KBPS,
VIDEO_VBR_192KBPS,
BACKGROUND_USERS,
M2M, // 1
SCBR, //2
MCBR, //3
BCBR, //4
AUTO_PILOT, //5
BICYCLE_RACE, // 6
OPENARENA, // 7
TEAM_FORTRESS, // 8
FULL_BUFFER, // 9
M2M_TRAFFIC, // 10
AUTO_PILOT_L, //11 /*AUTO PILOT LOW SPEEDS*/
AUTO_PILOT_M, // 12 /*AUTO PILOT MEDIEUM SPEEDS*/
AUTO_PILOT_H, // 13 /*AUTO PILOT HIGH SPEEDS*/
AUTO_PILOT_E, // 14 /*AUTO PILOT EMERGENCY*/
VIRTUAL_GAME_L,// 15 /*VIRTUAL GAME LOW SPEEDS*/
VIRTUAL_GAME_M, // 16 /*VIRTUAL GAME MEDIEUM SPEEDS*/
VIRTUAL_GAME_H, // 17 /*VIRTUAL GAME HIGH SPEEDS*/
VIRTUAL_GAME_F, // 18 /*VIRTUAL GAME FINISH*/
ALARM_HUMIDITY, // 19 /* SENSOR BASED ALARM : HUMIDITY */
ALARM_SMOKE, // 20 /* SENSOR BASED ALARM : SMOKE */
ALARM_TEMPERATURE, // 21 /* SENSOR BASED ALARM : TEMPERATURE */
OPENARENA_DL, // 22
OPENARENA_UL, // 23
VOIP_G711, // 24
VOIP_G729, // 25
IQSIM_MANGO, // 26
IQSIM_NEWSTEO, // 27
OPENARENA_DL_TARMA, // 28
VIDEO_VBR_10MBPS, // 29
VIDEO_VBR_4MBPS, // 30
VIDEO_VBR_2MBPS, // 31
VIDEO_VBR_768KBPS, // 32
VIDEO_VBR_384KBPS, // 33
VIDEO_VBR_192KBPS, // 34
BACKGROUND_USERS, // 35
DUMMY
}Application;
......@@ -123,16 +123,16 @@ typedef enum {
typedef enum {
NO_TRAFFIC=0,
UNIFORM,
GAUSSIAN,
EXPONENTIAL,
POISSON,
FIXED,
WEIBULL,
PARETO,
GAMMA,
CAUCHY,
LOG_NORMAL,
UNIFORM, //1
GAUSSIAN, //2
EXPONENTIAL, //3
POISSON, // 4
FIXED, // 5
WEIBULL, // 6
PARETO, // 7
GAMMA, // 8
CAUCHY, // 9
LOG_NORMAL, // 10
TARMA,
VIDEO,
BACKGROUND_DIST,
......
......@@ -52,9 +52,9 @@ fl_initialize(&tArgc,tArgv,"OTG",0,0);
fl_show_form (form_dl->otg, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
fl_set_form_position(form_dl->otg, 200, 200);
if (g_otg->owd_radio_access==1)
fl_set_xyplot_ybounds(form_dl->owd,0,100);
else
fl_set_xyplot_ybounds(form_dl->owd,0,200);
else
fl_set_xyplot_ybounds(form_dl->owd,0,400);
fl_set_xyplot_ybounds(form_dl->throughput,0,200);
......@@ -66,9 +66,9 @@ fl_initialize(&tArgc,tArgv,"OTG",0,0);
fl_show_form (form_ul->otg, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
fl_set_form_position(form_ul->otg, 850, 200);
if (g_otg->owd_radio_access==1)
fl_set_xyplot_ybounds(form_ul->owd,0,100);
else
fl_set_xyplot_ybounds(form_ul->owd,0,200);
else
fl_set_xyplot_ybounds(form_ul->owd,0,400);
......
......@@ -686,8 +686,12 @@ void add_log_metric(int src, int dst, int ctime, double metric, unsigned int lab
case OTG_GP_BG:
add_log_label(label, &start_log_GP_bg);
break;
case OTG_JITTER:
add_log_label(label, &start_log_GP_bg);
break;
default:
LOG_E(OTG, "File label unknown \n");
LOG_E(OTG, "File label unknown %d \n", label);
}
LOG_F(label,"%d ", ctime);
......
......@@ -53,6 +53,7 @@ unsigned int start_log_latency=0;
unsigned int start_log_latency_bg=0;
unsigned int start_log_GP=0;
unsigned int start_log_GP_bg=0;
unsigned int start_log_jitter=0;
/*! \fn void tx_throughput( int src, int dst, int application)
* \brief compute the transmitter throughput in bytes per seconds
......
......@@ -482,7 +482,7 @@ backgroundStream_t *backgroundStreamInit(backgroundStream_t *stream, double lamb
}
}
printf("OTG BACKGROUND_USERS DEBUG: backgroundStreamInit(%d) called\n",(int)stream);
LOG_D(OTG,"BACKGROUND_USERS DEBUG: backgroundStreamInit(%d) called\n",(int)stream);
backgroundPrintStream (stream);
return stream;
}
......@@ -496,7 +496,7 @@ backgroundStream_t *backgroundStreamInit(backgroundStream_t *stream, double lamb
void backgroundUpdateStream(backgroundStream_t *stream, int ctime){
int numNewSessions, cnts, period;
printf("OTG BACKGROUND DEBUG: backgroundUpdateStream(stream*=%d,ctime=%d,period=%d) called\n",(int)stream, ctime);
LOG_D(OTG,"BACKGROUND DEBUG: backgroundUpdateStream(stream*=%d,ctime=%d,period=%d) called\n",(int)stream, ctime);
if(stream){
period=ctime-stream->lastUpdateTime;
numNewSessions=poisson_dist(stream->meanNumSessions/5710*period);
......@@ -532,7 +532,7 @@ double backgroundCalculateSize(backgroundStream_t *stream, int ctime, int idt){
double mrate=0;
backgroundUpdateStream(stream, ctime);
printf("OTG BACKGROUND DEBUG: backgroundCalculateSize(stream*=%d,idt=%d,ctime=%d) called\n",(int)stream, idt, ctime);
LOG_D(OTG,"BACKGROUND DEBUG: backgroundCalculateSize(stream*=%d,idt=%d,ctime=%d) called\n",(int)stream, idt, ctime);
if(stream){
for(cnts=0; cnts<BACKGROUND_NUM_ACTIVE_MAX; cnts++){
if(stream->activeSessions[cnts].endTime>ctime){
......@@ -541,7 +541,7 @@ double backgroundCalculateSize(backgroundStream_t *stream, int ctime, int idt){
}
}
size=mrate*idt/1000;
printf("OTG BACKGROUND DEBUG: cntact=%02d, idt=%05d, agg_mrate=%05.1f, size=%04.1f\n", cntact, idt, mrate,size);
LOG_D(OTG,"BACKGROUND DEBUG: cntact=%02d, idt=%05d, agg_mrate=%05.1f, size=%04.1f\n", cntact, idt, mrate,size);
}
return size;
}
......@@ -554,11 +554,11 @@ double backgroundCalculateSize(backgroundStream_t *stream, int ctime, int idt){
void backgroundPrintStream(backgroundStream_t *stream){
int cnts;
printf("OTG BACKGROUND DEBUG: backgroundPrintStream(%d)\n",(int)stream);
LOG_D(OTG,"BACKGROUND DEBUG: backgroundPrintStream(%d)\n",(int)stream);
if(stream){
printf("OTG BACKGROUND DEBUG: meanNumSessions(lambda_n)=%f\n",stream->meanNumSessions);
LOG_D(OTG,"BACKGROUND DEBUG: meanNumSessions(lambda_n)=%f\n",stream->meanNumSessions);
for(cnts=0; cnts<BACKGROUND_NUM_ACTIVE_MAX; cnts++){
printf("OTG BACKGROUND DEBUG: session[%d] -> mrate=%06.3f, etime=%05d\n",
LOG_D(OTG,"BACKGROUND DEBUG: session[%d] -> mrate=%06.3f, etime=%05d\n",
cnts, stream->activeSessions[cnts].meanSessionRate, stream->activeSessions[cnts].endTime);
}
}
......
......@@ -42,8 +42,12 @@
#include "otg_vars.h"
#include "../UTIL/MATH/oml.h"
#include <math.h>
#include <mysql.h>
#include <m_ctype.h>
#include <sql_common.h>
#include "otg_form.h"
extern unsigned char NB_eNB_INST;
extern unsigned char NB_UE_INST;
......@@ -84,6 +88,12 @@ int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
LOG_I(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) \n", src, dst,otg_hdr_rx->flow_id, otg_hdr_rx->traffic_type, ctime, otg_hdr_info_rx->flag, otg_hdr_rx->seq_num, otg_hdr_rx->time, otg_hdr_info_rx->size, size);
bytes_read += sizeof (otg_hdr_t);
if(otg_hdr_rx->traffic_type > MAX_NUM_APPLICATION){
LOG_W(OTG,"RX packet: application type out of range %d for the pair of (src %d, dst %d) \n",
otg_hdr_rx->traffic_type, src, dst);
otg_hdr_rx->traffic_type=0;
}
if (otg_hdr_info_rx->flag == 0xffff){
seq_num_rx=otg_info->seq_num_rx[src][dst][otg_hdr_rx->traffic_type];
if (src<NB_eNB_INST)
......
This diff is collapsed.
......@@ -65,6 +65,13 @@ ifdef XFORMS
CFLAGS += -DXFORMS
endif
# Check if libmysqlclient is installed and use it if found to store simulation data for postprocessing
ENABLE_DB = $(shell if [ `dpkg -l | grep libmysqlclient -c` = "0" ]; then echo "0" ; else echo "1" ; fi )
ifeq ($(ENABLE_DB), 1)
CFLAGS +=-I/usr/include/mysql -L/usr/lib/mysql -DENABLE_DB_STATS
DB_LDFLAGS = -lmysqlclient
endif
ifdef PRINT_STATS
CFLAGS += -DPRINT_STATS
endif
......@@ -309,7 +316,7 @@ oaisim : $(ASN1_MSG_OBJS1) $(OBJ) oaisim.c $(LFDS_DIR)/bin/liblfds611.a
endif
@echo "Compiling oaisim.c ..."
@$(CC) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) -I$(ASN1_MSG_INC) $(S1AP_Incl) -o oaisim $(CFLAGS) $(EXTRA_CFLAGS) $^ \
-lm -lblas -lpthread -llapack_atlas -lforms -lxml2 -lX11 -lXpm -lrt $(LFDS_DIR)/bin/liblfds611.a $(PGM_LDFLAGS)
-lm -lblas -lpthread -llapack_atlas -lforms -lxml2 -lX11 -lXpm -lrt $(LFDS_DIR)/bin/liblfds611.a $(PGM_LDFLAGS) $(DB_LDFLAGS)
ifeq ($(rrc_cellular_eNB),1)
mv oaisim oaisim_eNB
......@@ -320,22 +327,22 @@ endif
oaisimCROWN : $(OBJ) $(ASN1_MSG_OBJS1) oaisimCROWN.c
@echo "Compiling oaisimCROWN.c ..."
@$(CC) oaisimCROWN.c -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) -I$(ASN1_MSG_INC) $(S1AP_Incl) -o oaisimCROWN $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(ASN1_MSG_OBJS1) -lm -lblas -lpthread -llapack_atlas -lforms -lxml2 -lX11 -lXpm -lrt
@$(CC) oaisimCROWN.c -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) -I$(ASN1_MSG_INC) $(S1AP_Incl) -o oaisimCROWN $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(ASN1_MSG_OBJS1) -lm -lblas -lpthread -llapack_atlas -lforms -lxml2 -lX11 -lXpm -lrt
test_nasmesh_fix:
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && make)
(cd $(OPENAIR2_DIR) && make nasmesh_netlink_address_fix.ko)
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
(cd $(OPENAIR2_DIR) && $(MAKE) nasmesh_netlink_address_fix.ko)
(cp $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko . )
nasmesh_fix:
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && make)
(cd $(OPENAIR2_DIR) && make nasmesh_netlink_address_fix.ko)
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
(cd $(OPENAIR2_DIR) && $(MAKE) nasmesh_netlink_address_fix.ko)
(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)
nasmesh_nl:
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && make)
(cd $(OPENAIR2_DIR) && make nasmesh_netlink.ko)
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
(cd $(OPENAIR2_DIR) && $(MAKE) nasmesh_netlink.ko)
(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)
rb_tool:
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && make)
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
nasmesh_install:
(sudo rmmod nasmesh)
......@@ -399,13 +406,15 @@ cleancell:
rm -f $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR/*.d
print:
@echo $(cygwin)
@echo $(OCG_FLAG)
@echo $(CFLAGS)
@echo $(EXTRA_CFLAGS)
# @echo $(cygwin)
@echo $(OBJ)
@echo $(IS_REL10)
@echo $(IS_REL8)
@echo $(OCG_FLAG)
@echo "CFLAGS are " $(CFLAGS)
@echo "EXTRA_CFLAGS are" $(EXTRA_CFLAGS)
@echo "IS_REL8 is " $(IS_REL10)
@echo "IS_REL8 is " $(IS_REL8)
@echo "ENABLE_DB is " $(ENABLE_DB)
showcflags:
@echo $(CFLAGS)
......@@ -428,6 +437,9 @@ otg_gp:
otg_gp_bg:
export TITLE="Background Goodput(Kb/s)"
$(OPENAIR2_DIR)/UTIL/OTG/OTGplot "/tmp/otg_GP_bg.dat" "[$(COL1):$(COL2)]"
otg_jitter:
export TITLE="Aplication Jitter(ms)"
$(OPENAIR2_DIR)/UTIL/OTG/OTGplot "/tmp/otg_jitter.dat" "[$(COL1):$(COL2)]"
pexpect = $(shell if [ `dpkg -l | grep pexpect -c` = "0" ]; then echo "0" ; else echo "1" ; fi )
......
......@@ -489,6 +489,8 @@ int
LOG_I(OCM,"Running with frame_type %d, Nid_cell %d, N_RB_DL %d, EP %d, mode %d, target dl_mcs %d, rate adaptation %d, nframes %d, abstraction %d, channel %s\n",
oai_emulation.info.frame_type, Nid_cell, oai_emulation.info.N_RB_DL, oai_emulation.info.extended_prefix_flag, oai_emulation.info.transmission_mode,target_dl_mcs,rate_adaptation_flag,oai_emulation.info.n_frames,abstraction_flag,oai_emulation.environment_system_config.fading.small_scale.selected_option);
set_seed = oai_emulation.emulation_config.seed.value;
init_seed(set_seed);
init_openair1();
......
......@@ -123,6 +123,9 @@ mapping otg_distribution_names[] =
{"gamma", 8},
{"cauchy",9},
{"log_normal",10},
{"tarma",11},
{"video",12},
{"background_dist",13},
{NULL, -1}
};
......@@ -816,7 +819,7 @@ int ocg_config_app(){
g_otg->holding_time_off_pe[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]]=oai_emulation.application_config.customized_traffic.holding_time_off_pe[customized_traffic_config_index];
g_otg->holding_time_pe_off[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]]=oai_emulation.application_config.customized_traffic.holding_time_pe_off[customized_traffic_config_index];
LOG_I(OTG,"customized:: OCG_config_OTG: (1) FORMAT (%d:%d) source = %d, dest = %d, Application = %d, background %d\n", sid_start, sid_end, source_id_index, destination_id_index, g_otg->application_type[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]], g_otg->background[source_id_index][destination_id_index]);
LOG_I(OTG,"customized:: OCG_config_OTG: (1) FORMAT (%d:%d) source = %d, dest = %d, Application = %d, state %d, background %d IDT DIST %d \n", sid_start, sid_end, source_id_index, destination_id_index, g_otg->application_type[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]], state, g_otg->background[source_id_index][destination_id_index], g_otg->idt_dist[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]][state]);
g_otg->application_idx[source_id_index][destination_id_index]+=1;
}
}
......@@ -986,7 +989,8 @@ int ocg_config_emu(){
LOG_I(OCG, "number of frames in emulation is set to infinity\n");
oai_emulation.info.seed = (oai_emulation.emulation_config.seed.value == 0) ? oai_emulation.info.seed : oai_emulation.emulation_config.seed.value;
LOG_I (OCG,"The seed value is set to %d \n", oai_emulation.info.seed );
if (oai_emulation.info.cli_enabled == 1){
if (cli_server_init(cli_server_recv) < 0) {
LOG_E(EMU,"cli server init failed \n");
......
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