mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 686805 part 7 - Display linker stats on each Startup Timeline event. r=tglek,r=khuey
This commit is contained in:
parent
1e0e261382
commit
99e3690cd6
@ -2925,6 +2925,9 @@ ia64*-hpux*)
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
AC_SUBST(MOZ_LINKER)
|
AC_SUBST(MOZ_LINKER)
|
||||||
|
if test -n "$MOZ_LINKER"; then
|
||||||
|
AC_DEFINE(MOZ_LINKER)
|
||||||
|
fi
|
||||||
AC_SUBST(MOZ_ENABLE_SZIP)
|
AC_SUBST(MOZ_ENABLE_SZIP)
|
||||||
|
|
||||||
dnl Only one oddball right now (QNX), but this gives us flexibility
|
dnl Only one oddball right now (QNX), but this gives us flexibility
|
||||||
|
@ -51,7 +51,6 @@ CSRCS =
|
|||||||
ifdef MOZ_OLD_LINKER
|
ifdef MOZ_OLD_LINKER
|
||||||
DEFINES += \
|
DEFINES += \
|
||||||
-DLINKER_DEBUG=0 \
|
-DLINKER_DEBUG=0 \
|
||||||
-DMOZ_LINKER \
|
|
||||||
-DLINKER_TEXT_BASE=0xB0001000 \
|
-DLINKER_TEXT_BASE=0xB0001000 \
|
||||||
-DLINKER_AREA_SIZE=0x01000000 \
|
-DLINKER_AREA_SIZE=0x01000000 \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
@ -52,6 +52,18 @@ mozilla_StartupTimeline_Event(FIRST_LOAD_URI, "firstLoadURI")
|
|||||||
#include "prtime.h"
|
#include "prtime.h"
|
||||||
#include "nscore.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 {
|
namespace mozilla {
|
||||||
|
|
||||||
class StartupTimeline {
|
class StartupTimeline {
|
||||||
@ -73,11 +85,15 @@ public:
|
|||||||
|
|
||||||
static void Record(Event ev, PRTime when = PR_Now()) {
|
static void Record(Event ev, PRTime when = PR_Now()) {
|
||||||
sStartupTimeline[ev] = when;
|
sStartupTimeline[ev] = when;
|
||||||
|
#ifdef MOZ_LINKER
|
||||||
|
if (__moz_linker_stats)
|
||||||
|
__moz_linker_stats(Describe(ev));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RecordOnce(Event ev) {
|
static void RecordOnce(Event ev) {
|
||||||
if (!HasRecord(ev))
|
if (!HasRecord(ev))
|
||||||
sStartupTimeline[ev] = PR_Now();
|
Record(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool HasRecord(Event ev) {
|
static bool HasRecord(Event ev) {
|
||||||
|
@ -53,12 +53,6 @@ LOCAL_INCLUDES = \
|
|||||||
-I$(srcdir)/../../build \
|
-I$(srcdir)/../../build \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifdef MOZ_LINKER
|
|
||||||
ifeq ($(OS_TARGET),Linux)
|
|
||||||
DEFINES += -DMOZ_LINKER
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq (Darwin,$(OS_ARCH))
|
ifeq (Darwin,$(OS_ARCH))
|
||||||
ifeq (uikit,$(MOZ_WIDGET_TOOLKIT))
|
ifeq (uikit,$(MOZ_WIDGET_TOOLKIT))
|
||||||
LINKSRC = nsGlueLinkingDlopen.cpp
|
LINKSRC = nsGlueLinkingDlopen.cpp
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
#define LEADING_UNDERSCORE
|
#define LEADING_UNDERSCORE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_LINKER
|
#if defined(MOZ_LINKER) && !defined(ANDROID)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
NS_HIDDEN __typeof(dlopen) __wrap_dlopen;
|
NS_HIDDEN __typeof(dlopen) __wrap_dlopen;
|
||||||
NS_HIDDEN __typeof(dlsym) __wrap_dlsym;
|
NS_HIDDEN __typeof(dlsym) __wrap_dlsym;
|
||||||
|
Loading…
Reference in New Issue
Block a user