Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patricio Latini
openairinterface5G
Commits
a513f8bc
Commit
a513f8bc
authored
8 years ago
by
Wilson
Browse files
Options
Downloads
Patches
Plain Diff
hotfix logs on multi-threading
parent
dabdf793
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openair1/PHY/defs.h
+2
-0
2 additions, 0 deletions
openair1/PHY/defs.h
targets/RT/USER/lte-ue.c
+23
-20
23 additions, 20 deletions
targets/RT/USER/lte-ue.c
with
25 additions
and
20 deletions
openair1/PHY/defs.h
+
2
−
0
View file @
a513f8bc
...
@@ -346,6 +346,8 @@ typedef struct eNB_proc_t_s {
...
@@ -346,6 +346,8 @@ typedef struct eNB_proc_t_s {
/// Context data structure for RX/TX portion of subframe processing
/// Context data structure for RX/TX portion of subframe processing
typedef
struct
{
typedef
struct
{
/// index of the current UE RX/TX proc
int
proc_id
;
/// Component Carrier index
/// Component Carrier index
uint8_t
CC_id
;
uint8_t
CC_id
;
/// timestamp transmitted to HW
/// timestamp transmitted to HW
...
...
This diff is collapsed.
Click to expand it.
targets/RT/USER/lte-ue.c
+
23
−
20
View file @
a513f8bc
...
@@ -732,7 +732,7 @@ static void *UE_thread_rxn_txnp4(void *arg)
...
@@ -732,7 +732,7 @@ static void *UE_thread_rxn_txnp4(void *arg)
printf
(
"Starting UE RXN_TXNP4 thread (%s)
\n
"
,
threadname
);
printf
(
"Starting UE RXN_TXNP4 thread (%s)
\n
"
,
threadname
);
while
(
!
oai_exit
)
{
while
(
!
oai_exit
)
{
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_COND_WAIT0
+
(
proc
->
subframe_rx
&
1
),
1
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_COND_WAIT0
+
(
proc
->
proc_id
),
1
);
if
(
pthread_mutex_lock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
if
(
pthread_mutex_lock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] error locking mutex for UE RXTX
\n
"
);
LOG_E
(
PHY
,
"[SCHED][UE] error locking mutex for UE RXTX
\n
"
);
exit_fun
(
"nothing to add"
);
exit_fun
(
"nothing to add"
);
...
@@ -740,24 +740,24 @@ static void *UE_thread_rxn_txnp4(void *arg)
...
@@ -740,24 +740,24 @@ static void *UE_thread_rxn_txnp4(void *arg)
}
}
while
(
proc
->
instance_cnt_rxtx
<
0
)
{
while
(
proc
->
instance_cnt_rxtx
<
0
)
{
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_WAIT_COND_RXTX0
+
(
proc
->
subframe_rx
&
1
),
1
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_WAIT_COND_RXTX0
+
(
proc
->
proc_id
),
1
);
// most of the time, the thread is waiting here
// most of the time, the thread is waiting here
pthread_cond_wait
(
&
proc
->
cond_rxtx
,
&
proc
->
mutex_rxtx
);
pthread_cond_wait
(
&
proc
->
cond_rxtx
,
&
proc
->
mutex_rxtx
);
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_WAIT_COND_RXTX0
+
(
proc
->
subframe_rx
&
1
),
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_WAIT_COND_RXTX0
+
(
proc
->
proc_id
),
0
);
if
(
pthread_mutex_unlock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
if
(
pthread_mutex_unlock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] error unlocking mutex for UE RXn_TXnp4
\n
"
);
LOG_E
(
PHY
,
"[SCHED][UE] error unlocking mutex for UE RXn_TXnp4
\n
"
);
exit_fun
(
"nothing to add"
);
exit_fun
(
"nothing to add"
);
return
&
UE_thread_rxtx_retval
;
return
&
UE_thread_rxtx_retval
;
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_COND_WAIT0
+
(
proc
->
subframe_rx
&
1
),
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_COND_WAIT0
+
(
proc
->
proc_id
),
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0
+
(
proc
->
subframe_rx
&
1
),
1
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0
+
(
proc
->
proc_id
),
1
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_UE
+
(
proc
->
subframe_rx
&
1
),
proc
->
subframe_rx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_UE
+
(
proc
->
proc_id
),
proc
->
subframe_rx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_UE
+
(
proc
->
subframe_tx
&
1
),
proc
->
subframe_tx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_UE
+
(
proc
->
proc_id
),
proc
->
subframe_tx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE
+
(
proc
->
subframe_rx
&
1
),
proc
->
frame_rx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE
+
(
proc
->
proc_id
),
proc
->
frame_rx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE
+
(
proc
->
subframe_tx
&
1
),
proc
->
frame_tx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE
+
(
proc
->
proc_id
),
proc
->
frame_tx
);
lte_subframe_t
sf_type
=
subframe_select
(
&
UE
->
frame_parms
,
proc
->
subframe_rx
);
lte_subframe_t
sf_type
=
subframe_select
(
&
UE
->
frame_parms
,
proc
->
subframe_rx
);
if
((
sf_type
==
SF_DL
)
||
if
((
sf_type
==
SF_DL
)
||
...
@@ -825,10 +825,10 @@ static void *UE_thread_rxn_txnp4(void *arg)
...
@@ -825,10 +825,10 @@ static void *UE_thread_rxn_txnp4(void *arg)
}
}
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0
+
(
proc
->
subframe_rx
&
1
),
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0
+
(
proc
->
proc_id
),
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT0
+
(
proc
->
subframe_rx
&
1
),
1
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT0
+
(
proc
->
proc_id
),
1
);
if
(
pthread_mutex_lock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
if
(
pthread_mutex_lock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] error locking mutex for UE RXTX
\n
"
);
LOG_E
(
PHY
,
"[SCHED][UE] error locking mutex for UE RXTX
\n
"
);
exit_fun
(
"noting to add"
);
exit_fun
(
"noting to add"
);
...
@@ -843,7 +843,7 @@ static void *UE_thread_rxn_txnp4(void *arg)
...
@@ -843,7 +843,7 @@ static void *UE_thread_rxn_txnp4(void *arg)
exit_fun
(
"noting to add"
);
exit_fun
(
"noting to add"
);
return
&
UE_thread_rxtx_retval
;
return
&
UE_thread_rxtx_retval
;
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT0
+
(
proc
->
subframe_rx
&
1
),
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT0
+
(
proc
->
proc_id
),
0
);
}
}
// thread finished
// thread finished
...
@@ -1166,9 +1166,10 @@ void *UE_thread(void *arg) {
...
@@ -1166,9 +1166,10 @@ void *UE_thread(void *arg) {
}
}
}
}
// operate on thread sf mod 2
// operate on thread sf mod 2
UE_rxtx_proc_t
*
proc
=
&
UE
->
proc
.
proc_rxtx
[
sf
&
1
];
uint8_t
proc_select
=
sf
&
1
;
UE_rxtx_proc_t
*
proc
=
&
UE
->
proc
.
proc_rxtx
[
proc_select
];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0
+
(
proc
->
subframe_rx
&
1
)
,
1
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0
+
proc
_select
,
1
);
// lock mutex
// lock mutex
if
(
pthread_mutex_lock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
if
(
pthread_mutex_lock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] error locking mutex for UE RX
\n
"
);
LOG_E
(
PHY
,
"[SCHED][UE] error locking mutex for UE RX
\n
"
);
...
@@ -1199,19 +1200,19 @@ void *UE_thread(void *arg) {
...
@@ -1199,19 +1200,19 @@ void *UE_thread(void *arg) {
exit_fun
(
"nothing to add"
);
exit_fun
(
"nothing to add"
);
return
&
UE_thread_retval
;
return
&
UE_thread_retval
;
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0
+
(
proc
->
subframe_rx
&
1
)
,
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0
+
proc
_select
,
0
);
if
(
instance_cnt_rxtx
==
0
)
{
if
(
instance_cnt_rxtx
==
0
)
{
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SIGNAL_COND_RXTX0
+
(
proc
->
subframe_rx
&
1
)
,
1
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SIGNAL_COND_RXTX0
+
proc
_select
,
1
);
if
(
pthread_cond_signal
(
&
proc
->
cond_rxtx
)
!=
0
)
{
if
(
pthread_cond_signal
(
&
proc
->
cond_rxtx
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] ERROR pthread_cond_signal for UE RX thread
\n
"
);
LOG_E
(
PHY
,
"[SCHED][UE] ERROR pthread_cond_signal for UE RX thread
\n
"
);
exit_fun
(
"nothing to add"
);
exit_fun
(
"nothing to add"
);
return
&
UE_thread_retval
;
return
&
UE_thread_retval
;
}
}
LOG_D
(
PHY
,
"firing up rxtx_thread[%d] at subframe %d
\n
"
,
sf
&
1
,
sf
);
LOG_D
(
PHY
,
"firing up rxtx_thread[%d] at subframe %d
\n
"
,
proc_select
,
sf
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SIGNAL_COND_RXTX0
+
(
proc
->
subframe_rx
&
1
)
,
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SIGNAL_COND_RXTX0
+
proc
_select
,
0
);
}
else
{
}
else
{
LOG_E
(
PHY
,
"[SCHED][UE] UE RX thread busy (IC %d)!!
\n
"
,
instance_cnt_rxtx
);
LOG_E
(
PHY
,
"[SCHED][UE] UE RX thread busy (IC %d)!!
\n
"
,
instance_cnt_rxtx
);
...
@@ -1659,6 +1660,8 @@ void init_UE_threads(int inst)
...
@@ -1659,6 +1660,8 @@ void init_UE_threads(int inst)
// the threads are not yet active, therefore access is allowed without locking
// the threads are not yet active, therefore access is allowed without locking
UE
->
proc
.
proc_rxtx
[
0
].
instance_cnt_rxtx
=
-
1
;
UE
->
proc
.
proc_rxtx
[
0
].
instance_cnt_rxtx
=
-
1
;
UE
->
proc
.
proc_rxtx
[
1
].
instance_cnt_rxtx
=
-
1
;
UE
->
proc
.
proc_rxtx
[
1
].
instance_cnt_rxtx
=
-
1
;
UE
->
proc
.
proc_rxtx
[
0
].
proc_id
=
0
;
UE
->
proc
.
proc_rxtx
[
1
].
proc_id
=
1
;
UE
->
proc
.
instance_cnt_synch
=
-
1
;
UE
->
proc
.
instance_cnt_synch
=
-
1
;
pthread_mutex_init
(
&
UE
->
proc
.
proc_rxtx
[
0
].
mutex_rxtx
,
NULL
);
pthread_mutex_init
(
&
UE
->
proc
.
proc_rxtx
[
0
].
mutex_rxtx
,
NULL
);
pthread_mutex_init
(
&
UE
->
proc
.
proc_rxtx
[
1
].
mutex_rxtx
,
NULL
);
pthread_mutex_init
(
&
UE
->
proc
.
proc_rxtx
[
1
].
mutex_rxtx
,
NULL
);
...
@@ -1667,9 +1670,9 @@ void init_UE_threads(int inst)
...
@@ -1667,9 +1670,9 @@ void init_UE_threads(int inst)
pthread_cond_init
(
&
UE
->
proc
.
proc_rxtx
[
1
].
cond_rxtx
,
NULL
);
pthread_cond_init
(
&
UE
->
proc
.
proc_rxtx
[
1
].
cond_rxtx
,
NULL
);
pthread_cond_init
(
&
UE
->
proc
.
cond_synch
,
NULL
);
pthread_cond_init
(
&
UE
->
proc
.
cond_synch
,
NULL
);
pthread_create
(
&
UE
->
proc
.
proc_rxtx
[
0
].
pthread_rxtx
,
NULL
,
UE_thread_rxn_txnp4
,(
void
*
)
&
UE
->
proc
.
proc_rxtx
[
0
]);
pthread_create
(
&
UE
->
proc
.
proc_rxtx
[
0
].
pthread_rxtx
,
NULL
,
UE_thread_rxn_txnp4
,(
void
*
)
&
UE
->
proc
.
proc_rxtx
[
0
]);
pthread_setname_np
(
UE
->
proc
.
proc_rxtx
[
0
].
pthread_rxtx
,
"
UE_thread_
rxn_txnp4_even"
);
pthread_setname_np
(
UE
->
proc
.
proc_rxtx
[
0
].
pthread_rxtx
,
"rxn_txnp4_even"
);
pthread_create
(
&
UE
->
proc
.
proc_rxtx
[
1
].
pthread_rxtx
,
NULL
,
UE_thread_rxn_txnp4
,(
void
*
)
&
UE
->
proc
.
proc_rxtx
[
1
]);
pthread_create
(
&
UE
->
proc
.
proc_rxtx
[
1
].
pthread_rxtx
,
NULL
,
UE_thread_rxn_txnp4
,(
void
*
)
&
UE
->
proc
.
proc_rxtx
[
1
]);
pthread_setname_np
(
UE
->
proc
.
proc_rxtx
[
1
].
pthread_rxtx
,
"
UE_thread_
rxn_txnp4_odd"
);
pthread_setname_np
(
UE
->
proc
.
proc_rxtx
[
1
].
pthread_rxtx
,
"rxn_txnp4_odd"
);
pthread_create
(
&
UE
->
proc
.
pthread_synch
,
NULL
,
UE_thread_synch
,(
void
*
)
UE
);
pthread_create
(
&
UE
->
proc
.
pthread_synch
,
NULL
,
UE_thread_synch
,(
void
*
)
UE
);
pthread_setname_np
(
UE
->
proc
.
pthread_synch
,
"UE_thread_synch"
);
pthread_setname_np
(
UE
->
proc
.
pthread_synch
,
"UE_thread_synch"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment