Closed Bug 1406386 Opened 2 years ago Closed 2 years ago

Have environment var to control how our TimeStamp works on Windows

Categories

(Core :: XPCOM, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: mayhemer, Assigned: mayhemer)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

MOZ_TIEMSTAMP:
- 0: use autodetect as now
- 1: use QueryPerfomanceCounter (assume stable TSC)
- 2: use GteTickCount (fallback from the very start, assume non-stable TSC)
Is this useful for experimentation purposes, or something else?
Flags: needinfo?(honzab.moz)
Priority: -- → P3
(In reply to Nathan Froyd [:froydnj] from comment #1)
> Is this useful for experimentation purposes, or something else?

Oh, I forget to refer the bug this comes from, please read [1] and following comments.  This is only for experimenting and we may one day completely remove it.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1371438#c22
Flags: needinfo?(honzab.moz)
Blocks: 1371438
- an env var MOZ_TIMESTAMP_MODE with 3 possible values:
  - "GTC": forces use of the GetTickCount64 API and never use QueryPerformanceCounter
  - "QPC": exactly the opposite of the above
  - not set or other values: use the default behavior with possibility to fallback to QPC
- also fixes the code for case QueryPerformance is not available on the platform (resolution calculation didn't work as well as the millitick <-> milliseconds conversions)
Attachment #8916040 - Flags: review?(nfroyd)
Comment on attachment 8916040 [details] [diff] [review]
v1 (MOZ_TIMESTAMP_MODE = GTC or QPC)

Review of attachment 8916040 [details] [diff] [review]:
-----------------------------------------------------------------

::: mozglue/misc/TimeStamp_windows.cpp
@@ +229,5 @@
>    // looping is getting unlucky and being interrupted by a context
>    // switch or signal, or being bitten by paging/cache effects
>  
>    ULONGLONG minres = ~0ULL;
> +  if (sUseQPC) {

I can't see how this function worked before without having this check here.
Attachment #8916040 - Flags: review?(nfroyd) → review+
(In reply to Nathan Froyd [:froydnj] from comment #4)
> Comment on attachment 8916040 [details] [diff] [review]
> v1 (MOZ_TIMESTAMP_MODE = GTC or QPC)
> 
> Review of attachment 8916040 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: mozglue/misc/TimeStamp_windows.cpp
> @@ +229,5 @@
> >    // looping is getting unlucky and being interrupted by a context
> >    // switch or signal, or being bitten by paging/cache effects
> >  
> >    ULONGLONG minres = ~0ULL;
> > +  if (sUseQPC) {
> 
> I can't see how this function worked before without having this check here.

It didn't!  Ever!

Thanks for r.
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8912a9d63a5c
Control how TimeStamp works on Windows via and envvar. r=froydnj
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8912a9d63a5c
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.