Commit 4649f42a authored by gauthier's avatar gauthier

patches13/0008-name-pthreads-easier-debugging.patch

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7054 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent e337a52e
......@@ -709,6 +709,9 @@ int itti_create_task(task_id_t task_id, void *(*start_routine)(void *), void *ar
result = pthread_create (&itti_desc.threads[thread_id].task_thread, NULL, start_routine, args_p);
AssertFatal (result >= 0, "Thread creation for task %d, thread %d failed (%d)!\n", task_id, thread_id, result);
char name[16];
snprintf( name, sizeof(name), "ITTI %d", thread_id );
pthread_setname_np( itti_desc.threads[thread_id].task_thread, name );
itti_desc.created_tasks ++;
......
......@@ -34,6 +34,7 @@
* @author Sebastien Roux <sebastien.roux@eurecom.fr>
*/
#define _GNU_SOURCE // required for pthread_setname_np()
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -845,6 +846,7 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
if (ret < 0) {
AssertFatal (0, "pthread_create failed (%d:%s)!\n", errno, strerror(errno));
}
pthread_setname_np( itti_dump_queue.itti_acceptor_thread, "ITTI acceptor" );
return 0;
}
......
......@@ -38,6 +38,7 @@
* @ingroup pdcp
*/
#define _GNU_SOURCE // required for pthread_setname_np()
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -160,6 +161,7 @@ int pdcp_netlink_init(void) {
errno, strerror(errno));
exit(EXIT_FAILURE);
}
pthread_setname_np( pdcp_netlink_thread, "PDCP netlink" );
}
return 0;
}
......
......@@ -133,6 +133,7 @@ int init_pdcp_thread(void) {
}
else {
LOG_I(PDCP,"Allocate PDCP thread successful\n");
pthread_setname_np( pdcp_thread, "PDCP" );
}
return(0);
}
......
......@@ -41,6 +41,8 @@ RRCMessageHandler::RRCMessageHandler()
if (pthread_create(&m_thread, NULL, RRCMessageHandlerThreadLoop, (void *) NULL) != 0) {
fprintf(stderr, "\nRRCMessageHandler::RRCMessageHandler() ERROR pthread_create...\n");
} else {
pthread_setname_np( m_thread, "RRCMsgHandler" );
}
}
//----------------------------------------------------------------------------
......
......@@ -41,6 +41,8 @@ RRMMessageHandler::RRMMessageHandler()
if (pthread_create(&m_thread, NULL, RRMMessageHandlerThreadLoop, (void *) NULL) != 0) {
fprintf(stderr, "\nRRMMessageHandler::RRMMessageHandler() ERROR pthread_create...\n");
} else {
pthread_setname_np( m_thread, "RRMMsgHandler" );
}
}
//----------------------------------------------------------------------------
......
......@@ -1241,6 +1241,11 @@ void init_eNB_proc(void)
pthread_cond_init( &PHY_vars_eNB_g[0][CC_id]->proc[i].cond_rx, NULL);
pthread_create( &PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_tx, NULL, eNB_thread_tx, &PHY_vars_eNB_g[0][CC_id]->proc[i] );
pthread_create( &PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_rx, NULL, eNB_thread_rx, &PHY_vars_eNB_g[0][CC_id]->proc[i] );
char name[16];
snprintf( name, sizeof(name), "TX %d", i );
pthread_setname_np( PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_tx, name );
snprintf( name, sizeof(name), "RX %d", i );
pthread_setname_np( PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_rx, name );
PHY_vars_eNB_g[0][CC_id]->proc[i].frame_tx = 0;
PHY_vars_eNB_g[0][CC_id]->proc[i].frame_rx = 0;
#ifdef EXMIMO
......@@ -2800,6 +2805,8 @@ int main( int argc, char **argv )
}
ret = pthread_create(&forms_thread, NULL, scope_thread, NULL);
if (ret == 0)
pthread_setname_np( forms_thread, "xforms" );
printf("Scope thread created, ret=%d\n",ret);
}
#endif
......@@ -2850,7 +2857,8 @@ int main( int argc, char **argv )
return(error_code);
}
else {
LOG_D(HW,"[lte-softmodem.c] Allocate UE_thread successful\n");
LOG_D( HW, "[lte-softmodem.c] Allocate UE_thread successful\n" );
pthread_setname_np( main_ue_thread, "main UE" );
}
#endif
printf("UE threads created\n");
......@@ -2872,7 +2880,8 @@ int main( int argc, char **argv )
return(error_code);
}
else {
LOG_D(HW,"[lte-softmodem.c] Allocate eNB_thread successful\n");
LOG_D( HW, "[lte-softmodem.c] Allocate eNB_thread successful\n" );
pthread_setname_np( main_eNB_thread, "main eNB" );
}
#endif
}
......
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