3 ms·
Doesn't 0.05s still seem like quite a long runtime for something like this? I wonder what it is doing under the hood that takes so long. For start, it seems l
by loeg 9y ago
Doesn't 0.05s still seem like quite a long runtime for something like this? I wonder what it is doing under the hood that takes so long.
For start, it seems like they hijack a bunch of clock calls with LD_PRELOAD and then redirect vdso ones to syscalls just so they can interpose with ptrace. Why not do the manipulation in the PRELOAD?
I guess using the debugger API makes it easier to coordinate a bunch of processes, but you could probably do the same thing with some sort of IPC mechanism between PRELOADED targets. In the common case (single program running under FC, no IPC is needed.
It's unclear to me why they force any sleep duration at all, e.g., 10ms: https://github.com/majek/fluxcapacitor/blob/master/src/main.c#L323 https://github.com/majek/fluxcapacitor/blob/master/src/main....
It seems like there is room to optimize here, if one were really inspired :-).