-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add FTrace support for ARC processors #144
Comments
Let's first focus on ARCv2 support and then make sure it's also usable on ARCv3. |
Apologies for the tardiness in answering here. Bumped into an ugly problem. Here is the current status: The problemThe ARCv2 ABI by itself does not enable us to perform full function tracing (aka ExplanationFollowing the ABI, the function prologue stores the This makes it not possible to always know the exact location in stack of a routines' callers return address. This is a necessary requirement because we need to replace it with a kernel hook for registering the function exit, and if we miss the spot, we will eventually corrupt Kernel memory. SolutionsARCv2The only viable solution for ARCv2 is to modify GCC so that it gives us more information when tracing. Without aforementioned fix in GCC one may try to use FTrace on ARCv2, but if any variadic function is traced (within the kernel or not) the kernel will crash. Unfortunately, until the GCC change gets implemnted, there is nothing we can do about this except finding those occurrences and preventing them from being traced (removing compiler options ARCv3ARCv3 does not have the problems ARCv2 has due to the different ABIs. A PR for this feature is available at #146 |
@claziss finalized the gcc ARCv2 patch and it is fully working! |
@BrunoASMauricio may we have both the patches (for GCC & Linux) posted in the corresponding repositories? |
The PR for ARCv3 has been accepted and is waiting merge, I created a second one that builds on top of it, providing both ARCv3 and ARCv2 functionality (#151) As per the comment in the PR, the following commit must be present in GCC (foss-for-synopsys-dwc-arc-processors/gcc@c52b7ec, aka arc-2023.09 branch) |
As of today FTrace is not supported for ARC processors, while it is a very powerful tool for kernel tracing, see https://docs.kernel.org/trace/ftrace.html#wakeup as a good example.
What's good though, implementation of that missing functionality seems to be a relatively simple task - we just need to implement an
_mcount
handler carefully and let the existing kernel infrastructure do the rest.As references we may look at:
The text was updated successfully, but these errors were encountered: