[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:14:55 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) {
krytarowski wrote:
> 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.
If I read it correctly it also does not allocate memory so no problem. It uses an undocumented kernel interface - contrary to NetBSD.


More information about the llvm-commits mailing list