зеркало из https://github.com/mozilla/gecko-dev.git
Bug 729182 - Implement visual event tracer, dns instrumentation, r=sworkman
This commit is contained in:
Родитель
7c36b706a6
Коммит
cef3387a8a
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "mozilla/FunctionTimer.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/VisualEventTracer.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -278,6 +279,8 @@ nsDNSAsyncRequest::OnLookupComplete(nsHostResolver *resolver,
|
|||
status = NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
MOZ_EVENT_TRACER_DONE(this, "DNS");
|
||||
|
||||
mListener->OnLookupComplete(this, rec, status);
|
||||
mListener = nsnull;
|
||||
|
||||
|
@ -605,6 +608,9 @@ nsDNSService::AsyncResolve(const nsACString &hostname,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(*result = req);
|
||||
|
||||
MOZ_EVENT_TRACER_NAME_OBJECT(req, hostname.BeginReading());
|
||||
MOZ_EVENT_TRACER_WAIT(req, "DNS");
|
||||
|
||||
// addref for resolver; will be released when OnLookupComplete is called.
|
||||
NS_ADDREF(req);
|
||||
rv = res->ResolveHost(req->mHost.get(), flags, af, req);
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "mozilla/FunctionTimer.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/VisualEventTracer.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -180,6 +181,8 @@ nsHostRecord::Create(const nsHostKey *key, nsHostRecord **result)
|
|||
void *place = ::operator new(size);
|
||||
*result = new(place) nsHostRecord(key);
|
||||
NS_ADDREF(*result);
|
||||
|
||||
MOZ_EVENT_TRACER_NAME_OBJECT(*result, key->host);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -712,6 +715,8 @@ nsHostResolver::ConditionallyCreateThread(nsHostRecord *rec)
|
|||
nsresult
|
||||
nsHostResolver::IssueLookup(nsHostRecord *rec)
|
||||
{
|
||||
MOZ_EVENT_TRACER_WAIT(rec, "nsHostResolver");
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
NS_ASSERTION(!rec->resolving, "record is already being resolved");
|
||||
|
||||
|
@ -889,6 +894,8 @@ nsHostResolver::OnLookupComplete(nsHostRecord *rec, nsresult status, PRAddrInfo
|
|||
}
|
||||
}
|
||||
|
||||
MOZ_EVENT_TRACER_DONE(rec, "nsHostResolver");
|
||||
|
||||
if (!PR_CLIST_IS_EMPTY(&cbs)) {
|
||||
PRCList *node = cbs.next;
|
||||
while (node != &cbs) {
|
||||
|
@ -972,6 +979,7 @@ nsHostResolver::ThreadFunc(void *arg)
|
|||
|
||||
TimeStamp startTime = TimeStamp::Now();
|
||||
|
||||
MOZ_EVENT_TRACER_EXEC(rec, "nsHostResolver");
|
||||
ai = PR_GetAddrInfoByName(rec->host, rec->af, flags);
|
||||
#if defined(RES_RETRY_ON_FAILURE)
|
||||
if (!ai && rs.Reset())
|
||||
|
|
Загрузка…
Ссылка в новой задаче