Bug 1248640 - Profiler thread filter should do prefix matching. r=ehsan draft
authorBenoit Girard <b56girard@gmail.com>
Tue, 16 Feb 2016 12:08:36 -0500
changeset 331266 1d20715d882dfd3e780c4f89dcf6192e33be8af0
parent 331265 aa11a30135afa82c515c56c018d98d47dd556c76
child 514347 a2148dc2a42e5bb83ea402687b292949cf1e50c7
push id10948
push userb56girard@gmail.com
push dateTue, 16 Feb 2016 17:08:59 +0000
reviewersehsan
bugs1248640
milestone47.0a1
Bug 1248640 - Profiler thread filter should do prefix matching. r=ehsan MozReview-Commit-ID: zypG2ag17z
tools/profiler/core/GeckoSampler.h
--- a/tools/profiler/core/GeckoSampler.h
+++ b/tools/profiler/core/GeckoSampler.h
@@ -27,18 +27,19 @@ typedef mozilla::Vector<std::string> Fea
 
 static bool
 threadSelected(ThreadInfo* aInfo, const ThreadNameFilterList &aThreadNameFilters) {
   if (aThreadNameFilters.empty()) {
     return true;
   }
 
   for (uint32_t i = 0; i < aThreadNameFilters.length(); ++i) {
-    if (aThreadNameFilters[i] == aInfo->Name()) {
-      return true;
+    if (strncmp(aThreadNameFilters[i].c_str(), aInfo->Name(),
+                aThreadNameFilters[i].size()) == 0) {
+      return false;
     }
   }
 
   return false;
 }
 
 extern mozilla::TimeStamp sLastTracerEvent;
 extern int sFrameNumber;