Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Issue 2695743003: Added GetCpuTime to base/ to get total CPU time consumed by process for perf tests. (Closed)

Created:
3 years, 10 months ago by ilnik
Modified:
3 years, 10 months ago
CC:
webrtc-reviews_webrtc.org
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Added GetCpuTime to base/ to get total CPU time consumed by process for perf tests. BUG=webrtc:7095 Review-Url: https://codereview.webrtc.org/2695743003 Cr-Commit-Position: refs/heads/master@{#16665} Committed: https://chromium.googlesource.com/external/webrtc/+/3ff474b72ba1b34027e8391b1014c2838af445d4

Patch Set 1 #

Patch Set 2 : increased test tolerance and fixed typo #

Patch Set 3 : Small improvements #

Patch Set 4 : fix asan #

Patch Set 5 : fixing address sanitizing #

Patch Set 6 : fixing asan second attempt #

Total comments: 8

Patch Set 7 : Implemeted nisse@ comments #

Total comments: 8

Patch Set 8 : fixed compile error on win #

Patch Set 9 : implemented Nisse@ comments part 2 #

Total comments: 13

Patch Set 10 : implemented Nisse comments part 3 #

Patch Set 11 : Added GetThreadCpuTime(), implemented Nisse comments. #

Patch Set 12 : typo fixed #

Patch Set 13 : fixed CE on MAC #

Patch Set 14 : fixed mach CE v2 #

Patch Set 15 : fixed MAC CE v3 #

Patch Set 16 : fixing MAC CE v4 #

Patch Set 17 : Fixing MAC CE v5 #

Patch Set 18 : Fixed tests so threads will do only specified amount of work #

Patch Set 19 : Speed-up tests and cleanup #

Patch Set 20 : refactor tests #

Total comments: 15

Patch Set 21 : implemented Sprang@ comments #

Total comments: 18

Patch Set 22 : implemented deadbeef@ comments. #

Total comments: 4

Patch Set 23 : deadbeef@ comments. #

Total comments: 2

Patch Set 24 : implemented Sprang@ comments #

Total comments: 1

Patch Set 25 : Reland of the CL #

Patch Set 26 : fixing flaky tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -0 lines) Patch
M webrtc/base/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +3 lines, -0 lines 0 comments Download
A webrtc/base/cpu_time.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +28 lines, -0 lines 0 comments Download
A webrtc/base/cpu_time.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +114 lines, -0 lines 0 comments Download
A webrtc/base/cpu_time_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +108 lines, -0 lines 0 comments Download

Messages

