Closed
Bug 1049263
Opened 10 years ago
Closed 10 years ago
Improve ccache stats reporting
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla34
People
(Reporter: glandium, Assigned: TYLin, Mentored)
References
Details
(Whiteboard: [good first bug][lang=python])
Attachments
(1 file, 2 obsolete files)
3.63 KB,
patch
|
glandium
:
review+
|
Details | Diff | Splinter Review |
bug 947256 added ccache stats, but it reports the stats whether ccache was used or not. It shouldn't display them unless ccache was used (which can be determined by the difference between the stats at the beginning and the end being 0).
Updated•10 years ago
|
Whiteboard: [good-first-bug][lang=python] → [good first bug][lang=python]
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8469171 -
Flags: review?(mh+mozilla)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → tlin
Reporter | ||
Comment 2•10 years ago
|
||
Comment on attachment 8469171 [details] [diff] [review]
Do not report ccache stats unless ccache was used.
Review of attachment 8469171 [details] [diff] [review]:
-----------------------------------------------------------------
::: python/mozbuild/mozbuild/controller/building.py
@@ +611,5 @@
>
> return '\n'.join(lines)
>
> + def __nonzero__(self):
> + return sum(v for k, v in self._values.items() if k not in self.ABSOLUTE_KEYS) > 0
If a ccache -z is emitted during the build, some numbers are likely to end up being negative, and summing everything may or may not end up being positive, depending on the values. It would be better to check that all values are positive and non zero individually (with all())
Attachment #8469171 -
Flags: review?(mh+mozilla) → feedback+
Assignee | ||
Comment 3•10 years ago
|
||
> If a ccache -z is emitted during the build, some numbers are likely to end
> up being negative, and summing everything may or may not end up being
> positive, depending on the values. It would be better to check that all
> values are positive and non zero individually (with all())
I didn't consider ccache -z is emitted during the build. Thanks!
However, I think check that all values are positive and non-zero is too strict. Some rare cases such as "couldn't find the compiler" may not advance during a normal build. Perhaps we could:
1) Check that all values are non-negative, and
2) At least one of the three values involving hit rate calculation, "cache hit (direct)", "cache hit (preprocessed), and "cache miss", should be positive.
Assignee | ||
Comment 4•10 years ago
|
||
* Improve __nonzero__ to address comments.
* Add negative stats test cases.
Attachment #8469171 -
Attachment is obsolete: true
Attachment #8469883 -
Flags: review?(mh+mozilla)
Reporter | ||
Comment 5•10 years ago
|
||
Comment on attachment 8469883 [details] [diff] [review]
Do not report ccache stats unless ccache was used. (v2)
Review of attachment 8469883 [details] [diff] [review]:
-----------------------------------------------------------------
::: python/mozbuild/mozbuild/controller/building.py
@@ +613,5 @@
>
> + def __nonzero__(self):
> + hit_and_miss_keys = ('cache_hit_direct', 'cache_hit_preprocessed', 'cache_miss')
> + return (all(v >= 0 for v in self._values.values()) and
> + any(self._values[k] > 0 for k in hit_and_miss_keys))
Mmmmm come to think of it, all >= 0 and at least one > 0 might be better. You can end up building only one object, in which case only one of those values is going to be > 0.
Attachment #8469883 -
Flags: review?(mh+mozilla) → feedback+
Assignee | ||
Comment 6•10 years ago
|
||
Check all relative values >=0 and at least one relative values > 0.
Attachment #8469883 -
Attachment is obsolete: true
Attachment #8469932 -
Flags: review?(mh+mozilla)
Reporter | ||
Updated•10 years ago
|
Attachment #8469932 -
Flags: review?(mh+mozilla) → review+
Comment 8•10 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Comment 9•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•