Uh oh!
There was an error while loading. Please reload this page.
Use CLOCK_BOOTTIME to calculate BootTime on linux - #67589
Conversation
ghost
commented
Apr 5, 2022
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process |
Uh oh!
There was an error while loading. Please reload this page.
655ce42 to
2ee3868CompareUh oh!
There was an error while loading. Please reload this page.
2ee3868 to
82d5fb6Comparedanmoseley
commented
Apr 5, 2022
Just looked at SystemNative_GetTimestamp: Should this be CLOCK_MONOTONIC_RAW, since CLOCK_UPTIME_RAW is a "clock that increments monotonically, in the same manner as CLOCK_MONOTONIC_RAW, but that does not increment while the system is asleep". Yet we are adding it to the time the process was running to get a real world time. As for this one, the man page says "CLOCK_MONOTONIC Clock that cannot be set and represents monotonic time since some unspecified starting point." which seems a little ill defined. |
I have restructured The precision was required in |
danmoseley
commented
Apr 5, 2022
I see you removed clock_gettime_ns_p -- is clock_gettime as good? Looks like the original change was following guidance in https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time. Complicated! Do you have access to Windows and Mac to verify they give reasonable outputs, or are we relying on tests? |
danmoseley
commented
Apr 5, 2022
Ack, we have the tests disabled on mac - could you enable these ? |
2833b62 to
5ab65beCompareThe conditional tests are related to The test |
5ab65be to
91bffaeCompaream11
commented
Apr 11, 2022
Failing leg appears to be infra issue (exit code is 0 from test runs but helix is reporting failure for some reason). @stephentoub, could you please take another look? 🙂 |
adamsitnik
left a comment
There was a problem hiding this comment.
@am11 big thanks for your contribution! PTAL at my comments
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
adamsitnik
left a comment
There was a problem hiding this comment.
It LGTM, thanks a lot @am11 !
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jkotas
commented
May 11, 2022
Do we need to add or enable any tests that validate |
`time_t` on Android 32-bit (arm and x86) is typedef'd as `long`.
adamsitnik
commented
May 18, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
am11
commented
May 18, 2022
Still failing on Android. |
danmoseley
commented
Sep 6, 2022
If this is blocked by the linked issue, let's mark this as draft meantime? |
Uh oh!
There was an error while loading. Please reload this page.
| long bootTimeTicks = Interlocked.Read(ref s_bootTimeTicks); | ||
| if (bootTimeTicks == 0) | ||
| { | ||
| bootTimeTicks = Interop.Sys.GetBootTimeTicks(); |
There was a problem hiding this comment.
I think we should check if the value is -1 and throw PlatformNotSupportedException in that case.
Co-authored-by: Simon Rozsival <simon@rozsival.com>
am11
commented
Sep 7, 2022
Thanks a lot @simonrozsival! Could you please run |
simonrozsival
commented
Sep 7, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
am11
commented
Sep 7, 2022
Android legs are green. Remaining failures are unrelated. |
MichalStrehovsky
commented
Sep 9, 2022
I'm seeing a failure in #75055 that looks related: |
MichalStrehovsky
commented
Sep 9, 2022
Filed as #75329 so that I can refer to it. |
am11
commented
Sep 9, 2022
Thanks and yes, it's related. The failure is happening on Windows 11 in a modified test (on Linux, it cannot fail because we calculate time difference from fixed point). Seems like we would need to bring back Strange thing is the difference on Windows 11 is 13 seconds, which is quite big (and we have only changed Linux implementation in this PR). Unless someone object, I'll add 30 seconds precision to be on the safe side. |
uweigand
commented
Sep 9, 2022
I've also seen this test failure on linux-s390x (see #75329 (comment)) with a much larger time difference - it looks to me it might be picking up the wrong process? |
am11
commented
Sep 9, 2022
Yes, this assertion is not valid in GetProcessByName test when there are multiple dotnet processes running. We should just delete it from the test. Posted #75334. |
Fixes#67583.