Bug 1369276 (part 1) - Fix category handling in AddPseudoEntry. r=shu.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 31 May 2017 15:03:55 +1000
changeset 410364 70e36d9d546e22b44ec55eb5906987d95bfcbcc7
parent 410363 5dd5d16e708558e464ef335c67defdf41838cea8
child 410365 8726e36dafe1c875d86b33b5885f6b9e6d1a5a12
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1369276
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1369276 (part 1) - Fix category handling in AddPseudoEntry. r=shu. The category handling code at the end of AddPseudoEntry has two problems. - The assertion checks |category| for the IS_CPP_ENTRY flag. This represents a confusion between the entry's |category| and its |flags|. They're both stored in a single uint32_t, but are conceptually different types. So the assertion is vacuously satisfied. Furthermore, there's no clear way to fix the assertion -- it doesn't make sense to check the entry's flags for IS_CPP_ENTRY, because this code can clearly take C++ or JS entries. So the patch just removes the assertion. - The category is compared to zero. This also doesn't make sense, because zero isn't a valid category. The patch removes this comparison.
tools/profiler/core/platform.cpp
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -792,22 +792,17 @@ AddPseudoEntry(PSLockRef aLock, ProfileB
       lineno = entry.line();
     }
   }
 
   if (lineno != -1) {
     aBuffer->addTag(ProfileBufferEntry::LineNumber(lineno));
   }
 
-  uint32_t category = entry.category();
-  MOZ_ASSERT(!(category & js::ProfileEntry::IS_CPP_ENTRY));
-
-  if (category) {
-    aBuffer->addTag(ProfileBufferEntry::Category((int)category));
-  }
+  aBuffer->addTag(ProfileBufferEntry::Category(entry.category()));
 }
 
 struct NativeStack
 {
   void** pc_array;
   void** sp_array;
   size_t size;
   size_t count;