Bug 183312 - [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
Summary: [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-03-03 06:23 PST by Yusuke Suzuki
Modified: 2018-03-12 20:10 PDT (History)
8 users (show)

See Also:


Attachments
Patch (120.07 KB, patch)
2018-03-03 06:29 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (120.40 KB, patch)
2018-03-03 07:21 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (120.47 KB, patch)
2018-03-03 09:22 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (120.53 KB, patch)
2018-03-04 00:00 PST, Yusuke Suzuki
mark.lam: review+
Details | Formatted Diff | Diff
Patch (120.50 KB, patch)
2018-03-04 17:52 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2018-03-03 06:23:40 PST
[WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
Comment 1 Yusuke Suzuki 2018-03-03 06:29:38 PST
Created attachment 334954 [details]
Patch
Comment 2 Yusuke Suzuki 2018-03-03 07:21:50 PST
Created attachment 334956 [details]
Patch
Comment 3 Yusuke Suzuki 2018-03-03 09:22:32 PST
Created attachment 334960 [details]
Patch
Comment 4 Yusuke Suzuki 2018-03-04 00:00:45 PST
Created attachment 334976 [details]
Patch
Comment 5 Mark Lam 2018-03-04 09:44:34 PST
Comment on attachment 334976 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=334976&action=review

r=me

> Source/WTF/ChangeLog:16
> +        conslidate various time-source implementations in one place.

*consolidate*
Comment 6 Yusuke Suzuki 2018-03-04 11:05:10 PST
Comment on attachment 334976 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=334976&action=review

>> Source/WTF/ChangeLog:16
>> +        conslidate various time-source implementations in one place.
> 
> *consolidate*

Thanks, fixed.
Comment 7 Yusuke Suzuki 2018-03-04 17:52:52 PST
Created attachment 334985 [details]
Patch
Comment 8 Yusuke Suzuki 2018-03-04 17:53:30 PST
Comment on attachment 334985 [details]
Patch

Let's go.
Comment 9 WebKit Commit Bot 2018-03-04 18:34:02 PST
Comment on attachment 334985 [details]
Patch

Clearing flags on attachment: 334985

Committed r229209: <https://trac.webkit.org/changeset/229209>
Comment 10 JF Bastien 2018-03-05 09:48:10 PST
Comment on attachment 334985 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=334985&action=review

> Source/WTF/wtf/cocoa/CPUTimeCocoa.mm:79
> +    thread_info(threadPort, THREAD_BASIC_INFO, reinterpret_cast<thread_info_t>(&info), &infoCount);

RELEASE_ASSERT that it returns KERN_SUCCESS.

> Source/WTF/wtf/unix/CPUTimeUnix.cpp:50
> +    clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);

Release assert that it returns 0.

> Source/WTF/wtf/win/CPUTimeWin.cpp:68
> +    ASSERT_UNUSED(ret, ret);

Release assert that it's non-zero.
Comment 11 Yusuke Suzuki 2018-03-05 10:56:05 PST
Comment on attachment 334985 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=334985&action=review

Thank you!

>> Source/WTF/wtf/cocoa/CPUTimeCocoa.mm:79
>> +    thread_info(threadPort, THREAD_BASIC_INFO, reinterpret_cast<thread_info_t>(&info), &infoCount);
> 
> RELEASE_ASSERT that it returns KERN_SUCCESS.

Nice, I'll fix in a follow-up patch.

>> Source/WTF/wtf/unix/CPUTimeUnix.cpp:50
>> +    clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
> 
> Release assert that it returns 0.

Nice, fixed.

>> Source/WTF/wtf/win/CPUTimeWin.cpp:68
>> +    ASSERT_UNUSED(ret, ret);
> 
> Release assert that it's non-zero.

Fixed.
Comment 12 Yusuke Suzuki 2018-03-05 11:04:05 PST
Committed r229289: <https://trac.webkit.org/changeset/229289>
Comment 13 Radar WebKit Bug Importer 2018-03-05 11:06:36 PST
<rdar://problem/38146407>
Comment 14 Yusuke Suzuki 2018-03-12 20:10:49 PDT
Committed r229571: <https://trac.webkit.org/changeset/229571>