Skip to content

Commit

Permalink
Disable lifecycle tracing for performance
Browse files Browse the repository at this point in the history
  • Loading branch information
jellefoks committed Nov 14, 2024
1 parent 999b341 commit fd13e36
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/task/sequence_manager/task_queue_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,7 @@ void TaskQueueImpl::ActivateDelayedFenceIfNeeded(const Task& task) {
main_thread_only().delayed_fence = absl::nullopt;
}

#if !defined(STARBOARD)
void TaskQueueImpl::MaybeReportIpcTaskQueuedFromMainThread(
const Task& pending_task) {
if (!pending_task.ipc_hash)
Expand Down Expand Up @@ -1502,6 +1503,7 @@ void TaskQueueImpl::ReportIpcTaskQueued(
&ctx, pending_task.posted_from));
});
}
#endif

void TaskQueueImpl::OnQueueUnblocked() {
DCHECK(IsQueueEnabled());
Expand Down
17 changes: 17 additions & 0 deletions base/task/sequence_manager/task_queue_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,22 @@ class BASE_EXPORT TaskQueueImpl {

// Reports the task if it was due to IPC and was posted to a disabled queue.
// This should be called after WillQueueTask has been called for the task.
#if defined(STARBOARD)
// We disable the "lifecycles" tracing group in Cobalt for performance
// reasons.
void MaybeReportIpcTaskQueuedFromMainThread(const Task& pending_task) {};
bool ShouldReportIpcTaskQueuedFromAnyThreadLocked(
base::TimeDelta* time_since_disabled)
EXCLUSIVE_LOCKS_REQUIRED(any_thread_lock_) {
return false;
}
void MaybeReportIpcTaskQueuedFromAnyThreadLocked(const Task& pending_task)
EXCLUSIVE_LOCKS_REQUIRED(any_thread_lock_) {}
void MaybeReportIpcTaskQueuedFromAnyThreadUnlocked(const Task& pending_task) {
}
void ReportIpcTaskQueued(const Task& pending_task,
const base::TimeDelta& time_since_disabled) {}
#else // !defined(STARBOARD)
void MaybeReportIpcTaskQueuedFromMainThread(const Task& pending_task);
bool ShouldReportIpcTaskQueuedFromAnyThreadLocked(
base::TimeDelta* time_since_disabled)
Expand All @@ -545,6 +561,7 @@ class BASE_EXPORT TaskQueueImpl {
void MaybeReportIpcTaskQueuedFromAnyThreadUnlocked(const Task& pending_task);
void ReportIpcTaskQueued(const Task& pending_task,
const base::TimeDelta& time_since_disabled);
#endif // !defined(STARBOARD)

// Invoked when the queue becomes enabled and not blocked by a fence.
void OnQueueUnblocked();
Expand Down

0 comments on commit fd13e36

Please sign in to comment.