-
Notifications
You must be signed in to change notification settings - Fork 8.2k
arch: x86: fatal: If possible, print thread name in crash dump #14155
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,9 @@ source "subsys/testsuite/ztest/Kconfig" | |
|
|
||
| config TEST | ||
| bool "Mark project as a test" | ||
| # For tests, store thread names in binary and dump them on crash to | ||
|
||
| # ease debugging. | ||
| select THREAD_NAME | ||
| help | ||
| Mark a project or an application as a test. This will enable a few | ||
| test defaults. | ||
|
|
||
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.
This is not really storing the thread names, more like it allows storing the names. Still, the user needs to do this, AFAICS.
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.
Then we would need to backtrack and consider why you asked me to add this unrelated change in this PR. For example if "Still, the user needs to do this", then they can also enable CONFIG_THREAD_NAME themselves - if they need it. And not enable, if they don't need it. While you for some reason asked me to force it upon them unsuspecting users. To make them less unsuspecting, I added a comment for a reason why such option would be force-enabled, but you don't even agree with that reason.
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.
Hey,so with THREAD_NAME, the test developers can simply call k_thread_name_set, to set names to the threads they wish. This patch saves us from the need of having CONFIG_THREAD_NAME=y in the prj.conf of each test.
So there is some value in adding the selection here, IMHO :) I just wanted to stress that selecting THREAD_NAME does not automatically add names to the threads :) It's just a style thing, anyways.
Uh oh!
There was an error while loading. Please reload this page.
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.
They should call k_thread_name_set() regardless of CONFIG_THREAD_NAME. Or not call, if they choose so. (E.g. if they want to complicate diagnostics.)
Yep, but we can't include whole API reference/development primer in one comment. So, the comment emphasizes that for the standard system threads, if crash happens in them, the crash dump will include the thread name (because system threads of course call k_thread_name_set(), as that's the best practice). I'd assume that some 10% of tests would create a new user thread, while most will just use existing main thread and/or sys workq. And the idea behind the original patch was to allow to quickly diagnose stack overflow in one of system threads, because that's what happens regularly.
But again, we can't include all those details, if's, and but's in one comment. Hopefully, it'll give basic info and motivate interested folks to read help for CONFIG_THREAD_NAME.