Commit 22911600 authored by Wang Tsu-Han's avatar Wang Tsu-Han

Adding measurment for waking up the thread

parent 6b99b1b1
......@@ -463,11 +463,14 @@ void *te_thread(void *param) {
CPU_SET(4, &cpuset);
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
eNB_proc_t *proc = &((te_params *)param)->eNB->proc;
PHY_VARS_eNB *eNB = ((te_params *)param)->eNB;
eNB_proc_t *proc = &eNB->proc;
time_stats_t *te_wakeup_stats0 = &eNB->dlsch_turbo_encoding_wakeup_stats0;
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_te[0],&proc->cond_te[0],&proc->instance_cnt_te[0],"te thread")<0) break;
stop_meas(te_wakeup_stats0);
dlsch_encoding_2threads0((te_params*)param);
......@@ -478,6 +481,10 @@ void *te_thread(void *param) {
exit_fun( "ERROR pthread_cond_signal" );
return(NULL);
}
if(opp_enabled == 1 && te_wakeup_stats0->diff_now>50*3000){
print_meas_now(te_wakeup_stats0,"coding_wakeup",stderr);
printf("frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->subframe_rx);
}
}
return(NULL);
......@@ -494,12 +501,15 @@ void *te_thread1(void *param) {
CPU_SET(7, &cpuset);
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
eNB_proc_t *proc = &((te_params *)param)->eNB->proc;
PHY_VARS_eNB *eNB = ((te_params *)param)->eNB;
eNB_proc_t *proc = &eNB->proc;
time_stats_t *te_wakeup_stats1 = &eNB->dlsch_turbo_encoding_wakeup_stats1;
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_te[1],&proc->cond_te[1],&proc->instance_cnt_te[1],"te thread 1")<0) break;
stop_meas(te_wakeup_stats1);
dlsch_encoding_2threads1((te_params*)param);
......@@ -510,6 +520,10 @@ void *te_thread1(void *param) {
exit_fun( "ERROR pthread_cond_signal" );
return(NULL);
}
if(opp_enabled == 1 && te_wakeup_stats1->diff_now>50*3000){
print_meas_now(te_wakeup_stats1,"coding_wakeup",stderr);
printf("delay for waking up in frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->subframe_rx);
}
}
return(NULL);
......@@ -524,6 +538,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
time_stats_t *rm_stats,
time_stats_t *te_stats,
time_stats_t *te_wait_stats,
time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats)
{
......@@ -591,6 +607,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
exit_fun( "ERROR pthread_cond_signal" );
return (-1);
}
start_meas(te_wakeup_stats0);
pthread_mutex_unlock( &proc->mutex_te[0] );
////////////////////////////////////////////////////////////////
......@@ -614,6 +631,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
exit_fun( "ERROR pthread_cond_signal" );
return (-1);
}
start_meas(te_wakeup_stats1);
pthread_mutex_unlock( &proc->mutex_te[1] );
......@@ -727,7 +745,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
stop_meas(te_wait_stats);
if(opp_enabled == 1 && te_wait_stats->diff_now>50*3000){
print_meas_now(te_wait_stats,"coding_wait",stderr);
printf("frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->subframe_rx);
printf("delay in wait on codition in frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->subframe_rx);
}
......@@ -744,6 +762,8 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
time_stats_t *rm_stats,
time_stats_t *te_stats,
time_stats_t *te_wait_stats,
time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats)
{
int encoding_return = 0;
......@@ -777,6 +797,8 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
rm_stats,
te_stats,
te_wait_stats,
te_wakeup_stats0,
te_wakeup_stats1,
i_stats);
}
else
......
......@@ -131,6 +131,8 @@ int32_t dlsch_encoding_all(PHY_VARS_eNB *eNB,
time_stats_t *rm_stats,
time_stats_t *te_stats,
time_stats_t *te_wait_stats,
time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats);
int32_t dlsch_encoding_SIC(PHY_VARS_UE *ue,
......@@ -177,6 +179,8 @@ int32_t dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
time_stats_t *rm_stats,
time_stats_t *te_stats,
time_stats_t *te_wait_stats,
time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats);
void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
......
......@@ -957,7 +957,7 @@ typedef struct PHY_VARS_eNB_s {
eth_params_t eth_params;
int rx_total_gain_dB;
int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag);
int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *);
int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *);
int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_eNB_s *eNB);
uint8_t local_flag;
LTE_DL_FRAME_PARMS frame_parms;
......@@ -1137,6 +1137,8 @@ typedef struct PHY_VARS_eNB_s {
time_stats_t dlsch_rate_matching_stats;
time_stats_t dlsch_turbo_encoding_stats;
time_stats_t dlsch_turbo_encoding_waiting_stats;
time_stats_t dlsch_turbo_encoding_wakeup_stats0;
time_stats_t dlsch_turbo_encoding_wakeup_stats1;
time_stats_t dlsch_interleaving_stats;
time_stats_t rx_dft_stats;
......
......@@ -346,6 +346,8 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
&eNB->dlsch_rate_matching_stats,
&eNB->dlsch_turbo_encoding_stats,
&eNB->dlsch_turbo_encoding_waiting_stats,
&eNB->dlsch_turbo_encoding_wakeup_stats0,
&eNB->dlsch_turbo_encoding_wakeup_stats1,
&eNB->dlsch_interleaving_stats);
stop_meas(&eNB->dlsch_encoding_stats);
// 36-211
......
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