Total messages: 106 (59 generated)
ilnik
I have added cpu_time to base/ directory. Currently it's in the "rtc_base_approved" source set. Is ...
3 years, 10 months ago (2017-02-15 11:42:16 UTC) #26
nisse-webrtc
You may also want to have a look at std::chrono, maybe it provides some portable ...
3 years, 10 months ago (2017-02-15 12:18:17 UTC) #32
ilnik
https://codereview.webrtc.org/2695743003/diff/100001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/100001/webrtc/base/cpu_time.cc#newcode32 webrtc/base/cpu_time.cc:32: static_cast<double>(ts.tv_nsec) / 1000000000.0; On 2017/02/15 12:18:16, nisse-webrtc wrote: > ...
3 years, 10 months ago (2017-02-15 12:53:21 UTC) #33
nisse-webrtc
https://codereview.webrtc.org/2695743003/diff/120001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/120001/webrtc/base/cpu_time.cc#newcode31 webrtc/base/cpu_time.cc:31: return ts.tv_sec * kNumNanosecsPerSec + ts.tv_nsec; I think you ...
3 years, 10 months ago (2017-02-15 13:07:31 UTC) #38
ilnik
https://codereview.webrtc.org/2695743003/diff/120001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/120001/webrtc/base/cpu_time.cc#newcode31 webrtc/base/cpu_time.cc:31: return ts.tv_sec * kNumNanosecsPerSec + ts.tv_nsec; On 2017/02/15 13:07:31, ...
3 years, 10 months ago (2017-02-15 13:23:11 UTC) #39
nisse-webrtc
Some more comments. Sorry I didn't look closer at the tests in earlier iterations. (And ...
3 years, 10 months ago (2017-02-15 14:27:35 UTC) #42
ilnik
https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc File webrtc/base/cpu_time_unittest.cc (right): https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc#newcode16 webrtc/base/cpu_time_unittest.cc:16: namespace internal { On 2017/02/15 14:27:35, nisse-webrtc wrote: > ...
3 years, 10 months ago (2017-02-15 14:40:45 UTC) #45
nisse-webrtc
https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc File webrtc/base/cpu_time_unittest.cc (right): https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc#newcode42 webrtc/base/cpu_time_unittest.cc:42: ::internal::kProcessingTimeSec - ::internal::kAllowedErrorSec); On 2017/02/15 14:40:45, ilnik wrote: > ...
3 years, 10 months ago (2017-02-15 14:48:33 UTC) #48
ilnik
https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc File webrtc/base/cpu_time_unittest.cc (right): https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc#newcode42 webrtc/base/cpu_time_unittest.cc:42: ::internal::kProcessingTimeSec - ::internal::kAllowedErrorSec); On 2017/02/15 14:48:33, nisse-webrtc wrote: > ...
3 years, 10 months ago (2017-02-15 15:07:10 UTC) #51
ilnik
https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc File webrtc/base/cpu_time_unittest.cc (right): https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc#newcode42 webrtc/base/cpu_time_unittest.cc:42: ::internal::kProcessingTimeSec - ::internal::kAllowedErrorSec); On 2017/02/15 15:07:10, ilnik wrote: > ...
3 years, 10 months ago (2017-02-15 15:19:16 UTC) #52
henrika_webrtc
+kjellander since he has lots of experience of tests running on different bot configurations. To ...
3 years, 10 months ago (2017-02-15 15:26:26 UTC) #54
ilnik
On 2017/02/15 15:26:26, henrika_webrtc wrote: > +kjellander since he has lots of experience of tests ...
3 years, 10 months ago (2017-02-15 15:32:53 UTC) #55
nisse-webrtc
https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc File webrtc/base/cpu_time_unittest.cc (right): https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc#newcode42 webrtc/base/cpu_time_unittest.cc:42: ::internal::kProcessingTimeSec - ::internal::kAllowedErrorSec); On 2017/02/15 15:19:16, ilnik wrote: > ...
3 years, 10 months ago (2017-02-15 15:34:35 UTC) #56
ilnik
On 2017/02/15 15:34:35, nisse-webrtc wrote: > https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc > File webrtc/base/cpu_time_unittest.cc (right): > > https://codereview.webrtc.org/2695743003/diff/160001/webrtc/base/cpu_time_unittest.cc#newcode42 > ...
3 years, 10 months ago (2017-02-15 15:43:24 UTC) #57
nisse-webrtc
On 2017/02/15 15:43:24, ilnik wrote: > On 2017/02/15 15:34:35, nisse-webrtc wrote: > > I think ...
3 years, 10 months ago (2017-02-15 15:54:51 UTC) #58
ilnik
On 2017/02/15 15:54:51, nisse-webrtc wrote: > On 2017/02/15 15:43:24, ilnik wrote: > > On 2017/02/15 ...
3 years, 10 months ago (2017-02-15 15:57:55 UTC) #59
kjellander_webrtc
I don't know enough about how hard this is to implement properly but it seems ...
3 years, 10 months ago (2017-02-16 07:57:14 UTC) #60
kjellander_webrtc
On 2017/02/16 07:57:14, kjellander_webrtc wrote: > I don't know enough about how hard this is ...
3 years, 10 months ago (2017-02-16 07:58:28 UTC) #61
nisse-webrtc
On 2017/02/16 07:57:14, kjellander_webrtc wrote: > I don't know enough about how hard this is ...
3 years, 10 months ago (2017-02-16 08:14:44 UTC) #62
ilnik
On 2017/02/16 08:14:44, nisse-webrtc wrote: > On 2017/02/16 07:57:14, kjellander_webrtc wrote: > > I don't ...
3 years, 10 months ago (2017-02-16 08:43:10 UTC) #63
nisse-webrtc
On 2017/02/16 08:43:10, ilnik wrote: > That way we can measure each testcase independently. Measuring ...
3 years, 10 months ago (2017-02-16 08:46:39 UTC) #64
ilnik
On 2017/02/16 08:46:39, nisse-webrtc wrote: > On 2017/02/16 08:43:10, ilnik wrote: > > That way ...
3 years, 10 months ago (2017-02-16 09:30:51 UTC) #70
kjellander_webrtc
On 2017/02/16 08:46:39, nisse-webrtc wrote: > On 2017/02/16 08:43:10, ilnik wrote: > > That way ...
3 years, 10 months ago (2017-02-16 09:31:14 UTC) #71
ilnik
On 2017/02/16 09:31:14, kjellander_webrtc wrote: > On 2017/02/16 08:46:39, nisse-webrtc wrote: > > On 2017/02/16 ...
3 years, 10 months ago (2017-02-16 11:39:12 UTC) #72
sprang_webrtc
https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time.cc#newcode23 webrtc/base/cpu_time.cc:23: #endif At this point this file isn't overly large, ...
3 years, 10 months ago (2017-02-16 12:20:19 UTC) #73
ilnik
On 2017/02/16 11:39:12, ilnik wrote: > On 2017/02/16 09:31:14, kjellander_webrtc wrote: > > On 2017/02/16 ...
3 years, 10 months ago (2017-02-16 12:21:23 UTC) #74
nisse-webrtc
https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time.cc#newcode44 webrtc/base/cpu_time.cc:44: LOG_ERR(LS_ERROR) << "clock_gettime() failed."; On 2017/02/16 12:20:18, språng wrote: ...
3 years, 10 months ago (2017-02-16 12:25:03 UTC) #75
sprang_webrtc
On 2017/02/16 12:21:23, ilnik wrote: > On 2017/02/16 11:39:12, ilnik wrote: > > On 2017/02/16 ...
3 years, 10 months ago (2017-02-16 12:26:28 UTC) #76
ilnik
https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time.cc#newcode23 webrtc/base/cpu_time.cc:23: #endif On 2017/02/16 12:20:18, språng wrote: > At this ...
3 years, 10 months ago (2017-02-16 12:38:55 UTC) #77
nisse-webrtc
https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time_unittest.cc File webrtc/base/cpu_time_unittest.cc (right): https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time_unittest.cc#newcode37 webrtc/base/cpu_time_unittest.cc:37: int64_t* counter = new int64_t; On 2017/02/16 12:38:55, ilnik ...
3 years, 10 months ago (2017-02-16 12:49:46 UTC) #78
ilnik
https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time_unittest.cc File webrtc/base/cpu_time_unittest.cc (right): https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time_unittest.cc#newcode37 webrtc/base/cpu_time_unittest.cc:37: int64_t* counter = new int64_t; On 2017/02/16 12:49:46, nisse-webrtc ...
3 years, 10 months ago (2017-02-16 12:55:42 UTC) #79
ilnik
On 2017/02/16 12:55:42, ilnik wrote: > https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time_unittest.cc > File webrtc/base/cpu_time_unittest.cc (right): > > https://codereview.webrtc.org/2695743003/diff/360001/webrtc/base/cpu_time_unittest.cc#newcode37 > ...
3 years, 10 months ago (2017-02-16 14:01:03 UTC) #82
Taylor Brandstetter
Mainly nits https://codereview.webrtc.org/2695743003/diff/380001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/380001/webrtc/base/cpu_time.cc#newcode11 webrtc/base/cpu_time.cc:11: #if defined(WEBRTC_LINUX) Should these be "WEBRTC_POSIX" instead? ...
3 years, 10 months ago (2017-02-16 18:49:19 UTC) #85
ilnik
https://codereview.webrtc.org/2695743003/diff/380001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/380001/webrtc/base/cpu_time.cc#newcode11 webrtc/base/cpu_time.cc:11: #if defined(WEBRTC_LINUX) On 2017/02/16 18:49:19, Taylor Brandstetter wrote: > ...
3 years, 10 months ago (2017-02-17 09:17:10 UTC) #86
Taylor Brandstetter
lgtm https://codereview.webrtc.org/2695743003/diff/400001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/400001/webrtc/base/cpu_time.cc#newcode103 webrtc/base/cpu_time.cc:103: LOG_ERR(LS_ERROR) << "GetProcessTimes() failed."; Just noticed, this should ...
3 years, 10 months ago (2017-02-17 09:45:14 UTC) #87
ilnik
https://codereview.webrtc.org/2695743003/diff/400001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/400001/webrtc/base/cpu_time.cc#newcode103 webrtc/base/cpu_time.cc:103: LOG_ERR(LS_ERROR) << "GetProcessTimes() failed."; On 2017/02/17 09:45:13, Taylor Brandstetter ...
3 years, 10 months ago (2017-02-17 09:52:08 UTC) #88
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2695743003/420001
3 years, 10 months ago (2017-02-17 09:53:15 UTC) #91
sprang_webrtc
lgtm https://codereview.webrtc.org/2695743003/diff/420001/webrtc/base/cpu_time.cc File webrtc/base/cpu_time.cc (right): https://codereview.webrtc.org/2695743003/diff/420001/webrtc/base/cpu_time.cc#newcode69 webrtc/base/cpu_time.cc:69: static_assert(false); nit: Maybe even static_assert(false, "Platform support not ...
3 years, 10 months ago (2017-02-17 10:17:45 UTC) #92
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2695743003/440001
3 years, 10 months ago (2017-02-17 10:34:09 UTC) #96
commit-bot: I haz the power
Committed patchset #24 (id:440001) as https://chromium.googlesource.com/external/webrtc/+/3ff474b72ba1b34027e8391b1014c2838af445d4
3 years, 10 months ago (2017-02-17 12:02:31 UTC) #99
tommi
A revert of this CL (patchset #24 id:440001) has been created in https://codereview.webrtc.org/2698333004/ by tommi@webrtc.org. ...
3 years, 10 months ago (2017-02-17 22:59:05 UTC) #100
Taylor Brandstetter
https://codereview.webrtc.org/2695743003/diff/440001/webrtc/base/BUILD.gn File webrtc/base/BUILD.gn (right): https://codereview.webrtc.org/2695743003/diff/440001/webrtc/base/BUILD.gn#newcode770 webrtc/base/BUILD.gn:770: "cpu_time_unittest.cc", Sorry I didn't notice earlier, but this should ...
3 years, 10 months ago (2017-02-17 23:35:47 UTC) #101
ilnik
On 2017/02/17 23:35:47, Taylor Brandstetter wrote: > https://codereview.webrtc.org/2695743003/diff/440001/webrtc/base/BUILD.gn > File webrtc/base/BUILD.gn (right): > > https://codereview.webrtc.org/2695743003/diff/440001/webrtc/base/BUILD.gn#newcode770 ...
3 years, 10 months ago (2017-02-20 08:42:47 UTC) #102
Taylor Brandstetter
On 2017/02/20 08:42:47, ilnik wrote: > On 2017/02/17 23:35:47, Taylor Brandstetter wrote: > > https://codereview.webrtc.org/2695743003/diff/440001/webrtc/base/BUILD.gn ...
3 years, 10 months ago (2017-02-20 10:53:45 UTC) #103
ilnik
On 2017/02/20 10:53:45, Taylor Brandstetter wrote: > On 2017/02/20 08:42:47, ilnik wrote: > > On ...
3 years, 10 months ago (2017-02-20 11:44:37 UTC) #104
nisse-webrtc
On 2017/02/20 11:44:37, ilnik wrote: > On 2017/02/20 10:53:45, Taylor Brandstetter wrote: > > On ...
3 years, 10 months ago (2017-02-20 12:21:29 UTC) #105
ilnik
3 years, 10 months ago (2017-02-20 12:26:26 UTC) #106
Message was sent while issue was closed.
On 2017/02/20 12:21:29, nisse-webrtc wrote:
> On 2017/02/20 11:44:37, ilnik wrote:
> > On 2017/02/20 10:53:45, Taylor Brandstetter wrote:
> > > On 2017/02/20 08:42:47, ilnik wrote:
> > > > On 2017/02/17 23:35:47, Taylor Brandstetter wrote:
> > > > >
> https://codereview.webrtc.org/2695743003/diff/440001/webrtc/base/BUILD.gn
> > > > > File webrtc/base/BUILD.gn (right):
> > > > > 
> > > > >
> > > >
> > >
> >
>
https://codereview.webrtc.org/2695743003/diff/440001/webrtc/base/BUILD.gn#new...
> > > > > webrtc/base/BUILD.gn:770: "cpu_time_unittest.cc",
> > > > > Sorry I didn't notice earlier, but this should go in
> > > > rtc_base_nonparallel_tests.
> > > > > These are tests that aren't run in parallel, so any tests based on
real
> > > system
> > > > > time or OS-level resources like sockets or files should use it. That
> > > hopefully
> > > > > should fix the builtbot failures.
> > > > 
> > > > Taylor, while I am fixing Build.gn, could I also move cpu_time.cc and
> > > cpu_time.h
> > > > to rtc_base or rtc_base_approved?
> > > > It looks like I can't depend on rtc_base_tests_utils from outside of
this
> > > file.
> > > 
> > > If this is only intended to be used for tests, it seems like
> > rtc_base_test_utils
> > > is the right place. Can you explain more about the issue you're seeing?
> > 
> > I am trying to use functions from webrtc/base/cpu_time.cc in
> > webrtc/video/video_quality_tests. So I need to somehow reference cpu_time.cc
> > from webrtc/video/BUILD.gn.
> > I don't fully understand these BUILD.gn files, but it looks like I can't add
> > anything except from public_deps in other BUILD.gn files.
> > rtc_base_tests_utils is not even defined as rtc_static_library, it's
> > rtc_source_set.
> > 
> > Do I add dependency on directly cpu_time.cc and cpu_time.h in video/BUILD.gn
> > then?
> 
> I think the right way is to add rtc_base_tests_utils as a dependency 
> for video_quality_test.

Thank, you. It works. Last time I tried to do this, I did something wrong, and
got ninja errors.

Powered by Google App Engine
This is Rietveld 408576698