Removal of Macro and Reference in PERFETTO_INTERNAL_ADD_EMPTY_EVENT().
This change removes the unnecessary macro and usages of PERFETTO_INTERNAL_ADD_EMPTY_EVENT(). This modification aligns with the successful removal of CallFinishTracePacket on MessageHandle destruction. Bug:40657156 Change-Id: Ibab85cc81c40e09abd292cc929ae0fda77956bd9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5553912 Reviewed-by: David Baron <dbaron@chromium.org> Reviewed-by: Francois Pierre Doray <fdoray@chromium.org> Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org> Reviewed-by: Ted Choc <tedchoc@chromium.org> Reviewed-by: Peter Conn <peconn@chromium.org> Commit-Queue: Alex Attar <aattar@google.com> Reviewed-by: Gabriel Charette <gab@chromium.org> Cr-Commit-Position: refs/heads/main@{#1305730}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
2d0f482ab7
commit
f0196a1801
android_webview/browser
base
files
task
threading
trace_event
cc/raster
chrome/browser
content/browser/tracing
@ -348,8 +348,6 @@ AwContents::~AwContents() {
|
|||||||
// Corresponds to "WebView Instance" in AwContents's constructor.
|
// Corresponds to "WebView Instance" in AwContents's constructor.
|
||||||
TRACE_EVENT_END("android_webview.timeline",
|
TRACE_EVENT_END("android_webview.timeline",
|
||||||
perfetto::Track::FromPointer(this));
|
perfetto::Track::FromPointer(this));
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
base::android::ScopedJavaLocalRef<jobject> AwContents::GetWebContents(
|
base::android::ScopedJavaLocalRef<jobject> AwContents::GetWebContents(
|
||||||
|
@ -286,16 +286,12 @@ void VisibilityMetricsLogger::ProcessClientUpdate(Client* client,
|
|||||||
if (action != ClientAction::kRemoved) {
|
if (action != ClientAction::kRemoved) {
|
||||||
TRACE_EVENT_BEGIN("android_webview.timeline", "WebViewVisible",
|
TRACE_EVENT_BEGIN("android_webview.timeline", "WebViewVisible",
|
||||||
perfetto::Track::FromPointer(client));
|
perfetto::Track::FromPointer(client));
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
}
|
}
|
||||||
++all_clients_visible_count_;
|
++all_clients_visible_count_;
|
||||||
} else if (was_visible && !is_visible) {
|
} else if (was_visible && !is_visible) {
|
||||||
if (action != ClientAction::kRemoved) {
|
if (action != ClientAction::kRemoved) {
|
||||||
TRACE_EVENT_BEGIN("android_webview.timeline", "WebViewInvisible",
|
TRACE_EVENT_BEGIN("android_webview.timeline", "WebViewInvisible",
|
||||||
perfetto::Track::FromPointer(client));
|
perfetto::Track::FromPointer(client));
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
}
|
}
|
||||||
--all_clients_visible_count_;
|
--all_clients_visible_count_;
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,6 @@ FileTracing::ScopedEnabler::~ScopedEnabler() {
|
|||||||
FileTracing::Provider* provider = GetProvider();
|
FileTracing::Provider* provider = GetProvider();
|
||||||
if (provider)
|
if (provider)
|
||||||
provider->FileTracingDisable(this);
|
provider->FileTracingDisable(this);
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FileTracing::ScopedTrace::~ScopedTrace() {
|
FileTracing::ScopedTrace::~ScopedTrace() {
|
||||||
|
@ -506,8 +506,6 @@ void ThreadController::RunLevelTracker::RunLevel::UpdateState(
|
|||||||
LogOnIdleMetrics(lazy_now);
|
LogOnIdleMetrics(lazy_now);
|
||||||
|
|
||||||
TRACE_EVENT_END("base", lazy_now.Now());
|
TRACE_EVENT_END("base", lazy_now.Now());
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trace_observer_for_testing_) {
|
if (trace_observer_for_testing_) {
|
||||||
|
@ -401,8 +401,6 @@ void WorkerThread::RunWorker() {
|
|||||||
std::optional<WatchHangsInScope> hang_watch_scope;
|
std::optional<WatchHangsInScope> hang_watch_scope;
|
||||||
|
|
||||||
TRACE_EVENT_END0("base", "WorkerThread active");
|
TRACE_EVENT_END0("base", "WorkerThread active");
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
hang_watch_scope.reset();
|
hang_watch_scope.reset();
|
||||||
delegate()->WaitForWork();
|
delegate()->WaitForWork();
|
||||||
TRACE_EVENT_BEGIN("base", "WorkerThread active",
|
TRACE_EVENT_BEGIN("base", "WorkerThread active",
|
||||||
@ -475,8 +473,6 @@ void WorkerThread::RunWorker() {
|
|||||||
|
|
||||||
TRACE_EVENT_END0("base", "WorkerThread active");
|
TRACE_EVENT_END0("base", "WorkerThread active");
|
||||||
TRACE_EVENT_INSTANT0("base", "WorkerThread dead", TRACE_EVENT_SCOPE_THREAD);
|
TRACE_EVENT_INSTANT0("base", "WorkerThread dead", TRACE_EVENT_SCOPE_THREAD);
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace base::internal
|
} // namespace base::internal
|
||||||
|
@ -767,8 +767,6 @@ void HangWatcher::WatchStateSnapShot::Init(
|
|||||||
this, perfetto::ThreadTrack::ForThread(thread_id));
|
this, perfetto::ThreadTrack::ForThread(thread_id));
|
||||||
TRACE_EVENT_BEGIN("base", "HangWatcher::ThreadHung", track, deadline);
|
TRACE_EVENT_BEGIN("base", "HangWatcher::ThreadHung", track, deadline);
|
||||||
TRACE_EVENT_END("base", track, now);
|
TRACE_EVENT_END("base", track, now);
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -296,7 +296,6 @@ struct IgnoredValue {
|
|||||||
#define TRACE_EVENT(category, name, ...) INTERNAL_TRACE_IGNORE(category, name)
|
#define TRACE_EVENT(category, name, ...) INTERNAL_TRACE_IGNORE(category, name)
|
||||||
#define TRACE_EVENT_INSTANT(category, name, ...) \
|
#define TRACE_EVENT_INSTANT(category, name, ...) \
|
||||||
INTERNAL_TRACE_IGNORE(category, name)
|
INTERNAL_TRACE_IGNORE(category, name)
|
||||||
#define PERFETTO_INTERNAL_ADD_EMPTY_EVENT() INTERNAL_TRACE_IGNORE()
|
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
namespace trace_event {
|
namespace trace_event {
|
||||||
|
@ -369,7 +369,6 @@ TEST_F(TypedTraceEventTest, MAYBE_EmptyEvent) {
|
|||||||
EnableTrace();
|
EnableTrace();
|
||||||
|
|
||||||
EXPECT_FALSE(g_test_trace_packet->emit_empty_called);
|
EXPECT_FALSE(g_test_trace_packet->emit_empty_called);
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
EXPECT_TRUE(g_test_trace_packet->emit_empty_called);
|
EXPECT_TRUE(g_test_trace_packet->emit_empty_called);
|
||||||
|
|
||||||
CancelTrace();
|
CancelTrace();
|
||||||
|
@ -308,11 +308,6 @@ void CategorizedWorkerPoolImpl::Run(
|
|||||||
// start running. Signal other worker threads.
|
// start running. Signal other worker threads.
|
||||||
SignalHasReadyToRunTasksWithLockAcquired();
|
SignalHasReadyToRunTasksWithLockAcquired();
|
||||||
|
|
||||||
// Make sure the END of the last trace event emitted before going idle
|
|
||||||
// is flushed to perfetto.
|
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
|
|
||||||
// Exit when shutdown is set and no more tasks are pending.
|
// Exit when shutdown is set and no more tasks are pending.
|
||||||
if (shutdown_) {
|
if (shutdown_) {
|
||||||
break;
|
break;
|
||||||
|
@ -119,11 +119,6 @@ void SingleThreadTaskGraphRunner::Run() {
|
|||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (!RunTaskWithLockAcquired()) {
|
if (!RunTaskWithLockAcquired()) {
|
||||||
// Make sure the END of the last trace event emitted before going idle
|
|
||||||
// is flushed to perfetto.
|
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
|
|
||||||
// Exit when shutdown is set and no more tasks are pending.
|
// Exit when shutdown is set and no more tasks are pending.
|
||||||
if (shutdown_)
|
if (shutdown_)
|
||||||
break;
|
break;
|
||||||
|
@ -874,10 +874,6 @@ void ChromeBrowserMainPartsWin::OnModuleEvent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Since OnModuleEvent can be invoked from any thread, the above trace event's
|
|
||||||
// END might be the last event on this thread, emit an empty event to force
|
|
||||||
// the END to be flushed. TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper function for initializing the module database subsystem and populating
|
// Helper function for initializing the module database subsystem and populating
|
||||||
|
@ -29,8 +29,6 @@ void FileTracingProviderImpl::FileTracingEnable(const void* id) {
|
|||||||
void FileTracingProviderImpl::FileTracingDisable(const void* id) {
|
void FileTracingProviderImpl::FileTracingDisable(const void* id) {
|
||||||
TRACE_EVENT_NESTABLE_ASYNC_END0(
|
TRACE_EVENT_NESTABLE_ASYNC_END0(
|
||||||
kFileTracingEventCategoryGroup, FILE_TRACING_PREFIX, id);
|
kFileTracingEventCategoryGroup, FILE_TRACING_PREFIX, id);
|
||||||
// TODO(crbug.com/40657156): Remove this once fixed.
|
|
||||||
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileTracingProviderImpl::FileTracingEventBegin(const char* name,
|
void FileTracingProviderImpl::FileTracingEventBegin(const char* name,
|
||||||
|
Reference in New Issue
Block a user