Bug 1360471 (part 4) - Use a bitfield to represent profiler features. r=mstange.

Currently the profiler mostly uses an array of strings to represent which
features are available and in use. This patch changes the profiler core to use
a uint32_t bitfield, which is a much simpler and faster representation.
(nsProfiler and the profiler add-on still use the array of strings, alas.) The
new ProfilerFeature type defines the values in the bitfield.

One side-effect of this change is that profiler_feature_active() now can be
used to query all features. Previously it was just a subset.

Another side-effect is that profiler_get_available_features() no longer incorrectly
indicates support for Java and stack-walking when they aren't supported. (The
handling of task tracer support is unchanged, because the old code handled it
correctly.)
This commit is contained in:
Nicholas Nethercote
2017-05-01 14:23:34 +10:00
parent da42e4205e
commit a7e5660c91
23 changed files with 300 additions and 343 deletions

View File

@@ -1359,7 +1359,8 @@ TextureClient::PrintInfo(std::stringstream& aStream, const char* aPrefix)
AppendToString(aStream, mFlags, " [flags=", "]");
#ifdef MOZ_DUMP_PAINTING
if (gfxPrefs::LayersDumpTexture() || profiler_feature_active("layersdump")) {
if (gfxPrefs::LayersDumpTexture() ||
profiler_feature_active(ProfilerFeature::LayersDump)) {
nsAutoCString pfx(aPrefix);
pfx += " ";