nanos6: add patch to use CLOCK_MONOTONIC in CTF
This commit is contained in:
parent
b192fc44f5
commit
4780a81d70
21
bsc/nanos6/clock-monotonic.patch
Normal file
21
bsc/nanos6/clock-monotonic.patch
Normal 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
|
@ -31,6 +31,8 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "17z6gr122cw0l4lsp0qdrdbcl1zcls4i0haxqpj3g60fvjx3fznp";
|
||||
};
|
||||
|
||||
patches = [ ./clock-monotonic.patch ];
|
||||
|
||||
prePatch = ''
|
||||
patchShebangs scripts/generate_config.sh
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user