Skip to content

Commit

Permalink
Bug 1375387 - Reorder and section-ify GeckoProfiler.h. r=mstange.
Browse files Browse the repository at this point in the history
This patch gives some structure and order to the profiler's API.

It also renames AutoProfilerRegister as AutoProfilerRegisterThread, to match
profiler_register_thread().
  • Loading branch information
nnethercote committed Jun 22, 2017
1 parent a53a350 commit 033f831
Show file tree
Hide file tree
Showing 14 changed files with 279 additions and 241 deletions.
2 changes: 1 addition & 1 deletion dom/media/webaudio/blink/HRTFDatabaseLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void HRTFDatabaseLoader::MainThreadRelease()
// Asynchronously load the database in this thread.
static void databaseLoaderEntry(void* threadData)
{
AutoProfilerRegister registerThread("HRTFDatabaseLdr");
AutoProfilerRegisterThread registerThread("HRTFDatabaseLdr");
NS_SetCurrentThreadName("HRTFDatabaseLdr");

HRTFDatabaseLoader* loader = reinterpret_cast<HRTFDatabaseLoader*>(threadData);
Expand Down
2 changes: 1 addition & 1 deletion dom/storage/StorageDBThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ StorageDBThread::SetDefaultPriority()
void
StorageDBThread::ThreadFunc(void* aArg)
{
AutoProfilerRegister registerThread("localStorage DB");
AutoProfilerRegisterThread registerThread("localStorage DB");
NS_SetCurrentThreadName("localStorage DB");
mozilla::IOInterposer::RegisterCurrentThread();

Expand Down
2 changes: 1 addition & 1 deletion ipc/chromium/src/base/thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void Thread::StopSoon() {
}

void Thread::ThreadMain() {
mozilla::AutoProfilerRegister registerThread(name_.c_str());
mozilla::AutoProfilerRegisterThread registerThread(name_.c_str());
mozilla::IOInterposer::RegisterCurrentThread();

// The message loop for this thread.
Expand Down
2 changes: 1 addition & 1 deletion js/xpconnect/src/XPCJSContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ AutoLockWatchdog::~AutoLockWatchdog()
static void
WatchdogMain(void* arg)
{
mozilla::AutoProfilerRegister registerThread("JS Watchdog");
mozilla::AutoProfilerRegisterThread registerThread("JS Watchdog");
NS_SetCurrentThreadName("JS Watchdog");

Watchdog* self = static_cast<Watchdog*>(arg);
Expand Down
2 changes: 1 addition & 1 deletion security/manager/ssl/nsKeygenThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ nsresult nsKeygenThread::ConsumeResult(

static void nsKeygenThreadRunner(void *arg)
{
AutoProfilerRegister registerThread("Keygen");
AutoProfilerRegisterThread registerThread("Keygen");
NS_SetCurrentThreadName("Keygen");
nsKeygenThread *self = static_cast<nsKeygenThread *>(arg);
self->Run();
Expand Down
2 changes: 1 addition & 1 deletion security/manager/ssl/nsProtectedAuthThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ NS_IMPL_ISUPPORTS(nsProtectedAuthThread, nsIProtectedAuthThread)

static void nsProtectedAuthThreadRunner(void *arg)
{
AutoProfilerRegister registerThread("Protected Auth");
AutoProfilerRegisterThread registerThread("Protected Auth");
NS_SetCurrentThreadName("Protected Auth");

nsProtectedAuthThread *self = static_cast<nsProtectedAuthThread *>(arg);
Expand Down
2 changes: 1 addition & 1 deletion security/manager/ssl/nsSmartCardMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ const SECMODModule* SmartCardMonitoringThread::GetModule()
// C-like calling sequence to glue into PR_CreateThread.
void SmartCardMonitoringThread::LaunchExecute(void* arg)
{
AutoProfilerRegister registerThread("SmartCard");
AutoProfilerRegisterThread registerThread("SmartCard");
NS_SetCurrentThreadName("SmartCard");

((SmartCardMonitoringThread*)arg)->Execute();
Expand Down
2 changes: 1 addition & 1 deletion startupcache/StartupCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ StartupCache::WaitOnWriteThread()
void
StartupCache::ThreadedWrite(void *aClosure)
{
AutoProfilerRegister registerThread("StartupCache");
AutoProfilerRegisterThread registerThread("StartupCache");
NS_SetCurrentThreadName("StartupCache");
mozilla::IOInterposer::RegisterCurrentThread();
/*
Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/terminator/nsTerminator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ PRMonitor* gWriteReady = nullptr;

void RunWriter(void* arg)
{
AutoProfilerRegister registerThread("Shutdown Statistics Writer");
AutoProfilerRegisterThread registerThread("Shutdown Statistics Writer");
NS_SetCurrentThreadName("Shutdown Statistics Writer");

MOZ_LSAN_INTENTIONALLY_LEAK_OBJECT(arg);
Expand Down
2 changes: 1 addition & 1 deletion toolkit/xre/EventTracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class EventLoopLagDispatcher : public Runnable
*/
void TracerThread(void *arg)
{
AutoProfilerRegister registerThread("Event Tracer");
AutoProfilerRegisterThread registerThread("Event Tracer");
NS_SetCurrentThreadName("Event Tracer");

TracerStartClosure* threadArgs = static_cast<TracerStartClosure*>(arg);
Expand Down
Loading

0 comments on commit 033f831

Please sign in to comment.