mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 579571 - Remove --enable-timeline support. r=tglek
This commit is contained in:
parent
7d3e811adb
commit
55aebc79d4
@ -209,7 +209,6 @@ MOZ_FIX_LINK_PATHS=@MOZ_FIX_LINK_PATHS@
|
||||
XPCOM_FROZEN_LDOPTS=@XPCOM_FROZEN_LDOPTS@
|
||||
XPCOM_LIBS=@XPCOM_LIBS@
|
||||
LIBXUL_LIBS=@LIBXUL_LIBS@
|
||||
MOZ_TIMELINE=@MOZ_TIMELINE@
|
||||
|
||||
ENABLE_STRIP = @ENABLE_STRIP@
|
||||
PKG_SKIP_STRIP = @PKG_SKIP_STRIP@
|
||||
|
15
configure.in
15
configure.in
@ -4817,7 +4817,6 @@ MOZ_SPELLCHECK=1
|
||||
MOZ_SPLASHSCREEN=
|
||||
MOZ_STORAGE=1
|
||||
MOZ_SVG_DLISTS=
|
||||
MOZ_TIMELINE=
|
||||
MOZ_TOOLKIT_SEARCH=1
|
||||
MOZ_UI_LOCALE=en-US
|
||||
MOZ_UNIVERSALCHARDET=1
|
||||
@ -7748,19 +7747,6 @@ dnl =
|
||||
dnl ========================================================
|
||||
MOZ_ARG_HEADER(Profiling and Instrumenting)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Enable timeline service, which provides lightweight
|
||||
dnl = instrumentation of mozilla for performance measurement.
|
||||
dnl = Timeline is off by default.
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(timeline,
|
||||
[ --enable-timeline Enable timeline services ],
|
||||
MOZ_TIMELINE=1,
|
||||
MOZ_TIMELINE= )
|
||||
if test -n "$MOZ_TIMELINE"; then
|
||||
AC_DEFINE(MOZ_TIMELINE)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Enable NS_FUNCTION_TIMER, which provides Function
|
||||
dnl = timing for identifying code bottlenecks
|
||||
@ -8979,7 +8965,6 @@ AC_SUBST(MOZ_OS2_TOOLS)
|
||||
|
||||
AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
|
||||
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
|
||||
AC_SUBST(MOZ_TIMELINE)
|
||||
|
||||
# The following variables are available to branding and application
|
||||
# configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
|
||||
|
@ -138,7 +138,6 @@
|
||||
#include "nsIDOMXULDocument.h"
|
||||
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsNodeInfoManager.h"
|
||||
#include "nsXBLBinding.h"
|
||||
@ -3002,7 +3001,6 @@ nsXULPrototypeScript::Deserialize(nsIObjectInputStream* aStream,
|
||||
nsIURI* aDocumentURI,
|
||||
const nsCOMArray<nsINodeInfo> *aNodeInfos)
|
||||
{
|
||||
NS_TIMELINE_MARK_FUNCTION("chrome script deserialize");
|
||||
nsresult rv;
|
||||
|
||||
NS_ASSERTION(!mSrcLoading || mSrcLoadWaiters != nsnull ||
|
||||
|
@ -93,7 +93,6 @@
|
||||
#include "nsIArray.h"
|
||||
#include "nsIObjectInputStream.h"
|
||||
#include "nsIObjectOutputStream.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsDOMScriptObjectHolder.h"
|
||||
#include "prmem.h"
|
||||
#include "WrapperFactory.h"
|
||||
@ -2100,8 +2099,6 @@ nsJSContext::Deserialize(nsIObjectInputStream* aStream,
|
||||
|
||||
NS_TIME_FUNCTION_MIN(1.0);
|
||||
|
||||
NS_TIMELINE_MARK_FUNCTION("js script deserialize");
|
||||
|
||||
PRUint32 size;
|
||||
rv = aStream->Read32(&size);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -2273,18 +2273,12 @@ nsresult nsPluginHost::LoadPlugins()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
// if aCreatePluginList is false we will just scan for plugins
|
||||
// and see if any changes have been made to the plugins.
|
||||
// This is needed in ReloadPlugins to prevent possible recursive reloads
|
||||
nsresult nsPluginHost::FindPlugins(PRBool aCreatePluginList, PRBool * aPluginsChanged)
|
||||
{
|
||||
Telemetry::AutoTimer<Telemetry::FIND_PLUGINS> telemetry;
|
||||
// let's start timing if we are only really creating the plugin list
|
||||
if (aCreatePluginList) {
|
||||
NS_TIMELINE_START_TIMER("LoadPlugins");
|
||||
}
|
||||
|
||||
#ifdef CALL_SAFETY_ON
|
||||
// check preferences on whether or not we want to try safe calls to plugins
|
||||
@ -2459,9 +2453,6 @@ nsresult nsPluginHost::FindPlugins(PRBool aCreatePluginList, PRBool * aPluginsCh
|
||||
NS_ITERATIVE_UNREF_LIST(nsRefPtr<nsPluginTag>, mCachedPlugins, mNext);
|
||||
NS_ITERATIVE_UNREF_LIST(nsRefPtr<nsInvalidPluginTag>, mInvalidPlugins, mNext);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("LoadPlugins");
|
||||
NS_TIMELINE_MARK_TIMER("LoadPlugins");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,6 @@
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsFind.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "nsFocusManager.h"
|
||||
|
@ -45,7 +45,6 @@
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsUConvPropertySearch.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsCharsetAlias.h"
|
||||
|
||||
//--------------------------------------------------------------
|
||||
@ -71,16 +70,12 @@ NS_IMETHODIMP nsCharsetAlias2::GetPreferred(const nsACString& aAlias,
|
||||
{
|
||||
if (aAlias.IsEmpty()) return NS_ERROR_NULL_POINTER;
|
||||
|
||||
NS_TIMELINE_START_TIMER("nsCharsetAlias2:GetPreferred");
|
||||
|
||||
nsCAutoString key(aAlias);
|
||||
ToLowerCase(key);
|
||||
|
||||
nsresult rv = nsUConvPropertySearch::SearchPropertyValue(kAliases,
|
||||
NS_ARRAY_LENGTH(kAliases), key, oResult);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetAlias2:GetPreferred");
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsLocaleCID.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsPlatformCharset.h"
|
||||
|
||||
static const char* kOS2Charsets[][3] = {
|
||||
@ -59,17 +58,13 @@ NS_IMPL_ISUPPORTS1(nsPlatformCharset, nsIPlatformCharset)
|
||||
|
||||
nsPlatformCharset::nsPlatformCharset()
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsPlatformCharset()");
|
||||
|
||||
UINT acp = ::WinQueryCp(HMQ_CURRENT);
|
||||
PRInt32 acpint = (PRInt32)(acp & 0x00FFFF);
|
||||
nsAutoString acpKey(NS_LITERAL_STRING("os2."));
|
||||
acpKey.AppendInt(acpint, 10);
|
||||
nsresult res = MapToCharset(acpKey, mCharset);
|
||||
}
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsPlatformCharset()");
|
||||
NS_TIMELINE_MARK_TIMER("nsPlatformCharset()");
|
||||
}
|
||||
nsPlatformCharset::~nsPlatformCharset()
|
||||
{
|
||||
}
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsLocaleCID.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsPlatformCharset.h"
|
||||
#include "nsEncoderDecoderUtils.h"
|
||||
|
||||
@ -56,14 +55,9 @@ NS_IMPL_ISUPPORTS1(nsPlatformCharset, nsIPlatformCharset)
|
||||
|
||||
nsPlatformCharset::nsPlatformCharset()
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsPlatformCharset()");
|
||||
|
||||
nsAutoString acpKey(NS_LITERAL_STRING("acp."));
|
||||
acpKey.AppendInt(PRInt32(::GetACP() & 0x00FFFF), 10);
|
||||
MapToCharset(acpKey, mCharset);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsPlatformCharset()");
|
||||
NS_TIMELINE_MARK_TIMER("nsPlatformCharset()");
|
||||
}
|
||||
|
||||
nsPlatformCharset::~nsPlatformCharset()
|
||||
|
@ -61,7 +61,6 @@
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsTextFormatter.h"
|
||||
#include "nsIErrorService.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsICategoryManager.h"
|
||||
|
||||
#include "nsPrintfCString.h"
|
||||
@ -128,8 +127,6 @@ nsStringBundle::LoadProperties()
|
||||
rv = channel->Open(getter_AddRefs(in));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
NS_TIMELINE_MARK_FUNCTION("loading properties");
|
||||
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv) && in, "Error in OpenBlockingStream");
|
||||
NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && in, NS_ERROR_FAILURE);
|
||||
|
||||
|
@ -115,7 +115,6 @@ MOZ_FIX_LINK_PATHS=@MOZ_FIX_LINK_PATHS@
|
||||
|
||||
XPCOM_FROZEN_LDOPTS=@XPCOM_FROZEN_LDOPTS@
|
||||
XPCOM_LIBS=@XPCOM_LIBS@
|
||||
MOZ_TIMELINE=@MOZ_TIMELINE@
|
||||
|
||||
ENABLE_STRIP = @ENABLE_STRIP@
|
||||
PKG_SKIP_STRIP = @PKG_SKIP_STRIP@
|
||||
|
@ -5128,19 +5128,6 @@ dnl =
|
||||
dnl ========================================================
|
||||
MOZ_ARG_HEADER(Profiling and Instrumenting)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Enable timeline service, which provides lightweight
|
||||
dnl = instrumentation of mozilla for performance measurement.
|
||||
dnl = Timeline is off by default.
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(timeline,
|
||||
[ --enable-timeline Enable timeline services ],
|
||||
MOZ_TIMELINE=1,
|
||||
MOZ_TIMELINE= )
|
||||
if test -n "$MOZ_TIMELINE"; then
|
||||
AC_DEFINE(MOZ_TIMELINE)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Support for Quantify (Windows)
|
||||
dnl ========================================================
|
||||
@ -5677,7 +5664,6 @@ AC_SUBST(MOZ_OS2_TOOLS)
|
||||
|
||||
AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
|
||||
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
|
||||
AC_SUBST(MOZ_TIMELINE)
|
||||
|
||||
AC_SUBST(MOZ_APP_NAME)
|
||||
AC_SUBST(MOZ_APP_DISPLAYNAME)
|
||||
|
@ -122,7 +122,6 @@
|
||||
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsGfxCIID.h"
|
||||
#include "nsStyleSheetService.h"
|
||||
#include "nsURILoader.h"
|
||||
@ -1068,22 +1067,6 @@ DocumentViewerImpl::LoadComplete(nsresult aStatus)
|
||||
if (timing) {
|
||||
timing->NotifyLoadEventEnd();
|
||||
}
|
||||
#ifdef MOZ_TIMELINE
|
||||
// if navigator.xul's load is complete, the main nav window is visible
|
||||
// mark that point.
|
||||
|
||||
nsIURI *uri = mDocument ? mDocument->GetDocumentURI() : nsnull;
|
||||
|
||||
if (uri) {
|
||||
//printf("DEBUG: getting spec for uri (%p)\n", uri.get());
|
||||
nsCAutoString spec;
|
||||
uri->GetSpec(spec);
|
||||
if (spec.EqualsLiteral("chrome://navigator/content/navigator.xul") ||
|
||||
spec.EqualsLiteral("chrome://browser/content/browser.xul")) {
|
||||
NS_TIMELINE_MARK("Navigator Window visible now");
|
||||
}
|
||||
}
|
||||
#endif /* MOZ_TIMELINE */
|
||||
}
|
||||
} else {
|
||||
// XXX: Should fire error event to the document...
|
||||
|
@ -39,7 +39,6 @@
|
||||
|
||||
// Timer Includes
|
||||
#include "nsITimer.h"
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
#include "nsIDocumentViewerPrint.h"
|
||||
#include "nsPrintObject.h"
|
||||
|
@ -69,7 +69,6 @@
|
||||
#include "nsCRT.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsContentPolicyUtils.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsMimeTypes.h"
|
||||
@ -816,11 +815,6 @@ SheetLoadData::OnStreamComplete(nsIUnicharStreamLoader* aLoader,
|
||||
|
||||
mSheet->SetPrincipal(principal);
|
||||
|
||||
#ifdef MOZ_TIMELINE
|
||||
NS_TIMELINE_OUTDENT();
|
||||
NS_TIMELINE_MARK_CHANNEL("SheetLoadData::OnStreamComplete(%s)", channel);
|
||||
#endif // MOZ_TIMELINE
|
||||
|
||||
// If it's an HTTP channel, we want to make sure this is not an
|
||||
// error document we got.
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
|
||||
@ -1441,11 +1435,6 @@ Loader::LoadSheet(SheetLoadData* aLoadData, StyleSheetState aSheetState)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MOZ_TIMELINE
|
||||
NS_TIMELINE_MARK_URI("Loading style sheet: %s", aLoadData->mURI);
|
||||
NS_TIMELINE_INDENT();
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
rv = NS_NewChannel(getter_AddRefs(channel),
|
||||
aLoadData->mURI, nsnull, loadGroup, nsnull,
|
||||
|
@ -90,7 +90,6 @@
|
||||
#include "nsTreeUtils.h"
|
||||
#include "nsChildIterator.h"
|
||||
#include "nsITheme.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "imgIRequest.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "imgIContainerObserver.h"
|
||||
@ -3616,9 +3615,6 @@ nsTreeBodyFrame::PaintText(PRInt32 aRowIndex,
|
||||
fontMet->GetStrikeout(offset, size);
|
||||
aRenderingContext.FillRect(textRect.x, textRect.y + baseline - offset, textRect.width, size);
|
||||
}
|
||||
#ifdef MOZ_TIMELINE
|
||||
NS_TIMELINE_START_TIMER("Render Outline Text");
|
||||
#endif
|
||||
PRUint8 direction = aTextRTL ? NS_STYLE_DIRECTION_RTL :
|
||||
NS_STYLE_DIRECTION_LTR;
|
||||
|
||||
@ -3635,10 +3631,6 @@ nsTreeBodyFrame::PaintText(PRInt32 aRowIndex,
|
||||
ctx->Paint(opacity);
|
||||
}
|
||||
|
||||
#ifdef MOZ_TIMELINE
|
||||
NS_TIMELINE_STOP_TIMER("Render Outline Text");
|
||||
NS_TIMELINE_MARK_TIMER("Render Outline Text");
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -68,8 +68,6 @@
|
||||
#include "prefapi_private_data.h"
|
||||
#include "PrefTuple.h"
|
||||
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
#include "mozilla/Omnijar.h"
|
||||
#include "nsZipArchive.h"
|
||||
|
||||
@ -811,14 +809,6 @@ static nsresult openPrefFile(nsIFile* aFile)
|
||||
{
|
||||
nsCOMPtr<nsIInputStream> inStr;
|
||||
|
||||
#if MOZ_TIMELINE
|
||||
{
|
||||
nsCAutoString str;
|
||||
aFile->GetNativePath(str);
|
||||
NS_TIMELINE_MARK_FUNCTION1("load pref file", str.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), aFile);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
@ -61,7 +61,6 @@
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsIProxiedProtocolHandler.h"
|
||||
#include "nsIProxyInfo.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsIRecyclingAllocator.h"
|
||||
@ -605,7 +604,6 @@ nsIOService::NewChannelFromURIWithProxyFlags(nsIURI *aURI,
|
||||
{
|
||||
nsresult rv;
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
NS_TIMELINE_MARK_URI("nsIOService::NewChannelFromURI(%s)", aURI);
|
||||
|
||||
nsCAutoString scheme;
|
||||
rv = aURI->GetScheme(scheme);
|
||||
|
@ -893,8 +893,6 @@ RDFXMLDataSourceImpl::SetReadOnly(PRBool aIsReadOnly)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
// nsIChannelEventSink
|
||||
|
||||
// This code is copied from nsSameOriginChecker::OnChannelRedirect. See
|
||||
@ -971,10 +969,7 @@ RDFXMLDataSourceImpl::Refresh(PRBool aBlocking)
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (aBlocking) {
|
||||
NS_TIMELINE_START_TIMER("rdf blocking parse");
|
||||
rv = BlockingParse(mURL, this);
|
||||
NS_TIMELINE_STOP_TIMER("rdf blocking parse");
|
||||
NS_TIMELINE_MARK_TIMER("rdf blocking parse");
|
||||
|
||||
mListener = nsnull; // release the parser
|
||||
|
||||
|
@ -54,8 +54,6 @@
|
||||
|
||||
#include "rdfIDataSource.h"
|
||||
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
PRInt32 nsRDFXMLSerializer::gRefCnt = 0;
|
||||
nsIRDFContainerUtils* nsRDFXMLSerializer::gRDFC;
|
||||
nsIRDFResource* nsRDFXMLSerializer::kRDF_instanceOf;
|
||||
@ -1104,7 +1102,6 @@ NS_IMETHODIMP
|
||||
nsRDFXMLSerializer::Serialize(nsIOutputStream* aStream)
|
||||
{
|
||||
nsresult rv;
|
||||
NS_TIMELINE_START_TIMER("rdf/xml-ser");
|
||||
|
||||
rv = CollectNamespaces();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1144,8 +1141,6 @@ nsRDFXMLSerializer::Serialize(nsIOutputStream* aStream)
|
||||
}
|
||||
|
||||
rv = SerializeEpilogue(aStream);
|
||||
NS_TIMELINE_STOP_TIMER("rdf/xml-ser");
|
||||
NS_TIMELINE_MARK("rdf/xml-ser");
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -61,7 +61,6 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIRequestObserver.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsCRT.h"
|
||||
#include "prmem.h"
|
||||
#include "mozilla/ModuleUtils.h"
|
||||
@ -419,7 +418,6 @@ NS_IMPL_ISUPPORTS1(nsCharsetMenuObserver, nsIObserver)
|
||||
|
||||
NS_IMETHODIMP nsCharsetMenuObserver::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu:Observe");
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
//XUL event handler
|
||||
@ -466,8 +464,6 @@ NS_IMETHODIMP nsCharsetMenuObserver::Observe(nsISupports *aSubject, const char *
|
||||
}
|
||||
}
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu:Observe");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu:Observe");
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -519,7 +515,6 @@ nsCharsetMenu::nsCharsetMenu()
|
||||
mAutoDetectInitialized(PR_FALSE),
|
||||
mOthersInitialized(PR_FALSE)
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::nsCharsetMenu");
|
||||
nsresult res = NS_OK;
|
||||
|
||||
//get charset manager
|
||||
@ -556,8 +551,6 @@ nsCharsetMenu::nsCharsetMenu()
|
||||
}
|
||||
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Failed to initialize nsCharsetMenu");
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::nsCharsetMenu");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::nsCharsetMenu");
|
||||
}
|
||||
|
||||
nsCharsetMenu::~nsCharsetMenu()
|
||||
@ -885,8 +878,6 @@ nsresult nsCharsetMenu::FreeResources()
|
||||
|
||||
nsresult nsCharsetMenu::InitBrowserMenu()
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitBrowserMenu");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (!mBrowserMenuInitialized) {
|
||||
@ -929,16 +920,11 @@ nsresult nsCharsetMenu::InitBrowserMenu()
|
||||
|
||||
mBrowserMenuInitialized = NS_SUCCEEDED(res);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitBrowserMenu");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitBrowserMenu");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
nsresult nsCharsetMenu::InitMaileditMenu()
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitMaileditMenu");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (!mMaileditMenuInitialized) {
|
||||
@ -969,16 +955,11 @@ nsresult nsCharsetMenu::InitMaileditMenu()
|
||||
|
||||
mMaileditMenuInitialized = NS_SUCCEEDED(res);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitMaileditMenu");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitMaileditMenu");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
nsresult nsCharsetMenu::InitMailviewMenu()
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitMailviewMenu");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (!mMailviewMenuInitialized) {
|
||||
@ -1010,16 +991,11 @@ nsresult nsCharsetMenu::InitMailviewMenu()
|
||||
|
||||
mMailviewMenuInitialized = NS_SUCCEEDED(res);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitMailviewMenu");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitMailviewMenu");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
nsresult nsCharsetMenu::InitComposerMenu()
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitComposerMenu");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (!mComposerMenuInitialized) {
|
||||
@ -1052,16 +1028,11 @@ nsresult nsCharsetMenu::InitComposerMenu()
|
||||
|
||||
mComposerMenuInitialized = NS_SUCCEEDED(res);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitComposerMenu");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitComposerMenu");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
nsresult nsCharsetMenu::InitOthers()
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitOthers");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (!mOthersInitialized) {
|
||||
@ -1081,9 +1052,6 @@ nsresult nsCharsetMenu::InitOthers()
|
||||
|
||||
mOthersInitialized = NS_SUCCEEDED(res);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitOthers");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitOthers");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -1094,8 +1062,6 @@ nsresult nsCharsetMenu::InitOthers()
|
||||
*/
|
||||
nsresult nsCharsetMenu::InitSecondaryTiers()
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitSecondaryTiers");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (!mSecondaryTiersInitialized) {
|
||||
@ -1110,9 +1076,6 @@ nsresult nsCharsetMenu::InitSecondaryTiers()
|
||||
|
||||
mSecondaryTiersInitialized = NS_SUCCEEDED(res);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitSecondaryTiers");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitSecondaryTiers");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -1121,8 +1084,6 @@ nsresult nsCharsetMenu::InitStaticMenu(nsTArray<nsCString>& aDecs,
|
||||
const char * aKey,
|
||||
nsTArray<nsMenuEntry*> * aArray)
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitStaticMenu");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
nsCOMPtr<nsIRDFContainer> container;
|
||||
|
||||
@ -1136,9 +1097,6 @@ nsresult nsCharsetMenu::InitStaticMenu(nsTArray<nsCString>& aDecs,
|
||||
res = AddFromPrefsToMenu(aArray, container, aKey, aDecs, "charset.");
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "error initializing static charset menu from prefs");
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitStaticMenu");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitStaticMenu");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -1148,8 +1106,6 @@ nsresult nsCharsetMenu::InitCacheMenu(
|
||||
const char * aKey,
|
||||
nsTArray<nsMenuEntry*> * aArray)
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitCacheMenu");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
nsCOMPtr<nsIRDFContainer> container;
|
||||
|
||||
@ -1159,16 +1115,11 @@ nsresult nsCharsetMenu::InitCacheMenu(
|
||||
res = AddFromNolocPrefsToMenu(aArray, container, aKey, aDecs, "charset.");
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "error initializing cache charset menu from prefs");
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitCacheMenu");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitCacheMenu");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
nsresult nsCharsetMenu::InitAutodetMenu()
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitAutodetMenu");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (!mAutoDetectInitialized) {
|
||||
@ -1204,9 +1155,6 @@ nsresult nsCharsetMenu::InitAutodetMenu()
|
||||
|
||||
mAutoDetectInitialized = NS_SUCCEEDED(res);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitAutodetMenu");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitAutodetMenu");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -1214,8 +1162,6 @@ nsresult nsCharsetMenu::InitMoreMenu(nsTArray<nsCString>& aDecs,
|
||||
nsIRDFResource * aResource,
|
||||
const char * aFlag)
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitMoreMenu");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
nsCOMPtr<nsIRDFContainer> container;
|
||||
nsTArray<nsMenuEntry*> moreMenu;
|
||||
@ -1241,17 +1187,12 @@ done:
|
||||
// free the elements in the VoidArray
|
||||
FreeMenuItemArray(&moreMenu);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitMoreMenu");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitMoreMenu");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// XXX please make this method more general; the cut&pasted code is laughable
|
||||
nsresult nsCharsetMenu::InitMoreSubmenus(nsTArray<nsCString>& aDecs)
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitMoreSubmenus");
|
||||
|
||||
nsresult res = NS_OK;
|
||||
|
||||
nsCOMPtr<nsIRDFContainer> container1;
|
||||
@ -1297,9 +1238,6 @@ nsresult nsCharsetMenu::InitMoreSubmenus(nsTArray<nsCString>& aDecs)
|
||||
if (NS_FAILED(res)) return res;
|
||||
AddFromNolocPrefsToMenu(NULL, containerU, keyU, aDecs, NULL);
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitMoreSubmenus");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitMoreSubmenus");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -1838,7 +1776,6 @@ nsresult nsCharsetMenu::GetCollation(nsICollation ** aCollation)
|
||||
|
||||
NS_IMETHODIMP nsCharsetMenu::SetCurrentCharset(const PRUnichar * aCharset)
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu:SetCurrentCharset");
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mBrowserMenuInitialized) {
|
||||
@ -1854,7 +1791,6 @@ NS_IMETHODIMP nsCharsetMenu::SetCurrentCharset(const PRUnichar * aCharset)
|
||||
mBrowserCacheStart, mBrowserCacheSize,
|
||||
mBrowserMenuRDFPosition);
|
||||
if (NS_FAILED(res)) {
|
||||
NS_TIMELINE_LEAVE("nsCharsetMenu:SetCurrentCharset");
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -1864,14 +1800,11 @@ NS_IMETHODIMP nsCharsetMenu::SetCurrentCharset(const PRUnichar * aCharset)
|
||||
res = UpdateCachePrefs(kBrowserCachePrefKey, kBrowserCacheSizePrefKey,
|
||||
kBrowserStaticPrefKey, aCharset);
|
||||
}
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu:SetCurrentCharset");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu:SetCurrentCharset");
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsCharsetMenu::SetCurrentMailCharset(const PRUnichar * aCharset)
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu:SetCurrentMailCharset");
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mMailviewMenuInitialized) {
|
||||
@ -1887,14 +1820,11 @@ NS_IMETHODIMP nsCharsetMenu::SetCurrentMailCharset(const PRUnichar * aCharset)
|
||||
res = UpdateCachePrefs(kMailviewCachePrefKey, kMailviewCacheSizePrefKey,
|
||||
kMailviewStaticPrefKey, aCharset);
|
||||
}
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu:SetCurrentMailCharset");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu:SetCurrentMailCharset");
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsCharsetMenu::SetCurrentComposerCharset(const PRUnichar * aCharset)
|
||||
{
|
||||
NS_TIMELINE_START_TIMER("nsCharsetMenu:SetCurrentComposerCharset");
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mComposerMenuInitialized) {
|
||||
@ -1911,8 +1841,6 @@ NS_IMETHODIMP nsCharsetMenu::SetCurrentComposerCharset(const PRUnichar * aCharse
|
||||
res = UpdateCachePrefs(kComposerCachePrefKey, kComposerCacheSizePrefKey,
|
||||
kComposerStaticPrefKey, aCharset);
|
||||
}
|
||||
NS_TIMELINE_STOP_TIMER("nsCharsetMenu:SetCurrentComposerCharset");
|
||||
NS_TIMELINE_MARK_TIMER("nsCharsetMenu:SetCurrentComposerCharset");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,6 @@
|
||||
#include "nsIPromptService.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsIWebBrowserChrome.h"
|
||||
#include "nsIWindowMediator.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
|
@ -105,7 +105,6 @@
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsIToolkitChromeRegistry.h"
|
||||
#include "nsIToolkitProfile.h"
|
||||
#include "nsIToolkitProfileService.h"
|
||||
@ -2622,7 +2621,6 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
|
||||
nsresult rv;
|
||||
ArgResult ar;
|
||||
NS_TIMELINE_MARK("enter main");
|
||||
|
||||
#ifdef DEBUG
|
||||
if (PR_GetEnv("XRE_MAIN_BREAK"))
|
||||
@ -3394,13 +3392,11 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
}
|
||||
|
||||
{
|
||||
NS_TIMELINE_ENTER("startupNotifier");
|
||||
nsCOMPtr<nsIObserver> startupNotifier
|
||||
(do_CreateInstance(NS_APPSTARTUPNOTIFIER_CONTRACTID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, 1);
|
||||
|
||||
startupNotifier->Observe(nsnull, APPSTARTUP_TOPIC, nsnull);
|
||||
NS_TIMELINE_LEAVE("startupNotifier");
|
||||
}
|
||||
|
||||
NS_TIME_FUNCTION_MARK("Finished startupNotifier");
|
||||
@ -3492,9 +3488,7 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
if (!shuttingDown) {
|
||||
NS_TIME_FUNCTION_MARK("Next: CreateHiddenWindow");
|
||||
|
||||
NS_TIMELINE_ENTER("appStartup->CreateHiddenWindow");
|
||||
rv = appStartup->CreateHiddenWindow();
|
||||
NS_TIMELINE_LEAVE("appStartup->CreateHiddenWindow");
|
||||
NS_ENSURE_SUCCESS(rv, 1);
|
||||
|
||||
MOZ_SPLASHSCREEN_UPDATE(50);
|
||||
@ -3574,9 +3568,7 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
|
||||
MOZ_SPLASHSCREEN_UPDATE(90);
|
||||
{
|
||||
NS_TIMELINE_ENTER("appStartup->Run");
|
||||
rv = appStartup->Run();
|
||||
NS_TIMELINE_LEAVE("appStartup->Run");
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ERROR("failed to run appstartup");
|
||||
gLogConsoleErrors = PR_TRUE;
|
||||
@ -3605,11 +3597,6 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
#endif /* MOZ_ENABLE_XREMOTE */
|
||||
}
|
||||
|
||||
#ifdef MOZ_TIMELINE
|
||||
// Make sure we print this out even if timeline is runtime disabled
|
||||
if (NS_FAILED(NS_TIMELINE_LEAVE("main1")))
|
||||
NS_TimelineForceMark("...main1");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,259 +0,0 @@
|
||||
#
|
||||
# perl file to get a list of files that we load from a timeline log
|
||||
#
|
||||
# Usage: perl getlines.pl < timline.log > file.log
|
||||
|
||||
# Configuration options
|
||||
#
|
||||
# Set this option to take all timings only upto the main window being visible
|
||||
# All activity beyond main window being visible is ignored.
|
||||
# default is 0. We take timings upto main1 finish
|
||||
$stopWithVisibleWindow = 0;
|
||||
|
||||
# dlls loaded
|
||||
my @dlls = ();
|
||||
# Files of a particular extensions
|
||||
my %ext = ();
|
||||
# Number of files in a paticular extension. Used to sort them output by order of extension
|
||||
my %extnum = ();
|
||||
# List of all urls that either exist or are jar. Non dups.
|
||||
my @allurls = ();
|
||||
# List of nonexistent file urls
|
||||
my @nonexistentfiles = ();
|
||||
# Number of file urls
|
||||
my $nfileurl = 0;
|
||||
# Number of jar urls
|
||||
my $njarurl = 0;
|
||||
# Urls hash to figure out dups
|
||||
my %seen = ();
|
||||
# Number of dups per extension
|
||||
my %extnumdups = ();
|
||||
# interesting total times
|
||||
my %breakdown = ();
|
||||
# main1 cost
|
||||
my $main1 = 0;
|
||||
# when main window was visible
|
||||
my $window = 0;
|
||||
# pref files loaded
|
||||
my @prefurl = ();
|
||||
while (<>)
|
||||
{
|
||||
chomp;
|
||||
|
||||
# Computer breakdown of startup cost
|
||||
if (/total:/) {
|
||||
# This is a cumulative timer. Keep track of it.
|
||||
/^[0-9\.: ]*(.*) total: ([0-9\.]*)/;
|
||||
$breakdown{$1} = $2;
|
||||
}
|
||||
if (/InitXPCom\.\.\./) {
|
||||
$breakdown{"Before InitXPCom"} = getTimelineStamp($_);
|
||||
next;
|
||||
}
|
||||
if (/InitXPCOM done/) {
|
||||
$breakdown{"InitXPCom"} = getTimelineStamp($_) - $breakdown{"Before InitXPCom"};
|
||||
next;
|
||||
}
|
||||
|
||||
# Find main1's cost to compute percentages
|
||||
if (/\.\.\.main1/) {
|
||||
$main1 = getTimelineStamp($_);
|
||||
}
|
||||
# find when we showed the window
|
||||
if (/Navigator Window visible now/) {
|
||||
$window = getTimelineStamp($_);
|
||||
if ($stopWithVisibleWindow) {
|
||||
$main1 = $window;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
# Find all files loaded
|
||||
if (/PR_LoadLibrary/) {
|
||||
my $dll = getdll($_);
|
||||
push @dlls, $dll;
|
||||
next;
|
||||
}
|
||||
if (/file:/) {
|
||||
$url = getfileurl($_);
|
||||
$e = getext($url);
|
||||
if (!-f $url) {
|
||||
push @nonexistentfiles, $url;
|
||||
} else {
|
||||
$seen{$url}++;
|
||||
if ($seen{$url} > 1) {
|
||||
$extnumdups{$e}++;
|
||||
next;
|
||||
}
|
||||
push @allurls, $url;
|
||||
if (exists $ext{$e}) {
|
||||
$ext{$e} .= "---";
|
||||
}
|
||||
$ext{$e} .= $url;
|
||||
$extnum{$e}++;
|
||||
$nfileurl++;
|
||||
}
|
||||
next;
|
||||
}
|
||||
if (/jar:/) {
|
||||
$url = getjarurl($_);
|
||||
$e = getext($url);
|
||||
$seen{$url}++;
|
||||
if ($seen{$url} > 1) {
|
||||
$extnumdups{$e}++;
|
||||
next;
|
||||
}
|
||||
push @allurls, $url;
|
||||
if (exists $ext{$e}) {
|
||||
$ext{$e} .= "---";
|
||||
}
|
||||
$ext{$e} .= "$url";
|
||||
$extnum{$e}++;
|
||||
$njarurl++;
|
||||
next;
|
||||
}
|
||||
if (/load pref file/) {
|
||||
$url = getfile($_);
|
||||
push @prefurl, $url;
|
||||
}
|
||||
}
|
||||
|
||||
# print results
|
||||
print "SUMMARY\n";
|
||||
print "----------------------------------------------------------------------\n";
|
||||
print "Total startup time : $main1 sec\n";
|
||||
printf "Main window visible: $window sec (%5.2f%%)\n", main1Percent($window);
|
||||
print "dlls loaded : ", $#dlls+1, "\n";
|
||||
print "Total unique: ", $#allurls+1, " [jar $njarurl, file $nfileurl]\n";
|
||||
# print the # of files by extensions sorted
|
||||
my @extsorted = sort { $extnum{$b} <=> $extnum{$a} } keys %extnum;
|
||||
my $sep = " ";
|
||||
foreach $i (@extsorted)
|
||||
{
|
||||
print "$sep.$i $extnum{$i}";
|
||||
$sep = ", ";
|
||||
}
|
||||
print "\n";
|
||||
# print number of dups per extension
|
||||
my $sep = " dups: ";
|
||||
foreach $i (@extsorted)
|
||||
{
|
||||
next unless exists($extnumdups{$i});
|
||||
print "$sep.$i $extnumdups{$i}";
|
||||
$sep = ", ";
|
||||
}
|
||||
print "\n";
|
||||
print "Total non existent files : ", $#nonexistentfiles+1, "\n";
|
||||
|
||||
print "\n";
|
||||
print "Cost Breakdown\n";
|
||||
print "----------------------------------------------------------------------\n";
|
||||
# sort by descending order of breakdown cost
|
||||
my @breakdownsorted = sort { $breakdown{$b} <=> $breakdown{$a} } keys %breakdown;
|
||||
my $totalAccounted = 0;
|
||||
foreach $e (@breakdownsorted)
|
||||
{
|
||||
# ignore these breakdowns as they are already counted otherwise
|
||||
next if ($e =~ /nsNativeComponentLoader::GetFactory/);
|
||||
my $p = main1Percent($breakdown{$e});
|
||||
#next if ($p == 0);
|
||||
printf "%6.2f%% %s\n", $p, $e;
|
||||
$totalAccounted += $p;
|
||||
}
|
||||
print "----------------------\n";
|
||||
printf "%6.2f%% Total Accounted\n", $totalAccounted;
|
||||
|
||||
print "\n";
|
||||
printf "[%d] List of dlls loaded:\n", $#dlls+1;
|
||||
print "----------------------------------------------------------------------\n";
|
||||
my $n = 1;
|
||||
foreach $e (@dlls)
|
||||
{
|
||||
printf "%2d. %s\n", $n++, $e;
|
||||
}
|
||||
|
||||
print "\n";
|
||||
printf "[%d] List of existing unique files and jar urls by extension:\n", $#allurls+1;
|
||||
print "----------------------------------------------------------------------\n";
|
||||
foreach $e (@extsorted)
|
||||
{
|
||||
$n = 1;
|
||||
print "[$extnum{$e}] .$e\n";
|
||||
foreach $i (split("---", $ext{$e})) {
|
||||
printf "%2d. %s", $n++, $i;
|
||||
if ($seen{$i} > 1) {
|
||||
printf " [%d]", $seen{$i}-1;
|
||||
}
|
||||
printf "\n";
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
#foreach $i (@allurls)
|
||||
#{
|
||||
# printf "%2d. %s\n", $n++, $i;
|
||||
#}
|
||||
|
||||
print "\n";
|
||||
printf "[%d] List of non existent file urls:\n", $#nonexistentfiles+1;
|
||||
print "----------------------------------------------------------------------\n";
|
||||
my $n = 1;
|
||||
foreach $i (@nonexistentfiles)
|
||||
{
|
||||
printf "%2d. %s\n", $n++, $i;
|
||||
}
|
||||
|
||||
# print prefs loaded
|
||||
print "\n";
|
||||
printf "[%d] List of pref files loaded:\n", $#prefurl+1;
|
||||
print "----------------------------------------------------------------------\n";
|
||||
$n = 1;
|
||||
foreach $i (@prefurl)
|
||||
{
|
||||
printf "%2d. %s\n", $n++, $i;
|
||||
}
|
||||
|
||||
# Subrouties
|
||||
sub getTimelineStamp() {
|
||||
my $line = shift;
|
||||
$line =~ /^([0-9\.]*)/;
|
||||
return $1+0;
|
||||
}
|
||||
|
||||
sub getfileurl() {
|
||||
my $f = shift;
|
||||
$f =~ s/^.*file:\/*(.*)\).*$/\1/;
|
||||
# unescape the url
|
||||
$f =~ s/\|/:/;
|
||||
$f =~ s/\%20/ /g;
|
||||
return $f;
|
||||
}
|
||||
|
||||
sub getjarurl() {
|
||||
my $f = shift;
|
||||
$f =~ s/^.*(jar:.*)\).*$/\1/;
|
||||
return $f;
|
||||
}
|
||||
|
||||
sub getdll() {
|
||||
my $f = shift;
|
||||
$f =~ s/^.*\((.*)\).*$/\1/;
|
||||
return $f;
|
||||
}
|
||||
|
||||
sub getext() {
|
||||
my $f = shift;
|
||||
$f =~ s/^.*\.([^\.]*)$/\1/;
|
||||
return $f;
|
||||
}
|
||||
|
||||
sub getfile() {
|
||||
my $f = shift;
|
||||
$f =~ s/^.*\((.*)\)$/\1/;
|
||||
return $f;
|
||||
}
|
||||
|
||||
# what % is this of startup
|
||||
sub main1Percent() {
|
||||
my $i = shift;
|
||||
return $i/$main1 * 100;
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
#
|
||||
# Script to time mozilla startup
|
||||
#
|
||||
# Requirements:
|
||||
# - a Profile with name "Default User"
|
||||
# - a MOZ_TIMELINE build
|
||||
#
|
||||
# This starts mozilla with the profile "Default User" and makes it quit immediately.
|
||||
# Measurement is of main1 from MOZ_TIMELINE output
|
||||
#
|
||||
# This does multiple runs [default 3] and averages all but the first run.
|
||||
#
|
||||
# startup-quick.pl <exe> [n times]
|
||||
# n - default 3
|
||||
#
|
||||
|
||||
require 5.003;
|
||||
|
||||
use strict;
|
||||
use Cwd;
|
||||
|
||||
sub PrintUsage {
|
||||
die <<END_USAGE
|
||||
usage: measure-simple.pl [n]
|
||||
n defaults to 3
|
||||
e.g
|
||||
measure-simple.pl ../../../dist/bin/mozilla
|
||||
measure-simple.pl ../../../dist/bin/mozilla 10
|
||||
END_USAGE
|
||||
}
|
||||
|
||||
{
|
||||
PrintUsage() unless $#ARGV >= 0;
|
||||
my $exe = shift @ARGV;
|
||||
my $ntimes = shift @ARGV || 3;
|
||||
my $timelinelog = "timeline.log";
|
||||
# Do one more than what was requested as we ignore the first run timing
|
||||
$ntimes++;
|
||||
|
||||
# Build up command string.
|
||||
my $cwd = Cwd::getcwd();
|
||||
|
||||
# take care of cygwin adding /cygdrive/<driveletter>
|
||||
$cwd =~ s/\/cygdrive\/(.)/$1:/;
|
||||
|
||||
my $cmd = "$exe -P \"Default User\" file:///$cwd/quit.html";
|
||||
print "cmd = $cmd\n";
|
||||
print "$ntimes times\n";
|
||||
|
||||
# Setup run environment
|
||||
$ENV{"NS_TIMELINE_ENABLE"} = 1;
|
||||
$ENV{"NS_TIMELINE_LOG_FILE"} = $timelinelog;
|
||||
$ENV{"XPCOM_DEBUG_BREAK"} = "warn";
|
||||
unlink $timelinelog;
|
||||
|
||||
my $i;
|
||||
my @runtimes = ();
|
||||
for($i = 0; $i < $ntimes; $i++) {
|
||||
# Run the command.
|
||||
system($cmd);
|
||||
|
||||
# find the time taken from the TIMELINE LOG
|
||||
my $F;
|
||||
open(F, "< $timelinelog") || die "no timeline log ($timelinelog) found";
|
||||
while(<F>) {
|
||||
if (/^(.*): \.\.\.main1$/) {
|
||||
my $t = $1 + 0;
|
||||
push @runtimes, $t;
|
||||
print "[$i] startup time : $t sec\n";
|
||||
last;
|
||||
}
|
||||
}
|
||||
close(F);
|
||||
# Cleanup
|
||||
unlink $timelinelog;
|
||||
}
|
||||
|
||||
# Compute final number. Skip first run and average the rest.
|
||||
my $sum = 0;
|
||||
shift @runtimes;
|
||||
foreach $i (@runtimes) {
|
||||
$sum += $i;
|
||||
}
|
||||
printf "Average startup time : %8.4f secs (%d trials - %s)\n", $sum/($ntimes-1), $ntimes-1, join(" ", @runtimes);
|
||||
}
|
||||
|
@ -1,57 +0,0 @@
|
||||
# Post processor for timeline output
|
||||
# Does a diff betn consecutive timeline outputs looking for
|
||||
# big % differences
|
||||
|
||||
my $percent = 1; # anything over 1% of total is of interest to us
|
||||
my $ignoreDllLoads = 0; # by default don't ignore dll timings
|
||||
|
||||
# Read in log to memory
|
||||
my @lines = <>;
|
||||
|
||||
my $total = 0;
|
||||
# Look for main1's timing
|
||||
foreach (@lines) {
|
||||
if (/^([0-9\.]*): \.\.\.main1/) {
|
||||
$total = $1 + 0;
|
||||
print "Found main1 time: $total\n";
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $prev = 0;
|
||||
my $t = $total * $percent / 100;
|
||||
foreach (@lines) {
|
||||
/^([0-9\.]*):/;
|
||||
$cur = $1;
|
||||
printdiff($cur, $prev, $_);
|
||||
if (/total: ([0-9\.]*)/) {
|
||||
# print how much % this was
|
||||
printf "%4.2f%%", $1/$total*100;
|
||||
}
|
||||
print "\t$_";
|
||||
$prev = $cur;
|
||||
}
|
||||
|
||||
|
||||
sub printdiff() {
|
||||
my $cur = shift;
|
||||
my $prev = shift;
|
||||
my $line = shift;
|
||||
my $diff = $cur - $prev;
|
||||
|
||||
# Make sure we have a considerable difference
|
||||
if ($diff < $t) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# If we are ignoring dlls and this is a dll line, return
|
||||
if ($ignoreDllLoads && $line =~ /PR_LoadLibrary/) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# if significant time elapsed print it
|
||||
printf "%4.2f%% %5.3f\n", $diff/$total*100, $diff;
|
||||
|
||||
return 1;
|
||||
}
|
@ -106,7 +106,6 @@
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsISupportsPriority.h"
|
||||
#include "nsIThreadManager.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsITraceRefcnt.h"
|
||||
#include "nsIUUIDGenerator.h"
|
||||
|
@ -22,9 +22,6 @@
|
||||
COMPONENT(CONSOLESERVICE, nsConsoleServiceConstructor)
|
||||
COMPONENT(EXCEPTIONSERVICE, nsExceptionServiceConstructor)
|
||||
COMPONENT(ATOMSERVICE, nsAtomServiceConstructor)
|
||||
#ifdef MOZ_TIMELINE
|
||||
COMPONENT(TIMELINESERVICE, nsTimelineServiceConstructor)
|
||||
#endif
|
||||
COMPONENT(OBSERVERSERVICE, nsObserverService::Create)
|
||||
|
||||
COMPONENT(XPCOMPROXY, nsProxyObjectManager::Create)
|
||||
|
@ -110,7 +110,6 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
|
||||
#include "nsAtomService.h"
|
||||
#include "nsAtomTable.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "nsTimelineService.h"
|
||||
|
||||
#include "nsHashPropertyBag.h"
|
||||
|
||||
@ -210,10 +209,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsVariant)
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsRecyclingAllocatorImpl)
|
||||
|
||||
#ifdef MOZ_TIMELINE
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimelineService)
|
||||
#endif
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHashPropertyBag, Init)
|
||||
|
||||
NS_GENERIC_AGGREGATED_CONSTRUCTOR_INIT(nsProperties, Init)
|
||||
|
@ -71,7 +71,6 @@ CPPSRCS = \
|
||||
nsSupportsArray.cpp \
|
||||
nsSupportsArrayEnumerator.cpp \
|
||||
nsSupportsPrimitives.cpp \
|
||||
nsTimelineService.cpp \
|
||||
nsUnicharBuffer.cpp \
|
||||
nsVariant.cpp \
|
||||
$(NULL)
|
||||
@ -134,7 +133,6 @@ XPIDLSRCS = \
|
||||
nsIStringEnumerator.idl \
|
||||
nsISupportsArray.idl \
|
||||
nsISupportsIterators.idl \
|
||||
nsITimelineService.idl \
|
||||
$(NULL)
|
||||
|
||||
SDK_XPIDLSRCS = \
|
||||
|
@ -1,242 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
%{C++
|
||||
#ifdef MOZ_TIMELINE
|
||||
%}
|
||||
|
||||
/**
|
||||
* nsITimelineService is used to construct a timeline of program
|
||||
* execution. The timeline is output to a file, either stderr or the
|
||||
* value of the environment variable NS_TIMELINE_LOG_FILE. On the
|
||||
* Mac, the timeline is output to the file named "timeline.txt". The
|
||||
* reason it's different on the Mac is that the Mac environment
|
||||
* initialization code happens after timeline initialization code.
|
||||
*
|
||||
* If NS_TIMELINE_INIT_TIME is set in the environment, that will be
|
||||
* used as the time of startup; otherwise the current time when mark()
|
||||
* is first called will be used.
|
||||
*
|
||||
* mark() is used to put marks on the timeline.
|
||||
*
|
||||
* indent() and outdent() are used to format the timeline a bit to
|
||||
* show nesting. This doesn't produce perfect results in the face of
|
||||
* asychrony and multiple threads.
|
||||
*
|
||||
* enter() and leave() are convenience functions that add marks to the
|
||||
* timeline and do indentation.
|
||||
*
|
||||
* startTimer() and stopTimer() control named stop watches. If
|
||||
* startTimer() is called more than once, an equal number of
|
||||
* stopTimer() calls are needed to actually stop the timer. This
|
||||
* makes these timers slightly useful in a threaded environment.
|
||||
*
|
||||
* markTimer() puts a mark on the timeline containing the total for
|
||||
* the named timer.
|
||||
*
|
||||
* Don't use nsITimelineService in C++ code; use the NS_TIMELINE
|
||||
* macros instead. nsITimelineService exists so that JavaScript code
|
||||
* can mark the timeline.
|
||||
*/
|
||||
[scriptable, uuid(93276790-3daf-11d5-b67d-000064657374)]
|
||||
interface nsITimelineService : nsISupports
|
||||
{
|
||||
/**
|
||||
* mark()
|
||||
* Print "<elapsed time>: <text>\n" in the timeline log file.
|
||||
*/
|
||||
void mark(in string text);
|
||||
|
||||
/**
|
||||
* causes subsequent marks to be indented for a more readable
|
||||
* report.
|
||||
*/
|
||||
void indent();
|
||||
|
||||
/**
|
||||
* Causes subsequent marks to be outdented.
|
||||
*/
|
||||
void outdent();
|
||||
|
||||
/**
|
||||
* enter/leave bracket code with "<text>..." and "...<text>" as
|
||||
* well as indentation.
|
||||
*/
|
||||
void enter(in string text);
|
||||
void leave(in string text);
|
||||
|
||||
void startTimer(in string timerName);
|
||||
|
||||
void stopTimer(in string timerName);
|
||||
|
||||
void markTimer(in string timerName);
|
||||
|
||||
void resetTimer(in string timerName);
|
||||
|
||||
// Mark a timer, plus an additional comment
|
||||
void markTimerWithComment(in string timerName, in string comment);
|
||||
};
|
||||
|
||||
%{C++
|
||||
#endif /* MOZ_TIMELINE */
|
||||
%}
|
||||
|
||||
|
||||
%{C++
|
||||
|
||||
#ifdef MOZ_TIMELINE
|
||||
|
||||
/*
|
||||
* These are equivalent to the corresponding nsITimelineService
|
||||
* methods, and can be called before XPCOM is initialized.
|
||||
*/
|
||||
extern "C" NS_COM nsresult NS_TimelineMark(const char *text, ...);
|
||||
extern "C" NS_COM nsresult NS_TimelineForceMark(const char *text, ...);
|
||||
extern "C" NS_COM nsresult NS_TimelineStartTimer(const char *timerName);
|
||||
extern "C" NS_COM nsresult NS_TimelineStopTimer(const char *timerName);
|
||||
extern "C" NS_COM nsresult NS_TimelineResetTimer(const char *timerName);
|
||||
extern "C" NS_COM nsresult NS_TimelineMarkTimer(const char *timerName, const char *str=nsnull);
|
||||
extern "C" NS_COM nsresult NS_TimelineIndent();
|
||||
extern "C" NS_COM nsresult NS_TimelineOutdent();
|
||||
extern "C" NS_COM nsresult NS_TimelineEnter(const char *text);
|
||||
extern "C" NS_COM nsresult NS_TimelineLeave(const char *text);
|
||||
|
||||
/*
|
||||
* Use these macros for the above calls so we can easily compile them
|
||||
* out.
|
||||
*/
|
||||
#define NS_TIMELINE_MARK(text) NS_TimelineMark(text)
|
||||
#define NS_TIMELINE_MARKV(args) NS_TimelineMark args
|
||||
#define NS_TIMELINE_INDENT() NS_TimelineIndent()
|
||||
#define NS_TIMELINE_OUTDENT() NS_TimelineOutdent()
|
||||
#define NS_TIMELINE_ENTER(text) NS_TimelineEnter(text)
|
||||
#define NS_TIMELINE_LEAVE(text) NS_TimelineLeave(text)
|
||||
#define NS_TIMELINE_START_TIMER(timerName) NS_TimelineStartTimer(timerName)
|
||||
#define NS_TIMELINE_STOP_TIMER(timerName) NS_TimelineStopTimer(timerName)
|
||||
#define NS_TIMELINE_MARK_TIMER(timerName) NS_TimelineMarkTimer(timerName)
|
||||
#define NS_TIMELINE_RESET_TIMER(timerName) NS_TimelineResetTimer(timerName)
|
||||
#define NS_TIMELINE_MARK_TIMER1(timerName, str) NS_TimelineMarkTimer(timerName, str)
|
||||
|
||||
/*
|
||||
* Helper class to time functions. Use only static strings.
|
||||
*/
|
||||
class nsFunctionTimer {
|
||||
public:
|
||||
const char *mTimer;
|
||||
PRBool mMark;
|
||||
const char *mMarkStr;
|
||||
nsFunctionTimer(const char *timer, PRBool mark = PR_TRUE, const char *markStr = nsnull)
|
||||
: mTimer(timer), mMark(mark), mMarkStr(markStr)
|
||||
{
|
||||
NS_TIMELINE_START_TIMER(mTimer);
|
||||
}
|
||||
|
||||
~nsFunctionTimer()
|
||||
{
|
||||
NS_TIMELINE_STOP_TIMER(mTimer);
|
||||
if (mMark)
|
||||
if (mMarkStr)
|
||||
NS_TIMELINE_MARK_TIMER1(mTimer, mMarkStr);
|
||||
else
|
||||
NS_TIMELINE_MARK_TIMER(mTimer);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* NS_TIMELINE_MARK_ macros for various data types. Each of these
|
||||
* macros replaces "%s" in its "text" argument with a string
|
||||
* representation of its last argument.
|
||||
*
|
||||
* Please feel free to add more NS_TIMELINE_MARK_ macros for
|
||||
* various data types so that code using NS_TIMELINE is uncluttered.
|
||||
* Don't forget the empty versions in the #else section below for
|
||||
* non-timeline builds.
|
||||
*/
|
||||
#define NS_TIMELINE_MARK_URI(text, uri) \
|
||||
{ \
|
||||
nsCAutoString spec; \
|
||||
if (uri) { \
|
||||
uri->GetSpec(spec); \
|
||||
} \
|
||||
if (!spec.IsEmpty()) { \
|
||||
NS_TimelineMark(text, spec.get()); \
|
||||
} else { \
|
||||
NS_TimelineMark(text, "??"); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NS_TIMELINE_MARK_CHANNEL(text, channel) \
|
||||
{ \
|
||||
nsCOMPtr<nsIURI> uri; \
|
||||
if (channel) { \
|
||||
channel->GetURI(getter_AddRefs(uri)); \
|
||||
} \
|
||||
NS_TIMELINE_MARK_URI(text, uri); \
|
||||
}
|
||||
|
||||
#define NS_TIMELINE_MARK_LOADER(text, loader) \
|
||||
{ \
|
||||
nsCOMPtr<nsIRequest> request; \
|
||||
loader->GetRequest(getter_AddRefs(request)); \
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(request)); \
|
||||
NS_TIMELINE_MARK_CHANNEL(text, channel); \
|
||||
}
|
||||
#define NS_TIMELINE_MARK_FUNCTION(timer) nsFunctionTimer functionTimer(timer)
|
||||
#define NS_TIMELINE_MARK_FUNCTION1(timer, str) nsFunctionTimer functionTimer(timer, PR_TRUE, str)
|
||||
#define NS_TIMELINE_TIME_FUNCTION(timer) nsFunctionTimer functionTimer(timer, PR_FALSE) /* no mark, only time */
|
||||
|
||||
#else /* !defined(MOZ_TIMELINE) */
|
||||
#define NS_TIMELINE_MARK(text)
|
||||
#define NS_TIMELINE_MARKV(args)
|
||||
#define NS_TIMELINE_INDENT()
|
||||
#define NS_TIMELINE_OUTDENT()
|
||||
#define NS_TIMELINE_START_TIMER(timerName)
|
||||
#define NS_TIMELINE_STOP_TIMER(timerName)
|
||||
#define NS_TIMELINE_MARK_TIMER(timerName)
|
||||
#define NS_TIMELINE_RESET_TIMER(timerName)
|
||||
#define NS_TIMELINE_MARK_TIMER1(timerName, str)
|
||||
#define NS_TIMELINE_ENTER(text)
|
||||
#define NS_TIMELINE_LEAVE(text)
|
||||
#define NS_TIMELINE_MARK_URI(text, uri)
|
||||
#define NS_TIMELINE_MARK_FUNCTION(timer)
|
||||
#define NS_TIMELINE_TIME_FUNCTION(timer)
|
||||
#define NS_TIMELINE_MARK_CHANNEL(text, channel)
|
||||
#define NS_TIMELINE_MARK_LOADER(text, loader);
|
||||
#endif /* defined(MOZ_TIMELINE) */
|
||||
%}
|
@ -1,574 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsTimelineService.h"
|
||||
#include "prlong.h"
|
||||
#include "prprf.h"
|
||||
#include "prenv.h"
|
||||
#include "plhash.h"
|
||||
#include "prlock.h"
|
||||
#include "prinit.h"
|
||||
#include "prinrval.h"
|
||||
#include "prthread.h"
|
||||
|
||||
#ifdef MOZ_TIMELINE
|
||||
|
||||
#define MAXINDENT 20
|
||||
|
||||
static PRFileDesc *timelineFD = PR_STDERR;
|
||||
static PRBool gTimelineDisabled = PR_TRUE;
|
||||
|
||||
// Notes about threading:
|
||||
// We avoid locks as we always use thread-local-storage.
|
||||
// This means every other thread has its own private copy of
|
||||
// data, and this thread can't re-enter (as our implemenation
|
||||
// doesn't call back out anywhere). Thus, we can avoid locks!
|
||||
// TLS index
|
||||
static const PRUintn BAD_TLS_INDEX = (PRUintn) -1;
|
||||
static PRUintn gTLSIndex = BAD_TLS_INDEX;
|
||||
|
||||
class TimelineThreadData {
|
||||
public:
|
||||
TimelineThreadData() : initTime(0), indent(0),
|
||||
disabled(PR_TRUE), timers(nsnull) {}
|
||||
~TimelineThreadData() {if (timers) PL_HashTableDestroy(timers);}
|
||||
PRTime initTime;
|
||||
PRHashTable *timers;
|
||||
int indent;
|
||||
PRBool disabled;
|
||||
};
|
||||
|
||||
/* Implementation file */
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsTimelineService, nsITimelineService)
|
||||
|
||||
/*
|
||||
* Timer structure stored in a hash table to keep track of named
|
||||
* timers.
|
||||
*/
|
||||
class nsTimelineServiceTimer {
|
||||
public:
|
||||
nsTimelineServiceTimer();
|
||||
~nsTimelineServiceTimer();
|
||||
void start();
|
||||
|
||||
/*
|
||||
* Caller passes in "now" rather than having us calculate it so
|
||||
* that we can avoid including timer overhead in the time being
|
||||
* measured.
|
||||
*/
|
||||
void stop(PRTime now);
|
||||
void reset();
|
||||
PRTime getAccum();
|
||||
PRTime getAccum(PRTime now);
|
||||
|
||||
private:
|
||||
PRTime mAccum;
|
||||
PRTime mStart;
|
||||
PRInt32 mRunning;
|
||||
PRThread *mOwnerThread; // only used for asserts - could be #if MOZ_DEBUG
|
||||
};
|
||||
|
||||
#define TIMER_CHECK_OWNER() \
|
||||
NS_ABORT_IF_FALSE(PR_GetCurrentThread() == mOwnerThread, \
|
||||
"Timer used by non-owning thread")
|
||||
|
||||
|
||||
nsTimelineServiceTimer::nsTimelineServiceTimer()
|
||||
: mAccum(LL_ZERO), mStart(LL_ZERO), mRunning(0),
|
||||
mOwnerThread(PR_GetCurrentThread())
|
||||
{
|
||||
}
|
||||
|
||||
nsTimelineServiceTimer::~nsTimelineServiceTimer()
|
||||
{
|
||||
}
|
||||
|
||||
void nsTimelineServiceTimer::start()
|
||||
{
|
||||
TIMER_CHECK_OWNER();
|
||||
if (!mRunning) {
|
||||
mStart = PR_Now();
|
||||
}
|
||||
mRunning++;
|
||||
}
|
||||
|
||||
void nsTimelineServiceTimer::stop(PRTime now)
|
||||
{
|
||||
TIMER_CHECK_OWNER();
|
||||
mRunning--;
|
||||
if (mRunning == 0) {
|
||||
PRTime delta, accum;
|
||||
LL_SUB(delta, now, mStart);
|
||||
LL_ADD(accum, mAccum, delta);
|
||||
mAccum = accum;
|
||||
}
|
||||
}
|
||||
|
||||
void nsTimelineServiceTimer::reset()
|
||||
{
|
||||
TIMER_CHECK_OWNER();
|
||||
mStart = 0;
|
||||
mAccum = 0;
|
||||
}
|
||||
|
||||
PRTime nsTimelineServiceTimer::getAccum()
|
||||
{
|
||||
TIMER_CHECK_OWNER();
|
||||
PRTime accum;
|
||||
|
||||
if (!mRunning) {
|
||||
accum = mAccum;
|
||||
} else {
|
||||
PRTime delta;
|
||||
LL_SUB(delta, PR_Now(), mStart);
|
||||
LL_ADD(accum, mAccum, delta);
|
||||
}
|
||||
return accum;
|
||||
}
|
||||
|
||||
PRTime nsTimelineServiceTimer::getAccum(PRTime now)
|
||||
{
|
||||
TIMER_CHECK_OWNER();
|
||||
PRTime accum;
|
||||
|
||||
if (!mRunning) {
|
||||
accum = mAccum;
|
||||
} else {
|
||||
PRTime delta;
|
||||
LL_SUB(delta, now, mStart);
|
||||
LL_ADD(accum, mAccum, delta);
|
||||
}
|
||||
return accum;
|
||||
}
|
||||
|
||||
static TimelineThreadData *GetThisThreadData()
|
||||
{
|
||||
NS_ABORT_IF_FALSE(gTLSIndex!=BAD_TLS_INDEX, "Our TLS not initialized");
|
||||
TimelineThreadData *new_data = nsnull;
|
||||
TimelineThreadData *data = (TimelineThreadData *)PR_GetThreadPrivate(gTLSIndex);
|
||||
if (data == nsnull) {
|
||||
// First request for this thread - allocate it.
|
||||
new_data = new TimelineThreadData();
|
||||
if (!new_data)
|
||||
goto done;
|
||||
|
||||
// Fill it
|
||||
new_data->timers = PL_NewHashTable(100, PL_HashString, PL_CompareStrings,
|
||||
PL_CompareValues, NULL, NULL);
|
||||
if (new_data->timers==NULL)
|
||||
goto done;
|
||||
new_data->initTime = PR_Now();
|
||||
NS_ASSERTION(!gTimelineDisabled,
|
||||
"Why are we creating new state when disabled?");
|
||||
new_data->disabled = PR_FALSE;
|
||||
data = new_data;
|
||||
new_data = nsnull;
|
||||
PR_SetThreadPrivate(gTLSIndex, data);
|
||||
}
|
||||
done:
|
||||
if (new_data) // eeek - error during creation!
|
||||
delete new_data;
|
||||
NS_ASSERTION(data, "TimelineService could not get thread-local data");
|
||||
return data;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
static void ThreadDestruct (void *data);
|
||||
static PRStatus TimelineInit(void);
|
||||
}
|
||||
|
||||
void ThreadDestruct( void *data )
|
||||
{
|
||||
if (data)
|
||||
delete (TimelineThreadData *)data;
|
||||
}
|
||||
|
||||
/*
|
||||
* PRCallOnceFN that initializes stuff for the timing service.
|
||||
*/
|
||||
static PRCallOnceType initonce;
|
||||
|
||||
PRStatus TimelineInit(void)
|
||||
{
|
||||
char *timeStr;
|
||||
char *fileName;
|
||||
const char *timelineEnable;
|
||||
PRInt32 secs, msecs;
|
||||
PRFileDesc *fd;
|
||||
PRInt64 tmp1, tmp2;
|
||||
|
||||
PRStatus status = PR_NewThreadPrivateIndex( &gTLSIndex, ThreadDestruct );
|
||||
NS_ASSERTION(status==0, "TimelineService could not allocate TLS storage.");
|
||||
|
||||
timeStr = PR_GetEnv("NS_TIMELINE_INIT_TIME");
|
||||
// NS_TIMELINE_INIT_TIME only makes sense for the main thread, so if it
|
||||
// exists, set it there. If not, let normal thread management code take
|
||||
// care of setting the init time.
|
||||
if (timeStr && *timeStr && (2 == PR_sscanf(timeStr, "%d.%d", &secs, &msecs))) {
|
||||
PRTime &initTime = GetThisThreadData()->initTime;
|
||||
LL_MUL(tmp1, (PRInt64)secs, 1000000);
|
||||
LL_MUL(tmp2, (PRInt64)msecs, 1000);
|
||||
LL_ADD(initTime, tmp1, tmp2);
|
||||
}
|
||||
|
||||
// Get the log file.
|
||||
fileName = PR_GetEnv("NS_TIMELINE_LOG_FILE");
|
||||
if (fileName && *fileName
|
||||
&& (fd = PR_Open(fileName, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE,
|
||||
0666)) != NULL) {
|
||||
timelineFD = fd;
|
||||
PR_fprintf(fd,
|
||||
"NOTE: due to asynchrony, the indentation that you see does"
|
||||
" not necessarily correspond to nesting in the code.\n\n");
|
||||
}
|
||||
|
||||
// Runtime disable of timeline
|
||||
timelineEnable = PR_GetEnv("NS_TIMELINE_ENABLE");
|
||||
if (timelineEnable && *timelineEnable)
|
||||
gTimelineDisabled = PR_FALSE;
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
static void ParseTime(PRTime tm, PRInt32& secs, PRInt32& msecs)
|
||||
{
|
||||
PRTime llsecs, llmsecs, tmp;
|
||||
|
||||
LL_DIV(llsecs, tm, 1000000);
|
||||
LL_MOD(tmp, tm, 1000000);
|
||||
LL_DIV(llmsecs, tmp, 1000);
|
||||
|
||||
LL_L2I(secs, llsecs);
|
||||
LL_L2I(msecs, llmsecs);
|
||||
}
|
||||
|
||||
static char *Indent(char *buf)
|
||||
{
|
||||
int &indent = GetThisThreadData()->indent;
|
||||
int amount = indent;
|
||||
if (amount > MAXINDENT) {
|
||||
amount = MAXINDENT;
|
||||
}
|
||||
if (amount < 0) {
|
||||
amount = 0;
|
||||
indent = 0;
|
||||
PR_Write(timelineFD, "indent underflow!\n", 18);
|
||||
}
|
||||
while (amount--) {
|
||||
*buf++ = ' ';
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void PrintTime(PRTime tm, const char *text, va_list args)
|
||||
{
|
||||
PRInt32 secs, msecs;
|
||||
char pbuf[550], *pc, tbuf[550];
|
||||
|
||||
ParseTime(tm, secs, msecs);
|
||||
|
||||
// snprintf/write rather than fprintf because we don't want
|
||||
// messages from multiple threads to garble one another.
|
||||
pc = Indent(pbuf);
|
||||
PR_vsnprintf(pc, sizeof pbuf - (pc - pbuf), text, args);
|
||||
PR_snprintf(tbuf, sizeof tbuf, "%05d.%03d (%08p): %s\n",
|
||||
secs, msecs, PR_GetCurrentThread(), pbuf);
|
||||
PR_Write(timelineFD, tbuf, strlen(tbuf));
|
||||
}
|
||||
|
||||
/*
|
||||
* Make this public if we need it.
|
||||
*/
|
||||
static nsresult NS_TimelineMarkV(const char *text, va_list args)
|
||||
{
|
||||
PRTime elapsed,tmp;
|
||||
|
||||
PR_CallOnce(&initonce, TimelineInit);
|
||||
|
||||
TimelineThreadData *thread = GetThisThreadData();
|
||||
|
||||
tmp = PR_Now();
|
||||
LL_SUB(elapsed, tmp, thread->initTime);
|
||||
|
||||
PrintTime(elapsed, text, args);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsresult) NS_TimelineForceMark(const char *text, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, text);
|
||||
NS_TimelineMarkV(text, args);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsresult) NS_TimelineMark(const char *text, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, text);
|
||||
|
||||
PR_CallOnce(&initonce, TimelineInit);
|
||||
|
||||
if (gTimelineDisabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
TimelineThreadData *thread = GetThisThreadData();
|
||||
|
||||
if (thread->disabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
NS_TimelineMarkV(text, args);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsresult) NS_TimelineStartTimer(const char *timerName)
|
||||
{
|
||||
PR_CallOnce(&initonce, TimelineInit);
|
||||
|
||||
if (gTimelineDisabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
TimelineThreadData *thread = GetThisThreadData();
|
||||
|
||||
if (thread->timers == NULL)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (thread->disabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
nsTimelineServiceTimer *timer
|
||||
= (nsTimelineServiceTimer *)PL_HashTableLookup(thread->timers, timerName);
|
||||
if (timer == NULL) {
|
||||
timer = new nsTimelineServiceTimer;
|
||||
if (!timer)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
PL_HashTableAdd(thread->timers, timerName, timer);
|
||||
}
|
||||
timer->start();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsresult) NS_TimelineStopTimer(const char *timerName)
|
||||
{
|
||||
if (gTimelineDisabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
/*
|
||||
* Strange-looking now/timer->stop() interaction is to avoid
|
||||
* including time spent in TLS and PL_HashTableLookup in the
|
||||
* timer.
|
||||
*/
|
||||
PRTime now = PR_Now();
|
||||
|
||||
TimelineThreadData *thread = GetThisThreadData();
|
||||
if (thread->timers == NULL)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (thread->disabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
nsTimelineServiceTimer *timer
|
||||
= (nsTimelineServiceTimer *)PL_HashTableLookup(thread->timers, timerName);
|
||||
if (timer == NULL) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
timer->stop(now);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsresult) NS_TimelineMarkTimer(const char *timerName, const char *str)
|
||||
{
|
||||
PR_CallOnce(&initonce, TimelineInit);
|
||||
|
||||
if (gTimelineDisabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
TimelineThreadData *thread = GetThisThreadData();
|
||||
if (thread->timers == NULL)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (thread->disabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
nsTimelineServiceTimer *timer
|
||||
= (nsTimelineServiceTimer *)PL_HashTableLookup(thread->timers, timerName);
|
||||
if (timer == NULL) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
PRTime accum = timer->getAccum();
|
||||
|
||||
char buf[500];
|
||||
PRInt32 sec, msec;
|
||||
ParseTime(accum, sec, msec);
|
||||
if (!str)
|
||||
PR_snprintf(buf, sizeof buf, "%s total: %d.%03d",
|
||||
timerName, sec, msec);
|
||||
else
|
||||
PR_snprintf(buf, sizeof buf, "%s total: %d.%03d (%s)",
|
||||
timerName, sec, msec, str);
|
||||
NS_TimelineMark(buf);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsresult) NS_TimelineResetTimer(const char *timerName)
|
||||
{
|
||||
if (gTimelineDisabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
TimelineThreadData *thread = GetThisThreadData();
|
||||
if (thread->timers == NULL)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (thread->disabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
nsTimelineServiceTimer *timer
|
||||
= (nsTimelineServiceTimer *)PL_HashTableLookup(thread->timers, timerName);
|
||||
if (timer == NULL) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
timer->reset();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsresult) NS_TimelineIndent()
|
||||
{
|
||||
if (gTimelineDisabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
TimelineThreadData *thread = GetThisThreadData();
|
||||
if (thread->disabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
thread->indent++;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsresult) NS_TimelineOutdent()
|
||||
{
|
||||
if (gTimelineDisabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
TimelineThreadData *thread = GetThisThreadData();
|
||||
if (thread->disabled)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
thread->indent--;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsresult) NS_TimelineEnter(const char *text)
|
||||
{
|
||||
nsresult rv = NS_TimelineMark("%s...", text);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
return NS_TimelineIndent();
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsresult) NS_TimelineLeave(const char *text)
|
||||
{
|
||||
nsresult rv = NS_TimelineOutdent();
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
return NS_TimelineMark("...%s", text);
|
||||
}
|
||||
|
||||
nsTimelineService::nsTimelineService()
|
||||
{
|
||||
/* member initializers and constructor code */
|
||||
}
|
||||
|
||||
/* void mark (in string text); */
|
||||
NS_IMETHODIMP nsTimelineService::Mark(const char *text)
|
||||
{
|
||||
return NS_TimelineMark(text);
|
||||
}
|
||||
|
||||
/* void startTimer (in string timerName); */
|
||||
NS_IMETHODIMP nsTimelineService::StartTimer(const char *timerName)
|
||||
{
|
||||
return NS_TimelineStartTimer(timerName);
|
||||
}
|
||||
|
||||
/* void stopTimer (in string timerName); */
|
||||
NS_IMETHODIMP nsTimelineService::StopTimer(const char *timerName)
|
||||
{
|
||||
return NS_TimelineStopTimer(timerName);
|
||||
}
|
||||
|
||||
/* void markTimer (in string timerName); */
|
||||
NS_IMETHODIMP nsTimelineService::MarkTimer(const char *timerName)
|
||||
{
|
||||
return NS_TimelineMarkTimer(timerName);
|
||||
}
|
||||
|
||||
/* void markTimerWithComment(in string timerName, in string comment); */
|
||||
NS_IMETHODIMP nsTimelineService::MarkTimerWithComment(const char *timerName, const char *comment)
|
||||
{
|
||||
return NS_TimelineMarkTimer(timerName, comment);
|
||||
}
|
||||
|
||||
/* void resetTimer (in string timerName); */
|
||||
NS_IMETHODIMP nsTimelineService::ResetTimer(const char *timerName)
|
||||
{
|
||||
return NS_TimelineResetTimer(timerName);
|
||||
}
|
||||
|
||||
/* void indent (); */
|
||||
NS_IMETHODIMP nsTimelineService::Indent()
|
||||
{
|
||||
return NS_TimelineIndent();
|
||||
}
|
||||
|
||||
/* void outdent (); */
|
||||
NS_IMETHODIMP nsTimelineService::Outdent()
|
||||
{
|
||||
return NS_TimelineOutdent();
|
||||
}
|
||||
|
||||
/* void enter (in string text); */
|
||||
NS_IMETHODIMP nsTimelineService::Enter(const char *text)
|
||||
{
|
||||
return NS_TimelineEnter(text);
|
||||
}
|
||||
|
||||
/* void leave (in string text); */
|
||||
NS_IMETHODIMP nsTimelineService::Leave(const char *text)
|
||||
{
|
||||
return NS_TimelineLeave(text);
|
||||
}
|
||||
|
||||
#endif /* MOZ_TIMELINE */
|
@ -1,64 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
#ifdef MOZ_TIMELINE
|
||||
|
||||
#define NS_TIMELINESERVICE_CID \
|
||||
{ /* a335edf0-3daf-11d5-b67d-000064657374 */ \
|
||||
0xa335edf0, \
|
||||
0x3daf, \
|
||||
0x11d5, \
|
||||
{0xb6, 0x7d, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
|
||||
|
||||
#define NS_TIMELINESERVICE_CONTRACTID "@mozilla.org;timeline-service;1"
|
||||
#define NS_TIMELINESERVICE_CLASSNAME "Timeline Service"
|
||||
|
||||
class nsTimelineService : public nsITimelineService
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSITIMELINESERVICE
|
||||
|
||||
nsTimelineService();
|
||||
|
||||
private:
|
||||
~nsTimelineService() {}
|
||||
};
|
||||
|
||||
#endif
|
@ -88,7 +88,6 @@
|
||||
#include "prproces.h"
|
||||
#include "nsIDirectoryEnumerator.h"
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
#ifdef MOZ_WIDGET_GTK2
|
||||
#include "nsIGIOService.h"
|
||||
@ -1689,8 +1688,6 @@ nsLocalFile::Load(PRLibrary **_retval)
|
||||
CHECK_mPath();
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
||||
NS_TIMELINE_START_TIMER("PR_LoadLibrary");
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
nsTraceRefcntImpl::SetActivityIsLegal(PR_FALSE);
|
||||
#endif
|
||||
@ -1701,9 +1698,6 @@ nsLocalFile::Load(PRLibrary **_retval)
|
||||
nsTraceRefcntImpl::SetActivityIsLegal(PR_TRUE);
|
||||
#endif
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("PR_LoadLibrary");
|
||||
NS_TIMELINE_MARK_TIMER1("PR_LoadLibrary", mPath.get());
|
||||
|
||||
if (!*_retval)
|
||||
return NS_ERROR_FAILURE;
|
||||
return NS_OK;
|
||||
|
@ -75,7 +75,6 @@
|
||||
|
||||
#include "nsXPIDLString.h"
|
||||
#include "prproces.h"
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
#include "mozilla/Mutex.h"
|
||||
#include "SpecialSystemDirectory.h"
|
||||
@ -1737,8 +1736,6 @@ nsLocalFile::Load(PRLibrary * *_retval)
|
||||
if (! isFile)
|
||||
return NS_ERROR_FILE_IS_DIRECTORY;
|
||||
|
||||
NS_TIMELINE_START_TIMER("PR_LoadLibraryWithFlags");
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
nsTraceRefcntImpl::SetActivityIsLegal(PR_FALSE);
|
||||
#endif
|
||||
@ -1752,10 +1749,6 @@ nsLocalFile::Load(PRLibrary * *_retval)
|
||||
nsTraceRefcntImpl::SetActivityIsLegal(PR_TRUE);
|
||||
#endif
|
||||
|
||||
NS_TIMELINE_STOP_TIMER("PR_LoadLibraryWithFlags");
|
||||
NS_TIMELINE_MARK_TIMER1("PR_LoadLibraryWithFlags",
|
||||
NS_ConvertUTF16toUTF8(mResolvedPath).get());
|
||||
|
||||
if (*_retval)
|
||||
return NS_OK;
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
@ -57,7 +57,6 @@
|
||||
|
||||
#include "nsIEnumerator.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "prprf.h"
|
||||
|
||||
#include "nsWidgetsCID.h"
|
||||
|
@ -81,7 +81,6 @@
|
||||
#include "nsIWindowWatcher.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsAppShellCID.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsStyleConsts.h"
|
||||
@ -792,15 +791,12 @@ NS_IMETHODIMP nsXULWindow::GetVisibility(PRBool* aVisibility)
|
||||
|
||||
NS_IMETHODIMP nsXULWindow::SetVisibility(PRBool aVisibility)
|
||||
{
|
||||
NS_TIMELINE_ENTER("nsXULWindow::SetVisibility.");
|
||||
if (!mChromeLoaded) {
|
||||
mShowAfterLoad = aVisibility;
|
||||
NS_TIMELINE_LEAVE("nsXULWindow::SetVisibility");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (mDebuting) {
|
||||
NS_TIMELINE_LEAVE("nsXULWindow::SetVisibility");
|
||||
return NS_OK;
|
||||
}
|
||||
mDebuting = PR_TRUE; // (Show / Focus is recursive)
|
||||
@ -829,7 +825,6 @@ NS_IMETHODIMP nsXULWindow::SetVisibility(PRBool aVisibility)
|
||||
}
|
||||
|
||||
mDebuting = PR_FALSE;
|
||||
NS_TIMELINE_LEAVE("nsXULWindow::SetVisibility");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1748,7 +1743,6 @@ NS_IMETHODIMP nsXULWindow::CreateNewWindow(PRInt32 aChromeFlags,
|
||||
NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags,
|
||||
nsIAppShell* aAppShell, nsIXULWindow **_retval)
|
||||
{
|
||||
NS_TIMELINE_ENTER("nsXULWindow::CreateNewChromeWindow");
|
||||
nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
|
||||
NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE);
|
||||
|
||||
@ -1765,15 +1759,12 @@ NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags,
|
||||
*_retval = newWindow;
|
||||
NS_ADDREF(*_retval);
|
||||
|
||||
NS_TIMELINE_LEAVE("nsXULWindow::CreateNewChromeWindow done");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(PRInt32 aChromeFlags,
|
||||
nsIAppShell* aAppShell, nsIXULWindow **_retval)
|
||||
{
|
||||
NS_TIMELINE_ENTER("nsXULWindow::CreateNewContentWindow");
|
||||
|
||||
nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
|
||||
NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE);
|
||||
|
||||
@ -1827,7 +1818,6 @@ NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(PRInt32 aChromeFlags,
|
||||
*_retval = newWindow;
|
||||
NS_ADDREF(*_retval);
|
||||
|
||||
NS_TIMELINE_LEAVE("nsXULWindow::CreateNewContentWindow");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user