Include the necessary headers while there.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
So, these additional function calls replacing the in-lined code will incur non-trivial overheads in the fast path. As discussed offline we should do this refactoring differently or at a smaller scale.
will incur non-trivial overheads in the fast path. As discussed offline
we should do this refactoring differently or at a smaller scale.
Fixed. The fast path is now more clear and marked as never-instrument to for bootstrapping LLVM with XRay enabled.
lib/xray/xray_arm.cc | ||
---|---|---|
23 ↗ | (On Diff #76292) | Probably want constexpr here. |
lib/xray/xray_inmemory_log.cc | ||
141 ↗ | (On Diff #76292) | We cannot actually assume that the compiler used to build compiler-rt actually supports this attribute. Let's defer this for later, when we have a check in CMake to figure out whether the compiler we're using supports XRay explicitly, then make this conditional on a macro. |
lib/xray/xray_x86_64.h | ||
6 ↗ | (On Diff #76292) | Consider adding an attribute that forces this to be always inline, if not have a //TODO: or //FIXME: that indicates so. |
I've still kept this as a NFC change, despite the wrong strncat usage and Report() format strings. It's mostly shuffling code around.
I'm still waiting on an ARM build machine, so tested only on amd64.
Just a few more...
lib/xray/xray_emulate_tsc.h | ||
---|---|---|
8 ↗ | (On Diff #81902) | You can't mark this always inline as well? Also probably want the never instrument attribute here. |
20 ↗ | (On Diff #81902) | Same here, always inline and never instrument? |
lib/xray/xray_x86_64.cc | ||
56 ↗ | (On Diff #81902) | Always inline, never instrument? |
lib/xray/xray_x86_64.h | ||
8 ↗ | (On Diff #81902) | Also never instrument? |
Local testing implies that there's a build break with this change.
../lib/clang/4.0.0/lib/linux/libclang_rt.xray-x86_64.a(xray_inmemory_log.cc.o): In function `__xray_OpenLogFile': .../llvm/projects/compiler-rt/lib/xray/xray_inmemory_log.cc:138: undefined reference to `__xray::cycleFrequency()' clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)