From 56a12ce7d6d9478b3965e21f2a4cef2233e337c0 Mon Sep 17 00:00:00 2001 From: Jeroen de Bruijn Date: Thu, 1 Nov 2018 13:55:44 +0100 Subject: [PATCH 1/6] feat: Name cellular FSM queue thread --- features/cellular/easy_cellular/CellularConnectionFSM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/cellular/easy_cellular/CellularConnectionFSM.cpp b/features/cellular/easy_cellular/CellularConnectionFSM.cpp index 39c76736ab..48647a485a 100644 --- a/features/cellular/easy_cellular/CellularConnectionFSM.cpp +++ b/features/cellular/easy_cellular/CellularConnectionFSM.cpp @@ -617,7 +617,7 @@ nsapi_error_t CellularConnectionFSM::start_dispatch() { MBED_ASSERT(!_queue_thread); - _queue_thread = new rtos::Thread(osPriorityNormal, 2048); + _queue_thread = new rtos::Thread(osPriorityNormal, 2048, NULL, "fsm_queue_thread"); if (!_queue_thread) { stop(); return NSAPI_ERROR_NO_MEMORY; From 1f4f62333966129ece2a44f1623909c8d13209ae Mon Sep 17 00:00:00 2001 From: Jeroen de Bruijn Date: Thu, 1 Nov 2018 13:57:03 +0100 Subject: [PATCH 2/6] feat: Name PPP thread --- features/lwipstack/ppp_lwip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/lwipstack/ppp_lwip.cpp b/features/lwipstack/ppp_lwip.cpp index cea781badd..01f0963530 100644 --- a/features/lwipstack/ppp_lwip.cpp +++ b/features/lwipstack/ppp_lwip.cpp @@ -68,7 +68,7 @@ static EventQueue *prepare_event_queue() // Only need to queue 2 events. new blows on failure. event_queue = new EventQueue(2 * EVENTS_EVENT_SIZE, NULL); - event_thread = new Thread(osPriorityNormal, PPP_THREAD_STACK_SIZE); + event_thread = new Thread(osPriorityNormal, PPP_THREAD_STACK_SIZE, NULL, "event_thread"); if (event_thread->start(callback(event_queue, &EventQueue::dispatch_forever)) != osOK) { delete event_thread; From 3f635ef813d7c54ba478ca178e48a3281b70c366 Mon Sep 17 00:00:00 2001 From: Jeroen de Bruijn Date: Fri, 2 Nov 2018 13:44:24 +0100 Subject: [PATCH 3/6] fix: Update thread names Remove _thread suffix and rename threads. --- features/cellular/easy_cellular/CellularConnectionFSM.cpp | 2 +- features/lwipstack/lwip/src/include/lwip/opt.h | 2 +- features/lwipstack/ppp_lwip.cpp | 2 +- rtos/TARGET_CORTEX/mbed_rtos_rtx.c | 2 +- rtos/TARGET_CORTEX/mbed_rtx_conf.h | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/features/cellular/easy_cellular/CellularConnectionFSM.cpp b/features/cellular/easy_cellular/CellularConnectionFSM.cpp index 48647a485a..e06d9f0aa7 100644 --- a/features/cellular/easy_cellular/CellularConnectionFSM.cpp +++ b/features/cellular/easy_cellular/CellularConnectionFSM.cpp @@ -617,7 +617,7 @@ nsapi_error_t CellularConnectionFSM::start_dispatch() { MBED_ASSERT(!_queue_thread); - _queue_thread = new rtos::Thread(osPriorityNormal, 2048, NULL, "fsm_queue_thread"); + _queue_thread = new rtos::Thread(osPriorityNormal, 2048, NULL, "cellular_fsm_queue"); if (!_queue_thread) { stop(); return NSAPI_ERROR_NO_MEMORY; diff --git a/features/lwipstack/lwip/src/include/lwip/opt.h b/features/lwipstack/lwip/src/include/lwip/opt.h index cf0a7af6d9..1caa12d769 100644 --- a/features/lwipstack/lwip/src/include/lwip/opt.h +++ b/features/lwipstack/lwip/src/include/lwip/opt.h @@ -1536,7 +1536,7 @@ * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. */ #if !defined TCPIP_THREAD_NAME || defined __DOXYGEN__ -#define TCPIP_THREAD_NAME "tcpip_thread" +#define TCPIP_THREAD_NAME "lwip_tcpip" #endif /** diff --git a/features/lwipstack/ppp_lwip.cpp b/features/lwipstack/ppp_lwip.cpp index 01f0963530..e27e07fc06 100644 --- a/features/lwipstack/ppp_lwip.cpp +++ b/features/lwipstack/ppp_lwip.cpp @@ -68,7 +68,7 @@ static EventQueue *prepare_event_queue() // Only need to queue 2 events. new blows on failure. event_queue = new EventQueue(2 * EVENTS_EVENT_SIZE, NULL); - event_thread = new Thread(osPriorityNormal, PPP_THREAD_STACK_SIZE, NULL, "event_thread"); + event_thread = new Thread(osPriorityNormal, PPP_THREAD_STACK_SIZE, NULL, "ppp_lwip"); if (event_thread->start(callback(event_queue, &EventQueue::dispatch_forever)) != osOK) { delete event_thread; diff --git a/rtos/TARGET_CORTEX/mbed_rtos_rtx.c b/rtos/TARGET_CORTEX/mbed_rtos_rtx.c index 4485a180be..55c43b40a9 100644 --- a/rtos/TARGET_CORTEX/mbed_rtos_rtx.c +++ b/rtos/TARGET_CORTEX/mbed_rtos_rtx.c @@ -52,7 +52,7 @@ MBED_NORETURN void mbed_rtos_start() _main_thread_attr.cb_size = sizeof(_main_obj); _main_thread_attr.cb_mem = &_main_obj; _main_thread_attr.priority = osPriorityNormal; - _main_thread_attr.name = "main_thread"; + _main_thread_attr.name = "rtx_main"; /* Allow non-secure main thread to call secure functions */ #if defined(DOMAIN_NS) && (DOMAIN_NS == 1U) diff --git a/rtos/TARGET_CORTEX/mbed_rtx_conf.h b/rtos/TARGET_CORTEX/mbed_rtx_conf.h index f0b2fc3984..daae8e787f 100644 --- a/rtos/TARGET_CORTEX/mbed_rtx_conf.h +++ b/rtos/TARGET_CORTEX/mbed_rtx_conf.h @@ -70,8 +70,8 @@ // LIBSPACE default value set for ARMCC #define OS_THREAD_LIBSPACE_NUM 4 -#define OS_IDLE_THREAD_NAME "idle_thread" -#define OS_TIMER_THREAD_NAME "timer_thread" +#define OS_IDLE_THREAD_NAME "rtx_idle" +#define OS_TIMER_THREAD_NAME "rtx_timer" /* Enable only the evr events we use in Mbed-OS to save flash space. */ //Following events are used by Mbed-OS, DO NOT disable them From 467a7b63445a785d9a57b1a52caaf6536b3de79e Mon Sep 17 00:00:00 2001 From: Jeroen de Bruijn Date: Fri, 2 Nov 2018 13:52:18 +0100 Subject: [PATCH 4/6] feat: Add name to shared queue threads --- events/mbed_shared_queues.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/events/mbed_shared_queues.cpp b/events/mbed_shared_queues.cpp index 6504bb0c8d..1fc6a079b9 100644 --- a/events/mbed_shared_queues.cpp +++ b/events/mbed_shared_queues.cpp @@ -32,13 +32,13 @@ namespace mbed { */ template -EventQueue *do_shared_event_queue_with_thread() +EventQueue *do_shared_event_queue_with_thread(const char *name) { static uint64_t queue_buffer[QueueSize / sizeof(uint64_t)]; static EventQueue queue(sizeof queue_buffer, (unsigned char *) queue_buffer); static uint64_t stack[StackSize / sizeof(uint64_t)]; - static Thread thread(Priority, StackSize, (unsigned char *) stack); + static Thread thread(Priority, StackSize, (unsigned char *) stack, name); Thread::State state = thread.get_state(); if (state == Thread::Inactive || state == Thread::Deleted) { @@ -62,14 +62,14 @@ EventQueue *mbed_event_queue() return &queue; #else - return do_shared_event_queue_with_thread(); + return do_shared_event_queue_with_thread("shared_event_queue"); #endif } #ifdef MBED_CONF_RTOS_PRESENT EventQueue *mbed_highprio_event_queue() { - return do_shared_event_queue_with_thread(); + return do_shared_event_queue_with_thread("shared_highprio_event_queue"); } #endif From 440905a84ee51cdfde920db8741424ba009fafe1 Mon Sep 17 00:00:00 2001 From: Jeroen de Bruijn Date: Fri, 2 Nov 2018 16:23:52 +0100 Subject: [PATCH 5/6] fix: Change cellular FSM thread name --- features/cellular/easy_cellular/CellularConnectionFSM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/cellular/easy_cellular/CellularConnectionFSM.cpp b/features/cellular/easy_cellular/CellularConnectionFSM.cpp index e06d9f0aa7..376eedf7db 100644 --- a/features/cellular/easy_cellular/CellularConnectionFSM.cpp +++ b/features/cellular/easy_cellular/CellularConnectionFSM.cpp @@ -617,7 +617,7 @@ nsapi_error_t CellularConnectionFSM::start_dispatch() { MBED_ASSERT(!_queue_thread); - _queue_thread = new rtos::Thread(osPriorityNormal, 2048, NULL, "cellular_fsm_queue"); + _queue_thread = new rtos::Thread(osPriorityNormal, 2048, NULL, "cellular_fsm"); if (!_queue_thread) { stop(); return NSAPI_ERROR_NO_MEMORY; From 2ef82e18f5d74be4e1167b30fe38c1d3cf5f33c0 Mon Sep 17 00:00:00 2001 From: Jeroen de Bruijn Date: Sat, 3 Nov 2018 18:32:23 +0100 Subject: [PATCH 6/6] fix: Remove rtx from main thread name --- rtos/TARGET_CORTEX/mbed_rtos_rtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtos/TARGET_CORTEX/mbed_rtos_rtx.c b/rtos/TARGET_CORTEX/mbed_rtos_rtx.c index 55c43b40a9..934eb8a5ca 100644 --- a/rtos/TARGET_CORTEX/mbed_rtos_rtx.c +++ b/rtos/TARGET_CORTEX/mbed_rtos_rtx.c @@ -52,7 +52,7 @@ MBED_NORETURN void mbed_rtos_start() _main_thread_attr.cb_size = sizeof(_main_obj); _main_thread_attr.cb_mem = &_main_obj; _main_thread_attr.priority = osPriorityNormal; - _main_thread_attr.name = "rtx_main"; + _main_thread_attr.name = "main"; /* Allow non-secure main thread to call secure functions */ #if defined(DOMAIN_NS) && (DOMAIN_NS == 1U)