Skip to content

Commit

Permalink
Bug 1799109 - Replace AUTO_PROFILER_MARKER_TEXT markers without a tex…
Browse files Browse the repository at this point in the history
…t with the new untyped one r=profiler-reviewers,florian

Differential Revision: https://phabricator.services.mozilla.com/D238121
  • Loading branch information
canova committed Feb 27, 2025
1 parent 4d37f13 commit 964d9b0
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 34 deletions.
3 changes: 1 addition & 2 deletions accessible/base/NotificationController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,7 @@ void NotificationController::ProcessMutationEvents() {
// NotificationCollector: private

void NotificationController::WillRefresh(mozilla::TimeStamp aTime) {
AUTO_PROFILER_MARKER_TEXT("NotificationController::WillRefresh", A11Y, {},
""_ns);
AUTO_PROFILER_MARKER_UNTYPED("NotificationController::WillRefresh", A11Y, {});
auto timer = glean::a11y::tree_update_timing.Measure();
// DO NOT ADD CODE ABOVE THIS BLOCK: THIS CODE IS MEASURING TIMINGS.

Expand Down
2 changes: 1 addition & 1 deletion accessible/base/nsAccessibilityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ mozilla::Monitor& nsAccessibilityService::GetAndroidMonitor() {
// nsAccessibilityService private

bool nsAccessibilityService::Init(uint64_t aCacheDomains) {
AUTO_PROFILER_MARKER_TEXT("nsAccessibilityService::Init", A11Y, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("nsAccessibilityService::Init", A11Y, {});
// DO NOT ADD CODE ABOVE HERE: THIS CODE IS MEASURING TIMINGS.

// Initialize accessible document manager.
Expand Down
6 changes: 3 additions & 3 deletions accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1602,8 +1602,8 @@ void DocAccessible::ProcessInvalidationList() {
}

void DocAccessible::ProcessQueuedCacheUpdates(uint64_t aInitialDomains) {
AUTO_PROFILER_MARKER_TEXT("DocAccessible::ProcessQueuedCacheUpdates", A11Y,
{}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("DocAccessible::ProcessQueuedCacheUpdates", A11Y,
{});
PerfStats::AutoMetricRecording<
PerfStats::Metric::A11Y_ProcessQueuedCacheUpdate>
autoRecording;
Expand Down Expand Up @@ -1712,7 +1712,7 @@ void DocAccessible::NotifyOfLoading(bool aIsReloading) {
}

void DocAccessible::DoInitialUpdate() {
AUTO_PROFILER_MARKER_TEXT("DocAccessible::DoInitialUpdate", A11Y, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("DocAccessible::DoInitialUpdate", A11Y, {});
PerfStats::AutoMetricRecording<PerfStats::Metric::A11Y_DoInitialUpdate>
autoRecording;
// DO NOT ADD CODE ABOVE THIS BLOCK: THIS CODE IS MEASURING TIMINGS.
Expand Down
6 changes: 3 additions & 3 deletions dom/docs/workersAndStorage/PerformanceTesting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ succeed.
Profiler Markers
================

Profiler markers can be used to collect timing data. Markers of known name can be inspected from the perftest. AUTO_PROFILER_MARKER_TEXT must be used, as we need both the start-time and end-time of the marker. For example:
Profiler markers can be used to collect timing data. Markers of known name can be inspected from the perftest. AUTO_PROFILER_MARKER_UNTYPED must be used, as we need both the start-time and end-time of the marker. For example:

.. code-block:: cpp
AUTO_PROFILER_MARKER_TEXT("interesting thing #1", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_TEXT("interesting thing #2", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("interesting thing #1", DOM, {};
AUTO_PROFILER_MARKER_UNTYPED("interesting thing #2", DOM, {});
can be inspected from the perftest:

Expand Down
11 changes: 5 additions & 6 deletions dom/ipc/ProcessHangMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,12 @@ bool HangMonitorChild::InterruptCallback() {
if (browserChild) {
js::AutoAssertNoContentJS nojs(mContext);
if (paintWhileInterruptingJS.value()) {
AUTO_PROFILER_MARKER_TEXT("InterruptCallback: PaintWhileInterruptingJS",
DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED(
"InterruptCallback: PaintWhileInterruptingJS", DOM, {});
browserChild->PaintWhileInterruptingJS();
} else {
AUTO_PROFILER_MARKER_TEXT(
"InterruptCallback: UnloadLayersWhileInterruptingJS", DOM, {},
""_ns);
AUTO_PROFILER_MARKER_UNTYPED(
"InterruptCallback: UnloadLayersWhileInterruptingJS", DOM, {});
browserChild->UnloadLayersWhileInterruptingJS();
}
}
Expand Down Expand Up @@ -597,7 +596,7 @@ mozilla::ipc::IPCResult HangMonitorChild::RecvEndStartingDebugger() {

mozilla::ipc::IPCResult HangMonitorChild::RecvPaintWhileInterruptingJS(
const TabId& aTabId) {
PROFILER_MARKER_TEXT("PaintWhileInterruptingJS", DOM, {}, ""_ns);
PROFILER_MARKER_UNTYPED("PaintWhileInterruptingJS", DOM, {});
MOZ_RELEASE_ASSERT(IsOnThread());

{
Expand Down
4 changes: 2 additions & 2 deletions dom/script/ScriptCompression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ bool ScriptBytecodeCompress(Vector<uint8_t>& aBytecodeBuf,
Vector<uint8_t>& aCompressedBytecodeBufOut) {
// TODO probably need to move this to a helper thread

AUTO_PROFILER_MARKER_TEXT("ScriptBytecodeCompress", JS, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("ScriptBytecodeCompress", JS, {});
PerfStats::AutoMetricRecording<PerfStats::Metric::JSBC_Compression>
autoRecording;

Expand Down Expand Up @@ -133,7 +133,7 @@ bool ScriptBytecodeCompress(Vector<uint8_t>& aBytecodeBuf,
bool ScriptBytecodeDecompress(Vector<uint8_t>& aCompressedBytecodeBuf,
size_t aBytecodeOffset,
Vector<uint8_t>& aBytecodeBufOut) {
AUTO_PROFILER_MARKER_TEXT("ScriptBytecodeDecompress", JS, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("ScriptBytecodeDecompress", JS, {});
PerfStats::AutoMetricRecording<PerfStats::Metric::JSBC_Decompression>
autoRecording;

Expand Down
3 changes: 1 addition & 2 deletions dom/serviceworkers/ServiceWorkerActors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ void InitServiceWorkerRegistrationParent(
PServiceWorkerRegistrationParent* aActor,
const IPCServiceWorkerRegistrationDescriptor& aDescriptor,
const IPCClientInfo& aForClient) {
AUTO_PROFILER_MARKER_TEXT("InitServiceWorkerRegistrationParent", DOM, {},
""_ns);
AUTO_PROFILER_MARKER_UNTYPED("InitServiceWorkerRegistrationParent", DOM, {});
auto actor = static_cast<ServiceWorkerRegistrationParent*>(aActor);
actor->Init(aDescriptor, aForClient);
}
Expand Down
4 changes: 2 additions & 2 deletions dom/serviceworkers/ServiceWorkerContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ already_AddRefed<Promise> ServiceWorkerContainer::Register(
const TrustedScriptURLOrUSVString& aScriptURL,
const RegistrationOptions& aOptions, const CallerType aCallerType,
ErrorResult& aRv) {
AUTO_PROFILER_MARKER_TEXT("SWC Register", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("SWC Register", DOM, {});

// Note, we can't use GetGlobalIfValid() from the start here. If we
// hit a storage failure we want to log a message with the final
Expand Down Expand Up @@ -324,7 +324,7 @@ already_AddRefed<Promise> ServiceWorkerContainer::Register(
[self,
outer](const IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult&
aResult) {
AUTO_PROFILER_MARKER_TEXT("SWC Register (inner)", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("SWC Register (inner)", DOM, {});

if (aResult.type() ==
IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult::
Expand Down
2 changes: 1 addition & 1 deletion dom/serviceworkers/ServiceWorkerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ ServiceWorkerManager::RegisterForTest(nsIPrincipal* aPrincipal,
RefPtr<ServiceWorkerRegistrationPromise> ServiceWorkerManager::Register(
const ClientInfo& aClientInfo, const nsACString& aScopeURL,
const nsACString& aScriptURL, ServiceWorkerUpdateViaCache aUpdateViaCache) {
AUTO_PROFILER_MARKER_TEXT("SWM Register", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("SWM Register", DOM, {});

nsCOMPtr<nsIURI> scopeURI;
nsresult rv = NS_NewURI(getter_AddRefs(scopeURI), aScopeURL);
Expand Down
2 changes: 1 addition & 1 deletion dom/serviceworkers/ServiceWorkerRegisterJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ServiceWorkerRegisterJob::ServiceWorkerRegisterJob(
void ServiceWorkerRegisterJob::AsyncExecute() {
MOZ_ASSERT(NS_IsMainThread());

AUTO_PROFILER_MARKER_TEXT("SWRJ AsyncExecute", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("SWRJ AsyncExecute", DOM, {});

RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
if (Canceled() || !swm) {
Expand Down
7 changes: 3 additions & 4 deletions dom/serviceworkers/ServiceWorkerRegistration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ ServiceWorkerUpdateViaCache ServiceWorkerRegistration::GetUpdateViaCache(
}

already_AddRefed<Promise> ServiceWorkerRegistration::Update(ErrorResult& aRv) {
AUTO_PROFILER_MARKER_TEXT("ServiceWorkerRegistration::Update", DOM, {},
""_ns);
AUTO_PROFILER_MARKER_UNTYPED("ServiceWorkerRegistration::Update", DOM, {});

nsIGlobalObject* global = GetParentObject();
if (!global) {
Expand Down Expand Up @@ -268,8 +267,8 @@ already_AddRefed<Promise> ServiceWorkerRegistration::Update(ErrorResult& aRv) {
[outer,
self](const IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult&
aResult) {
AUTO_PROFILER_MARKER_TEXT("ServiceWorkerRegistration::Update (inner)",
DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED(
"ServiceWorkerRegistration::Update (inner)", DOM, {});

if (aResult.type() ==
IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult::
Expand Down
7 changes: 3 additions & 4 deletions dom/serviceworkers/ServiceWorkerUpdateJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ void ServiceWorkerUpdateJob::FailUpdateJob(nsresult aRv) {
}

void ServiceWorkerUpdateJob::AsyncExecute() {
AUTO_PROFILER_MARKER_TEXT("ServiceWorkerUpdateJob::AsyncExecute", DOM, {},
""_ns);
AUTO_PROFILER_MARKER_UNTYPED("ServiceWorkerUpdateJob::AsyncExecute", DOM, {});

MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(GetType() == Type::Update);
Expand Down Expand Up @@ -275,7 +274,7 @@ void ServiceWorkerUpdateJob::SetRegistration(
}

void ServiceWorkerUpdateJob::Update() {
AUTO_PROFILER_MARKER_TEXT("ServiceWorkerUpdateJob::Update", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("ServiceWorkerUpdateJob::Update", DOM, {});

MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!Canceled());
Expand Down Expand Up @@ -479,7 +478,7 @@ void ServiceWorkerUpdateJob::ContinueUpdateAfterScriptEval(
}

void ServiceWorkerUpdateJob::Install() {
AUTO_PROFILER_MARKER_TEXT("ServiceWorkerUpdateJob::Install", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("ServiceWorkerUpdateJob::Install", DOM, {});

MOZ_ASSERT(NS_IsMainThread());
MOZ_DIAGNOSTIC_ASSERT(!Canceled());
Expand Down
2 changes: 1 addition & 1 deletion layout/base/nsPresContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ bool nsPresContext::UpdateContainerQueryStyles() {
}

AUTO_PROFILER_LABEL_RELEVANT_FOR_JS("Container Query Styles Update", LAYOUT);
AUTO_PROFILER_MARKER_TEXT("UpdateContainerQueryStyles", LAYOUT, {}, ""_ns);
AUTO_PROFILER_MARKER_UNTYPED("UpdateContainerQueryStyles", LAYOUT, {});

PresShell()->DoFlushLayout(/* aInterruptible = */ false);

Expand Down
4 changes: 2 additions & 2 deletions parser/html/nsHtml5TreeOpExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,9 @@ void nsHtml5TreeOpExecutor::RunFlushLoop() {
nsHtml5AutoFlush autoFlush(this);
// Profiler marker deliberately not counting layout and script
// execution.
AUTO_PROFILER_MARKER_TEXT(
AUTO_PROFILER_MARKER_UNTYPED(
"HTMLParserTreeOps", DOM,
MarkerOptions(MarkerInnerWindowIdFromDocShell(mDocShell)), ""_ns);
MarkerOptions(MarkerInnerWindowIdFromDocShell(mDocShell)));

nsHtml5TreeOperation* first = mOpQueue.Elements();
nsHtml5TreeOperation* last = first + mOpQueue.Length() - 1;
Expand Down

0 comments on commit 964d9b0

Please sign in to comment.