Bug 1111258 - Let the profiler turn on layout.display-list.dump. r=mstange

This commit is contained in:
Benoit Girard 2014-12-13 15:40:18 -05:00
Родитель 544114ca0f
Коммит e144df0092
3 изменённых файлов: 13 добавлений и 1 удалений

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

@ -1443,7 +1443,7 @@ static bool sDumpPaintList = getenv("MOZ_DUMP_PAINT_LIST") != 0;
/* static */ bool
gfxUtils::DumpPaintList() {
return sDumpPaintList || gfxPrefs::LayoutDumpDisplayList();
return sDumpPaintList || gfxPrefs::LayoutDumpDisplayList() || profiler_feature_active("displaylistdump");
}
bool gfxUtils::sDumpPainting = getenv("MOZ_DUMP_PAINT") != 0;

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

@ -79,6 +79,7 @@ class TableTicker: public Sampler {
mProfileMemory = hasFeature(aFeatures, aFeatureCount, "memory");
mTaskTracer = hasFeature(aFeatures, aFeatureCount, "tasktracer");
mLayersDump = hasFeature(aFeatures, aFeatureCount, "layersdump");
mDisplayListDump = hasFeature(aFeatures, aFeatureCount, "displaylistdump");
#if defined(XP_WIN)
if (mProfilePower) {
@ -210,6 +211,7 @@ class TableTicker: public Sampler {
bool ProfileMemory() const { return mProfileMemory; }
bool TaskTracer() const { return mTaskTracer; }
bool LayersDump() const { return mLayersDump; }
bool DisplayListDump() const { return mDisplayListDump; }
protected:
// Called within a signal. This function must be reentrant
@ -236,6 +238,7 @@ protected:
bool mProfileJava;
bool mProfilePower;
bool mLayersDump;
bool mDisplayListDump;
// Keep the thread filter to check against new thread that
// are started while profiling

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

@ -47,6 +47,7 @@ int sInitCount = 0; // Each init must have a matched shutdown.
static bool sIsProfiling = false; // is raced on
static bool sIsGPUProfiling = false; // is raced on
static bool sIsLayersDump = false; // is raced on
static bool sIsDisplayListDump = false; // is raced on
// env variables to control the profiler
const char* PROFILER_MODE = "MOZ_PROFILER_MODE";
@ -703,6 +704,8 @@ const char** mozilla_sampler_get_features()
"privacy",
// Dump the layer tree with the textures.
"layersdump",
// Dump the display list with the textures.
"displaylistdump",
// Add main thread I/O to the profile
"mainthreadio",
// Add RSS collection
@ -802,6 +805,7 @@ void mozilla_sampler_start(int aProfileEntries, double aInterval,
sIsProfiling = true;
sIsGPUProfiling = t->ProfileGPU();
sIsLayersDump = t->LayersDump();
sIsDisplayListDump = t->DisplayListDump();
if (Sampler::CanNotifyObservers()) {
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
@ -873,6 +877,7 @@ void mozilla_sampler_stop()
sIsProfiling = false;
sIsGPUProfiling = false;
sIsLayersDump = false;
sIsDisplayListDump = false;
if (Sampler::CanNotifyObservers()) {
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
@ -917,6 +922,10 @@ bool mozilla_sampler_feature_active(const char* aName)
return sIsLayersDump;
}
if (strcmp(aName, "displaylistdump") == 0) {
return sIsDisplayListDump;
}
return false;
}