зеркало из https://github.com/mozilla/gecko-dev.git
Bug 686805 part 7 - Display linker stats on each Startup Timeline event. r=tglek,r=khuey
This commit is contained in:
Родитель
8c5b3643ce
Коммит
4221a257f2
|
@ -2925,6 +2925,9 @@ ia64*-hpux*)
|
|||
esac
|
||||
|
||||
AC_SUBST(MOZ_LINKER)
|
||||
if test -n "$MOZ_LINKER"; then
|
||||
AC_DEFINE(MOZ_LINKER)
|
||||
fi
|
||||
AC_SUBST(MOZ_ENABLE_SZIP)
|
||||
|
||||
dnl Only one oddball right now (QNX), but this gives us flexibility
|
||||
|
|
|
@ -51,7 +51,6 @@ CSRCS =
|
|||
ifdef MOZ_OLD_LINKER
|
||||
DEFINES += \
|
||||
-DLINKER_DEBUG=0 \
|
||||
-DMOZ_LINKER \
|
||||
-DLINKER_TEXT_BASE=0xB0001000 \
|
||||
-DLINKER_AREA_SIZE=0x01000000 \
|
||||
$(NULL)
|
||||
|
|
|
@ -52,6 +52,18 @@ mozilla_StartupTimeline_Event(FIRST_LOAD_URI, "firstLoadURI")
|
|||
#include "prtime.h"
|
||||
#include "nscore.h"
|
||||
|
||||
#ifdef MOZ_LINKER
|
||||
extern "C" {
|
||||
/* This symbol is resolved by the custom linker. The function it resolves
|
||||
* to dumps some statistics about the linker at the key events recorded
|
||||
* by the startup timeline. */
|
||||
extern void __moz_linker_stats(const char *str)
|
||||
NS_VISIBILITY_DEFAULT __attribute__((weak));
|
||||
} /* extern "C" */
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class StartupTimeline {
|
||||
|
@ -73,11 +85,15 @@ public:
|
|||
|
||||
static void Record(Event ev, PRTime when = PR_Now()) {
|
||||
sStartupTimeline[ev] = when;
|
||||
#ifdef MOZ_LINKER
|
||||
if (__moz_linker_stats)
|
||||
__moz_linker_stats(Describe(ev));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void RecordOnce(Event ev) {
|
||||
if (!HasRecord(ev))
|
||||
sStartupTimeline[ev] = PR_Now();
|
||||
Record(ev);
|
||||
}
|
||||
|
||||
static bool HasRecord(Event ev) {
|
||||
|
|
|
@ -53,12 +53,6 @@ LOCAL_INCLUDES = \
|
|||
-I$(srcdir)/../../build \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_LINKER
|
||||
ifeq ($(OS_TARGET),Linux)
|
||||
DEFINES += -DMOZ_LINKER
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (Darwin,$(OS_ARCH))
|
||||
ifeq (uikit,$(MOZ_WIDGET_TOOLKIT))
|
||||
LINKSRC = nsGlueLinkingDlopen.cpp
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
#define LEADING_UNDERSCORE
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_LINKER
|
||||
#if defined(MOZ_LINKER) && !defined(ANDROID)
|
||||
extern "C" {
|
||||
NS_HIDDEN __typeof(dlopen) __wrap_dlopen;
|
||||
NS_HIDDEN __typeof(dlsym) __wrap_dlsym;
|
||||
|
|
Загрузка…
Ссылка в новой задаче