forked from rarias/bscpkgs
nanos6: add patch to use CLOCK_MONOTONIC in CTF
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user