Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: base/trace_event/trace_log.cc

Issue 2354163002: [tracing] Remove event callback mode in TraceLog (Closed)
Patch Set: Add comment. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/trace_log.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_log.cc
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc
index a3d146ad51451be1fd15c4d1295f66eb325b383f..5c3b78d6fd00b48c7904fbac8dbbbd77d5fa7d4c 100644
--- a/base/trace_event/trace_log.cc
+++ b/base/trace_event/trace_log.cc
@@ -464,7 +464,6 @@ TraceLog* TraceLog::GetInstance() {
TraceLog::TraceLog()
: enabled_modes_(0),
num_traces_recorded_(0),
- event_callback_(0),
dispatching_to_observer_list_(false),
process_sort_index_(0),
process_id_hash_(0),
@@ -472,7 +471,6 @@ TraceLog::TraceLog()
watch_category_(0),
trace_options_(kInternalRecordUntilFull),
trace_config_(TraceConfig()),
- event_callback_trace_config_(TraceConfig()),
thread_shared_chunk_index_(0),
generation_(0),
use_worker_thread_(false) {
@@ -565,11 +563,6 @@ void TraceLog::UpdateCategoryGroupEnabledFlag(size_t category_index) {
enabled_flag |= ENABLED_FOR_RECORDING;
}
- if (event_callback_ &&
- event_callback_trace_config_.IsCategoryGroupEnabled(category_group)) {
- enabled_flag |= ENABLED_FOR_EVENT_CALLBACK;
- }
-
#if defined(OS_WIN)
if (base::trace_event::TraceEventETWExport::IsCategoryGroupEnabled(
category_group)) {
@@ -1004,21 +997,6 @@ void TraceLog::CheckIfBufferIsFullWhileLocked() {
}
}
-void TraceLog::SetEventCallbackEnabled(const TraceConfig& trace_config,
- EventCallback cb) {
- AutoLock lock(lock_);
- subtle::NoBarrier_Store(&event_callback_,
- reinterpret_cast<subtle::AtomicWord>(cb));
- event_callback_trace_config_ = trace_config;
- UpdateCategoryGroupEnabledFlags();
-}
-
-void TraceLog::SetEventCallbackDisabled() {
- AutoLock lock(lock_);
- subtle::NoBarrier_Store(&event_callback_, 0);
- UpdateCategoryGroupEnabledFlags();
-}
-
// Flush() works as the following:
// 1. Flush() is called in thread A whose task runner is saved in
// flush_task_runner_;
@@ -1516,18 +1494,6 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp(
}
}
- if (*category_group_enabled & ENABLED_FOR_EVENT_CALLBACK) {
- EventCallback event_callback = reinterpret_cast<EventCallback>(
- subtle::NoBarrier_Load(&event_callback_));
- if (event_callback) {
- event_callback(
- offset_event_timestamp,
- phase == TRACE_EVENT_PHASE_COMPLETE ? TRACE_EVENT_PHASE_BEGIN : phase,
- category_group_enabled, name, scope, id, num_args, arg_names,
- arg_types, arg_values, flags);
- }
- }
-
return handle;
}
@@ -1675,17 +1641,6 @@ void TraceLog::UpdateTraceEventDuration(
if (!console_message.empty())
LOG(ERROR) << console_message;
- if (category_group_enabled_local & ENABLED_FOR_EVENT_CALLBACK) {
- EventCallback event_callback = reinterpret_cast<EventCallback>(
- subtle::NoBarrier_Load(&event_callback_));
- if (event_callback) {
- event_callback(
- now, TRACE_EVENT_PHASE_END, category_group_enabled, name,
- trace_event_internal::kGlobalScope, trace_event_internal::kNoId, 0,
- nullptr, nullptr, nullptr, TRACE_EVENT_FLAG_NONE);
- }
- }
-
if (category_group_enabled_local & ENABLED_FOR_FILTERING)
EndFilteredEvent(category_group_enabled, name, handle);
}
« no previous file with comments | « base/trace_event/trace_log.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698