[PATCH] D43278: Add Xray instrumentation support to FreeBSD

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 10:07:53 PST 2018


krytarowski added inline comments.


================
Comment at: lib/xray/xray_x86_64.cc:84
 
+    if (sysctlbyname("machdep.tsc_freq", &TSCFrequency, &tscfreqsz,
+        NULL, 0) != -1) {
----------------
devnexen wrote:
> krytarowski wrote:
> > I think you should use `sysctl()`, as `sysctlbyname()` allocates memory internally.
> It s not instrumented part, plus did not find sysctl counterpart for this one.
I'm surprised that on FreeBSD this is a dynamic number `OID_AUTO`.. so `sysctlbyname(3)` might be the only interface to use this.


https://reviews.llvm.org/D43278





More information about the llvm-commits mailing list