-
-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: timestamp resolution to microseconds on Windows #1039
fix: timestamp resolution to microseconds on Windows #1039
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1039 +/- ##
==========================================
+ Coverage 83.76% 83.78% +0.01%
==========================================
Files 53 53
Lines 5512 5512
Branches 1198 1198
==========================================
+ Hits 4617 4618 +1
Misses 781 781
+ Partials 114 113 -1 |
Actually, on Windows 8 and later, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR made any binary linked to sentry-native depends on I know that probably we should not be compiling with Probably an approach like Microsoft's STL should be used for this: Where At the moment we'll revert this change to continue giving support for Windows 7. |
…ry#1039)" This reverts commit a6ba26e. Related comments: aseprite/aseprite#4691 (comment) getsentry#1039 (comment)
I guess we would have to do something similar to the following: sentry-native/src/sentry_sync.c Lines 38 to 45 in 65bfb62
However, what is the stand on supporting operating systems that went EOL 4+ years ago, especially when done non-standardly by changing definitions? For instance, Sentry Native will not work properly for Windows XP using your technique because of instances like this ( sentry-native/src/sentry_utils.h Lines 145 to 152 in 65bfb62
Frankly, I am not a maintainer of this library; it is up to the Sentry team how they want to resolve this. But I do hope we are not defaulting to the previous solution as it is inefficient and inaccurate, as discussed here: https://devblogs.microsoft.com/oldnewthing/20131101-00/?p=2763. Likewise, I wish new systems were not disadvantaged because of supporting old systems that <1% of users use; |
We are still giving support for Windows Vista and 7 as we still have ~750 users on those platforms. Windows XP support was dropped and probably Vista and 7 will be dropped in a couple of years. But until we can keep working the code on those platforms that will be great. The MSVC STL library is already doing this job of dynamically loading the function, probably we can just use |
The timestamp resolution was changed to microseconds in #995. However, this has never correctly worked on Windows because
SYSTEMTIME
, a return value from the underlying call toGetSystemTime()
, contains only milliseconds, not microseconds: https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-systemtime.Instead,
GetSystemTimeAsFileTime()
can be used as its return value "contains a 64-bit value representing the number of 100-nanosecond intervals". This also helps in reducing two API calls to just one.