Bug 1421195 - Add weighted telemetry probes for parallel restyles ; r=emilio

MozReview-Commit-ID: sVN7CWjgni
This commit is contained in:
Manish Goregaokar 2017-11-28 14:42:59 -08:00
Родитель b92ab8df04
Коммит f87b01d03b
4 изменённых файлов: 45 добавлений и 3 удалений

Просмотреть файл

@ -125,13 +125,26 @@ AssertIsMainThreadOrServoLangFontPrefsCacheLocked()
void
Gecko_RecordTraversalStatistics(uint32_t total, uint32_t parallel)
Gecko_RecordTraversalStatistics(uint32_t total, uint32_t parallel,
uint32_t total_t, uint32_t parallel_t,
uint32_t total_s, uint32_t parallel_s)
{
#ifdef NIGHTLY_BUILD
// we ignore cases where a page just didn't restyle a lot
if (total > 30) {
uint32_t percent = parallel * 100 / total;
Telemetry::Accumulate(Telemetry::STYLO_PARALLEL_RESTYLE_FRACTION, percent);
}
if (total_t > 0) {
uint32_t percent = parallel_t * 100 / total_t;
Telemetry::Accumulate(Telemetry::STYLO_PARALLEL_RESTYLE_FRACTION_WEIGHTED_TRAVERSED, percent);
}
if (total_s > 0) {
uint32_t percent = parallel_s * 100 / total_s;
Telemetry::Accumulate(Telemetry::STYLO_PARALLEL_RESTYLE_FRACTION_WEIGHTED_STYLED, percent);
}
#endif
}
bool

Просмотреть файл

@ -75,6 +75,12 @@ class nsStyleCoord;
struct nsStyleDisplay;
class nsXBLBinding;
#ifdef NIGHTLY_BUILD
const bool GECKO_IS_NIGHTLY = true;
#else
const bool GECKO_IS_NIGHTLY = false;
#endif
namespace mozilla {
#define STYLE_STRUCT(name_, checkdata_cb_) struct Gecko##name_ {nsStyle##name_ gecko;};
#include "nsStyleStructList.h"
@ -142,7 +148,9 @@ struct FontSizePrefs
};
// DOM Traversal.
void Gecko_RecordTraversalStatistics(uint32_t total, uint32_t parallel);
void Gecko_RecordTraversalStatistics(uint32_t total, uint32_t parallel,
uint32_t total_t, uint32_t parallel_t,
uint32_t total_s, uint32_t parallel_s);
bool Gecko_IsInDocument(RawGeckoNodeBorrowed node);
bool Gecko_FlattenedTreeParentIsParent(RawGeckoNodeBorrowed node);
bool Gecko_IsSignificantChild(RawGeckoNodeBorrowed node,

Просмотреть файл

@ -211,6 +211,7 @@ whitelist-vars = [
"kGenericFont_.*",
"kPresContext_.*",
"nsContentUtils_.*",
"GECKO_IS_NIGHTLY",
]
whitelist-types = [
"RawGecko.*",

Просмотреть файл

@ -13939,7 +13939,27 @@
"kind": "linear",
"high": 100,
"n_buckets": 50,
"description": "Fraction of restyles on a single page that were parallel",
"description": "Percentage of restyles on a single page that were parallel",
"bug_numbers": [1421195]
},
"STYLO_PARALLEL_RESTYLE_FRACTION_WEIGHTED_TRAVERSED": {
"record_in_processes": ["content"],
"alert_emails": ["manish@mozilla.com"],
"expires_in_version": "60",
"kind": "linear",
"high": 100,
"n_buckets": 50,
"description": "Percentage of restyles on a single page that were parallel, weighted by elements traversed",
"bug_numbers": [1421195]
},
"STYLO_PARALLEL_RESTYLE_FRACTION_WEIGHTED_STYLED": {
"record_in_processes": ["content"],
"alert_emails": ["manish@mozilla.com"],
"expires_in_version": "60",
"kind": "linear",
"high": 100,
"n_buckets": 50,
"description": "Percentage of restyles on a single page that were parallel, weighted by elements styled",
"bug_numbers": [1421195]
}
}