summaryrefslogtreecommitdiffstats
path: root/tools/profiler/core
diff options
context:
space:
mode:
Diffstat (limited to 'tools/profiler/core')
-rw-r--r--tools/profiler/core/GeckoSampler.cpp8
-rw-r--r--tools/profiler/core/platform.cpp21
-rw-r--r--tools/profiler/core/platform.h5
-rw-r--r--tools/profiler/core/shared-libraries-linux.cc18
4 files changed, 13 insertions, 39 deletions
diff --git a/tools/profiler/core/GeckoSampler.cpp b/tools/profiler/core/GeckoSampler.cpp
index f4249a7a5..4283542f6 100644
--- a/tools/profiler/core/GeckoSampler.cpp
+++ b/tools/profiler/core/GeckoSampler.cpp
@@ -44,7 +44,7 @@
#include "mozilla/ProfileGatherer.h"
#endif
-#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+#if defined(SPS_OS_android)
#include "FennecJNIWrappers.h"
#endif
@@ -213,7 +213,7 @@ GeckoSampler::GeckoSampler(double aInterval, int aEntrySize,
}
#endif
-#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+#if defined(SPS_OS_android)
mProfileJava = mozilla::jni::IsFennec() &&
hasFeature(aFeatures, aFeatureCount, "java");
#else
@@ -462,7 +462,7 @@ void SubProcessCallback(const char* aProfile, void* aClosure)
}
-#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+#if defined(SPS_OS_android)
static
void BuildJavaThreadJSObject(SpliceableJSONWriter& aWriter)
{
@@ -567,7 +567,7 @@ void GeckoSampler::StreamJSON(SpliceableJSONWriter& aWriter, double aSinceTime)
}
}
- #if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+ #if defined(SPS_OS_android)
if (ProfileJava()) {
java::GeckoJavaSampler::Pause();
diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp
index 0d3cb1648..a8a09d66f 100644
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -36,11 +36,11 @@
#include "GeckoTaskTracer.h"
#endif
-#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+#if defined(SPS_OS_android)
#include "FennecJNIWrappers.h"
#endif
-#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+#if defined(SPS_OS_android)
#include "FennecJNINatives.h"
#endif
@@ -52,7 +52,7 @@
#endif
#endif
-#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+#if defined(SPS_OS_android)
class GeckoJavaSampler : public java::GeckoJavaSampler::Natives<GeckoJavaSampler>
{
private:
@@ -502,7 +502,7 @@ void mozilla_sampler_init(void* stackTop)
set_stderr_callback(mozilla_sampler_log);
#endif
-#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+#if defined(SPS_OS_android)
if (mozilla::jni::IsFennec()) {
GeckoJavaSampler::Init();
}
@@ -524,7 +524,7 @@ void mozilla_sampler_init(void* stackTop)
|| defined(SPS_PLAT_amd64_linux) || defined(SPS_PLAT_x86_linux)
, "stackwalk"
#endif
-#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+#if defined(SPS_OS_android)
, "java"
#endif
};
@@ -819,7 +819,7 @@ void mozilla_sampler_start(int aProfileEntries, double aInterval,
}
}
-#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+#if defined(SPS_OS_android)
if (t->ProfileJava()) {
int javaInterval = aInterval;
// Java sampling doesn't accuratly keep up with 1ms sampling
@@ -1021,15 +1021,6 @@ bool mozilla_sampler_register_thread(const char* aName, void* aGuessStackTop)
return false;
}
-#if defined(MOZ_WIDGET_GONK) && !defined(MOZ_PROFILING)
- // The only way to profile secondary threads on b2g
- // is to build with profiling OR have the profiler
- // running on startup.
- if (!profiler_is_active()) {
- return false;
- }
-#endif
-
MOZ_ASSERT(tlsPseudoStack.get() == nullptr);
PseudoStack* stack = PseudoStack::create();
tlsPseudoStack.set(stack);
diff --git a/tools/profiler/core/platform.h b/tools/profiler/core/platform.h
index 2e736d97c..17c8dd25c 100644
--- a/tools/profiler/core/platform.h
+++ b/tools/profiler/core/platform.h
@@ -393,10 +393,7 @@ class Sampler {
static mozilla::UniquePtr<Mutex> sRegisteredThreadsMutex;
static bool CanNotifyObservers() {
-#ifdef MOZ_WIDGET_GONK
- // We use profile.sh on b2g to manually select threads and options per process.
- return false;
-#elif defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
+#if defined(SPS_OS_android)
// Android ANR reporter uses the profiler off the main thread
return NS_IsMainThread();
#else
diff --git a/tools/profiler/core/shared-libraries-linux.cc b/tools/profiler/core/shared-libraries-linux.cc
index 24437fb4e..553039fb7 100644
--- a/tools/profiler/core/shared-libraries-linux.cc
+++ b/tools/profiler/core/shared-libraries-linux.cc
@@ -37,7 +37,6 @@ static std::string getId(const char *bin_name)
return "";
}
-#if !defined(MOZ_WIDGET_GONK)
// TODO fix me with proper include
#include "nsDebug.h"
#ifdef ANDROID
@@ -86,13 +85,10 @@ dl_iterate_callback(struct dl_phdr_info *dl_info, size_t size, void *data)
return 0;
}
-#endif // !MOZ_WIDGET_GONK
-
SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
{
SharedLibraryInfo info;
-#if !defined(MOZ_WIDGET_GONK)
#ifdef ANDROID
if (!dl_iterate_phdr) {
// On ARM Android, dl_iterate_phdr is provided by the custom linker.
@@ -104,9 +100,8 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
#endif // ANDROID
dl_iterate_phdr(dl_iterate_callback, &info);
-#endif // !MOZ_WIDGET_GONK
-#if defined(ANDROID) || defined(MOZ_WIDGET_GONK)
+#if defined(ANDROID)
pid_t pid = getpid();
char path[PATH_MAX];
snprintf(path, PATH_MAX, "/proc/%d/maps", pid);
@@ -132,19 +127,10 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
LOG("Get maps line failed");
continue;
}
-#if defined(ANDROID) && !defined(MOZ_WIDGET_GONK)
// Use proc/pid/maps to get the dalvik-jit section since it has
// no associated phdrs
if (strcmp(name, "/dev/ashmem/dalvik-jit-code-cache") != 0)
continue;
-#else
- if (strcmp(perm, "r-xp") != 0) {
- // Ignore entries that are writable and/or shared.
- // At least one graphics driver uses short-lived "rwxs" mappings
- // (see bug 926734 comment 5), so just checking for 'x' isn't enough.
- continue;
- }
-#endif
SharedLibrary shlib(start, end, offset, getId(name), name);
info.AddSharedLibrary(shlib);
if (count > 10000) {
@@ -153,7 +139,7 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
}
count++;
}
-#endif // ANDROID || MOZ_WIDGET_GONK
+#endif // ANDROID
return info;
}