Jim Newsome

Results 197 comments of Jim Newsome

BTW this is similar to User Mode Linux (UML)'s "traditional" or "tracing thread" strategy. In that strategy they have a single tracing thread for all UML processes, but the tracing...

Confirmed that we *do* observe this syscall being made in our Docker Ubuntu 22.04 container, but it appears that glibc falls back to clone. ``` $ ci/run.sh -i -o 'ubuntu:22.04;gcc;debug'...

When we implement this, we should also ensure that MSG_NOSIGNAL disables it. (#2082 "implements" MSG_NOSIGNAL as a no-op in the meantime)

Using https://stackoverflow.com/a/64863392 as an example, I tested using [perf_event_open](https://man7.org/linux/man-pages/man2/perf_event_open.2.html) to count instructions executed. It looks like this could work, with a couple caveats: * I got EPERM when trying to...

There's another counter for context switches. It might be interesting to check whether the discrepancies happen during measurements where there was one. If so, that might be a solvable bug...

From [perf_event_open(2)](https://man7.org/linux/man-pages/man2/perf_event_open.2.html) > Be careful, these can be affected by various issues, most notably hardware interrupt counts. So, seems unlikely we can get a deterministic count. As in the current...

For completeness I guess I should mention it should be possible to get a deterministic instruction count by emulating the CPU, e.g. by using [valgrind](https://valgrind.org/) or [pin](https://www.intel.com/content/www/us/en/developer/articles/tool/pin-a-dynamic-binary-instrumentation-tool.html), but this would...

I think it wouldn't be terribly difficult to implement preemption using [setitimer](https://man7.org/linux/man-pages/man2/setitimer.2.html) to arrange for an interrupt after some amount of CPU time, and having out interrupt handler move time...

One note about using gperftools - I had to manually change the sign of an integer in the first line of some heap dumps, due to a 32-bit overflow. See...

Btw it looks like the initializer method is unlikely to be stabilized. It's been superseded by the (merged, but unimplemented) [ReadBuf RFC](https://github.com/rust-lang/rfcs/pull/2930)