-
Notifications
You must be signed in to change notification settings - Fork 8.3k
arch: riscv: stacktrace: support stacktrace in early system init #99419
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
arch: riscv: stacktrace: support stacktrace in early system init #99419
Conversation
npitre
left a comment
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.
You might want to use is_thread_dummy(thread) instead.
Yet... this is legitimate only at boot time. Otherwise, after boot,
the dummy thread is masquerading the real thread that is dying andusing
IRQ stack isn't right in that case.
Why not simply initializing _thread_dummy.stack_info.start and
_thread_dummy.stack_info.size after the call to z_dummy_thread_init()
in kernel/init.c ?
9c7e55a to
ac8d2a4
Compare
Didn't know that function exists, removed the compiler guards so that it is always available.
Yeah, this PR is basically special handling the dummy thread during init, my understanding is that once we jump to
Each architecture has different names for the stack they used for the dummy thread, I find handling that with |
Since these helper functions are read-only, mark the `thread` arg as `const` so that we can pass const thread to it without triggering warnings. Signed-off-by: Yong Cong Sin <[email protected]> Signed-off-by: Yong Cong Sin <[email protected]>
ac8d2a4 to
4dc1f2d
Compare
|
Yeah, this PR is basically special handling the dummy thread during init
Then it would be best if you made it explicit in the code with a comment.
|
Add support for stacktrace in dummy thread which is used to run the early system initialization code before the kernel switches to the main thread. On RISC-V, the dummy thread will be running temporarily on the interrupt stack, but currently we do not initialize the stack info for the dummy thread, hence check the address against the interrupt stack. Signed-off-by: Yong Cong Sin <[email protected]> Signed-off-by: Yong Cong Sin <[email protected]>
4dc1f2d to
ee58a56
Compare
Updated the patch with comment and updated the commit message, hopefully that makes the intent of the code clear. |
|



Add support for stacktrace in dummy thread which is used to run
the early system initialization code before the kernel switches
to the main thread.
On RISC-V, the dummy thread will be running temporarily on the
interrupt stack, but currently we do not initialize the stack
info for the dummy thread, hence check the address against the
interrupt stack.
before:
after: