[PATCH] D43278: Add Xray instrumentation support to FreeBSD
Kamil Rytarowski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 14 16:45:51 PST 2018
krytarowski added a comment.
#if SANITIZER_MAC
// On Darwin, thread IDs are 64-bit even on 32-bit systems.
typedef u64 tid_t;
#else
typedef uptr tid_t;
#endif
So right, Darwin uses 64-bit integer.
I don't know who needs 'uptr' for !Darwin? In my opinion this `tid_t` should be typedefed to `u64` for everybody.
This is the solution e.g. in LLDB:
https://github.com/llvm-mirror/lldb/blob/63c8b08f934bfb71d72dcb24af01b9281c49428c/include/lldb/lldb-types.h#L88
In XRay `writeNewBufferPreamble()` we can temporarily cast `tid_t` to `int32_t` and document (add a comment) that this does not work for Darwin, because it uses 64-bit Thread ID.
Darwin users can improve it in future.
I will follow up with NetBSD XRay support once this will land the sources.
https://reviews.llvm.org/D43278
More information about the llvm-commits
mailing list