-
Notifications
You must be signed in to change notification settings - Fork 3k
Add names to system thread #8612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Yes, good - more tools are having thread awareness now, eg pyOCD and error dumps. While here, mbed_shared_queues.cpp could also do with names for the 2 shared threads - I've noticed them being blank in debuggers. Could you do those at the same time? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@kjbracey-arm Sure. I only found one thread though, here. I can name that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with the change.
However, I would propose not to use _thread
suffix on threads, as they are...thereads..anyway..
The fsm_queue_thread
don't tell anything for me, but how about cellular_fsm_queue
Then event_thread
is kind of OK, but we already have 3 event loops(normal, high priority and lwip), so why not specifically lwip_event_loop
And while we are at it, the shared event queues should be named like |
That's a template - it's used twice to create the two threads below. You'll have to pass the names as a parameter to
Totally agree, but for consistency reasons I note that we do have "idle_thread", "timer_thread" in mbed_rtx_conf.h and "main_thread" in mbed_rtos_rtx.c. I would favour dropping their suffixes. |
Alternative is |
Also agree. I'll change the names accordingly.
Agree, name should specifically say what it is. Why not
Should I also include that in the commit? Another question. Is it useful to prefix all system threads with something like Also, since some names are getting a bit longer. Isn't that going to be a problem with maximum lengths of the name. I don't know how they are stored, but thought it was worth to mention here. |
Yes, but just
Apart from a teeny bit of extra ROM use, no. The RTOS doesn't store the names, just stores a pointer to the string literal you pass.
Possibly, yes. That's one reason to favour
That is specifically for PPP, not lwip in general, so I'd say Although again, the |
Remove _thread suffix and rename threads.
I've added two commits for this. I was just wondering, is there an easy way to run most of the (unit) tests locally before I make a commit? |
@vidavidorra It's not the most intuitive, but the docs for the unit tests are in the subdirectroy of Mbed OS: https://github.com/ARMmbed/mbed-os/tree/master/UNITTESTS |
@cmonr Thanks! Wasn't able to run locally yet but will check that later. As for the tests that are failing here. I saw in the travis log that it fails here I'm not sure why though. Compile was successful but test failed. Can anyone more familiar with the tests etc. have a look at it, because I'm having a hard time finding out why it is failing. |
@@ -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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be inclined to cut this down to cellular_fsm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me 😃 added it.
Reran travis and it passed - timing-based failure on "simple barrage test". Server load? |
rtos/TARGET_CORTEX/mbed_rtos_rtx.c
Outdated
@@ -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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main thread should probably keep its name as this is actually where the main()
starts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I would still like to keep the main thread name as it is.. it is not to serve RTX, but actually the one that runs my main()
so main_thread
is sensible name.
Ok, so I'll change that back to |
/morph build |
Build : SUCCESSBuild number : 3557 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 3165 |
/morph mbed2-build |
Test : SUCCESSBuild number : 3339 |
Description
Add names to the PPP and cellular FSM threads. This would make those names visible when debugging threads, e.g. as described in Tracking memory usage with Mbed OS
Pull request type