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

Issue 1124673004: Chrome OS: Reduce NOTREACHED() overhead for release builds. (Closed)

Created:
5 years, 7 months ago by Thiemo Nagel
Modified:
4 years, 6 months ago
Reviewers:
danakj, Shu Chen, Nico
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Chrome OS: Reduce NOTREACHED() overhead for release builds. For Chrome OS release builds, implement a dedicated LogErrorNotReached() function to reduce the number of function calls per NOTREACHED() call site from 5+ to 1 and drop custom messages that are appended to NOTREACHED(). (Release builds on other platforms drop NOTREACHED() altogether, so no changes there.) This change reduces the size of my chromeos=1 executable by 1.7 MB (ca. 1%). BUG=484283 Committed: https://crrev.com/ff3f34ae4fefa2d0ecce5ba338b1afb9505c72d4 Cr-Commit-Position: refs/heads/master@{#331249}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Remove unrelated cleanup. #

Patch Set 3 : Remove function name from log for further size gains. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -2 lines) Patch
M base/logging.h View 1 2 1 chunk +6 lines, -2 lines 0 comments Download
M base/logging.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (4 generated)
Thiemo Nagel
Hi Dana, may I ask you to take a look at this improvement to the ...
5 years, 7 months ago (2015-05-04 17:59:05 UTC) #2
danakj
https://codereview.chromium.org/1124673004/diff/1/base/logging.h File base/logging.h (right): https://codereview.chromium.org/1124673004/diff/1/base/logging.h#newcode657 base/logging.h:657: LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \ This is unrelated, please ...
5 years, 7 months ago (2015-05-04 18:21:46 UTC) #3
danakj
https://codereview.chromium.org/1124673004/diff/1/base/logging.h File base/logging.h (right): https://codereview.chromium.org/1124673004/diff/1/base/logging.h#newcode707 base/logging.h:707: true ? ::logging::LogErrorNotReached(__FILE__, __LINE__, __FUNCTION__) \ what's the point ...
5 years, 7 months ago (2015-05-04 18:27:41 UTC) #4
Thiemo Nagel
Thank you for the review! Could you please take another look? https://codereview.chromium.org/1124673004/diff/1/base/logging.h File base/logging.h (right): ...
5 years, 7 months ago (2015-05-04 19:15:47 UTC) #5
Thiemo Nagel
Hi Dana, may I send a friendly ping about this? Thank you, Thiemo
5 years, 7 months ago (2015-05-18 14:30:24 UTC) #6
danakj
LGTM
5 years, 7 months ago (2015-05-22 20:29:16 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1124673004/40001
5 years, 7 months ago (2015-05-24 07:34:30 UTC) #9
Thiemo Nagel
On 2015/05/22 20:29:16, danakj wrote: > LGTM Thank you!
5 years, 7 months ago (2015-05-24 07:34:30 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 7 months ago (2015-05-24 12:59:26 UTC) #11
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/ff3f34ae4fefa2d0ecce5ba338b1afb9505c72d4 Cr-Commit-Position: refs/heads/master@{#331249}
5 years, 7 months ago (2015-05-24 13:00:27 UTC) #12
Shu Chen
This cl seems causing compiling failures to my local sandbox chrome os build.
5 years, 7 months ago (2015-05-25 08:29:54 UTC) #14
danakj
it passed the cq. what's the error? On May 25, 2015 1:29 AM, <shuchen@chromium.org> wrote: ...
5 years, 7 months ago (2015-05-25 17:21:18 UTC) #15
Shu Chen
On 2015/05/25 17:21:18, danakj wrote: > it passed the cq. what's the error? > On ...
5 years, 7 months ago (2015-05-26 02:57:54 UTC) #16
Thiemo Nagel
On May 25, 2015 1:29 AM, <mailto:shuchen@chromium.org> wrote: > This cl seems causing compiling failures ...
5 years, 7 months ago (2015-05-26 09:05:57 UTC) #17
Nico
Why is this chromeos-specific? It doesn't make sense to me to have platform-specific code in ...
4 years, 6 months ago (2016-05-27 13:32:55 UTC) #19
Thiemo Nagel
On 2016/05/27 13:32:55, Nico (away until Tue May 31) wrote: > Why is this chromeos-specific? ...
4 years, 6 months ago (2016-05-30 09:38:32 UTC) #20
danakj
4 years, 6 months ago (2016-05-31 20:08:53 UTC) #21
Message was sent while issue was closed.
On 2016/05/30 09:38:32, Thiemo Nagel (ooo until 5-23) wrote:
> On 2016/05/27 13:32:55, Nico (away until Tue May 31) wrote:
> > Why is this chromeos-specific? It doesn't make sense to me to have
> > platform-specific code in logging.h.
> 
> Chrome OS is different from all other platforms in that hitting NOTREACHED()
> logs an error message.  I believe that the extra code size was deemed
acceptable
> for Chrome OS but not for other platforms.

IIRC, I think it's because chromeos hits so many DCHECKs/NOTREACHED in practice
that the bots to not build with them enabled. So we have this rather unfortunate
situation where we just print out NOTREACHED and don't crash.

Powered by Google App Engine
This is Rietveld 408576698