[PATCH] D43278: Add Xray instrumentation support to FreeBSD

David CARLIER via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 07:59:25 PST 2018


devnexen added inline comments.


================
Comment at: lib/xray/tests/unit/fdr_logging_test.cc:162
       fdrLoggingHandleArg0(I + 1, XRayEntryType::EXIT);
+#ifdef __linux__
       Threads[I] = syscall(SYS_gettid);
----------------
krytarowski wrote:
> Can we encapsulate this in something like `xray_gettid()`?
I thought of that but did not dare ok why not.


================
Comment at: lib/xray/xray_x86_64.cc:286
+#else
+  __asm__ __volatile__("cpuid" : "=a"(EAX), "=b"(EBX), "=c"(ECX), "=d"(EDX)
+    : "0"(0x80000001));
----------------
krytarowski wrote:
> This should be used for all OSes. `__get_cpuid` is GLIBC specific.
I m not too keen for this change (not changing even in the slighest the Linux behavior) but if everyone is backing you up on this I ll change.


https://reviews.llvm.org/D43278





More information about the llvm-commits mailing list