-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perform ucontext->pc variants testing in compile-time
As part of cpu profiler we're extracting current PC (program counter) of out signal's ucontext. Different OS and hardware combinations have different ways for that. We had a list of variants that we tested at compile time and populated PC_FROM_UCONTEXT macro into config.h. It caused duplication and occasional mismatches between our autoconf and cmake bits. So this commit changes testing to be compile-time. We remove complexity from build system and add some to C++ source. We use SFINAE to find which of those variants compile (and we silently assume that 'compiles' implies 'works'; this is what config-time testing did too). Occasionally we'll face situations where several variants compile. And we couldn't handle this case in pure C++. So we have a small Ruby program that generates chain of inheritance among SFINAE-specialized class templates. This handles prioritization among variants. List of ucontext->pc extraction variants is mostly same. We dropped super-obsolete (circa Linux kernel 2.0) arm variant. And NetBSD case is now improved. We now use their nice architecture-independent macro instead of x86-specific access.
- Loading branch information
Showing
11 changed files
with
666 additions
and
205 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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.