diff --git a/bsc/nanos6/clock-monotonic.patch b/bsc/nanos6/clock-monotonic.patch new file mode 100644 index 0000000..b05b17b --- /dev/null +++ b/bsc/nanos6/clock-monotonic.patch @@ -0,0 +1,21 @@ +diff --git a/src/instrument/ctf/ctfapi/CTFClock.hpp b/src/instrument/ctf/ctfapi/CTFClock.hpp +index 7df821c9..27cf269b 100644 +--- a/src/instrument/ctf/ctfapi/CTFClock.hpp ++++ b/src/instrument/ctf/ctfapi/CTFClock.hpp +@@ -9,13 +9,9 @@ + + #include + +-// We prefer CLOCK_MONOTONIC_RAW to prevent dynamic NTF time adjustments. +-// However, if the system does not support it, we fall back to CLOCK_MONOTONIC +- +-#ifdef CLOCK_MONOTONIC_RAW +-#define CTF_CLOCK CLOCK_MONOTONIC_RAW +-#else ++// Always use the CLOCK_MONOTONIC clock as it is drift-corrected by NTP, ++// and is the most reliable to compensate changes the oscillator ++// frequency. It is not affected by time jumps. + #define CTF_CLOCK CLOCK_MONOTONIC +-#endif + + #endif // CTF_CLOCK_HPP diff --git a/bsc/nanos6/default.nix b/bsc/nanos6/default.nix index 2c06b12..4c5e41c 100644 --- a/bsc/nanos6/default.nix +++ b/bsc/nanos6/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { sha256 = "17z6gr122cw0l4lsp0qdrdbcl1zcls4i0haxqpj3g60fvjx3fznp"; }; + patches = [ ./clock-monotonic.patch ]; + prePatch = '' patchShebangs scripts/generate_config.sh '';