nanos6: add patch to use CLOCK_MONOTONIC in CTF

This commit is contained in:
Rodrigo Arias Mallo 2021-03-10 18:42:59 +01:00
parent b192fc44f5
commit 4780a81d70
2 changed files with 23 additions and 0 deletions

View File

@ -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 <time.h>
-// 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

View File

@ -31,6 +31,8 @@ stdenv.mkDerivation rec {
sha256 = "17z6gr122cw0l4lsp0qdrdbcl1zcls4i0haxqpj3g60fvjx3fznp";
};
patches = [ ./clock-monotonic.patch ];
prePatch = ''
patchShebangs scripts/generate_config.sh
'';