-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arc: Update PROFILE_HOOK to support Linux's ftrace
Ftrace is a Linux internal tracer which helps developers to find what is going on inisde the kernel. The way this works is the _mcount function call (placed at the start of every kernel function, produced by the -pg switch in gcc), starts of pointing to a simple return in the stack. The ARCv2 ABI does not enable us to perform full function tracing (aka ftrace_graph with entry and exit) due to the fact that the blink (return address) is pushed first on the stack. However, providing the location of blink in the current stack enables some ftrace capabilities. This patch updates the ARC's profile hook for Linux targets, by providing two arguments to `_mcount` profile function. First argument is blink value, and the second argument is the blink location in the current function stack. As PROFILE_HOOK is called in the expand, and the stack layout is known after register allocation, we use an unspec to mark the mcount second argument move which needs to be updated latter on. gcc/ * config/arc/arc-protos.h (arc_get_arg_ptr): Declare. (arc_profile_hook): Likewise. * config/arc/arc.cc (arc_profile_hook): New function. (arc_get_arg_ptr): Likewise. * config/arc/arc.md (UNSPEC_ARC_MCOUNT): New define. (mcount_stack): New pattern. * config/arc/linux.h (PROFILE_HOOK): Update hook. Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
- Loading branch information
Showing
4 changed files
with
62 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters