From 94ed1c637c839dbcb06df6e83c0c8416bad15674 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 21 Mar 2019 21:59:51 +0100 Subject: [PATCH] Try to check if cntcvt reads are monotonic. https://lore.kernel.org/patchwork/patch/904607/ --- client/TracyProfiler.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 3971b1f4..20d4f0b0 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -203,6 +203,26 @@ static int64_t SetupHwTimer() sigaction( SIGILL, &oldact, nullptr ); GetTimeImpl = GetTimeImplCntvct; + + // Check if cntcvt is monotonic (there is faulty hw out there) + enum { NumProbes = 32 * 1024 }; + int64_t probe[NumProbes]; + for( int j=0; j<10; j++ ) + { + for( int i=0; i