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

Unified Diff: base/trace_event/trace_log.cc

Issue 1900223003: [tracing] Ignore tracing allocations in heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove cc file and inline. Created 4 years, 8 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_event.gypi ('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 a0b12fbc5426fc1f357b4be8eb219a690ca2c647..1a375d146a9eb20582e7948677029c93c6a1842f 100644
--- a/base/trace_event/trace_log.cc
+++ b/base/trace_event/trace_log.cc
@@ -30,6 +30,7 @@
#include "base/threading/thread_id_name_manager.h"
#include "base/threading/worker_pool.h"
#include "base/time/time.h"
+#include "base/trace_event/heap_profiler.h"
#include "base/trace_event/heap_profiler_allocation_context_tracker.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/memory_dump_provider.h"
@@ -391,6 +392,7 @@ void TraceLog::InitializeThreadLocalEventBufferIfSupported() {
// trace events will be added into the main buffer directly.
if (thread_blocks_message_loop_.Get() || !MessageLoop::current())
return;
+ HEAP_PROFILER_SCOPED_IGNORE;
auto thread_local_event_buffer = thread_local_event_buffer_.Get();
if (thread_local_event_buffer &&
!CheckGeneration(thread_local_event_buffer->generation())) {
@@ -907,6 +909,7 @@ void TraceLog::ConvertTraceEventsToTraceFormat(
if (flush_output_callback.is_null())
return;
+ HEAP_PROFILER_SCOPED_IGNORE;
// The callback need to be called at least once even if there is no events
// to let the caller know the completion of flush.
scoped_refptr<RefCountedString> json_events_str_ptr = new RefCountedString();
@@ -1341,6 +1344,7 @@ void TraceLog::AddMetadataEvent(
const unsigned long long* arg_values,
std::unique_ptr<ConvertableToTraceFormat>* convertable_values,
unsigned int flags) {
+ HEAP_PROFILER_SCOPED_IGNORE;
std::unique_ptr<TraceEvent> trace_event(new TraceEvent);
int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
ThreadTicks thread_now = ThreadNow();
@@ -1361,6 +1365,7 @@ void TraceLog::AddMetadataEvent(
std::string TraceLog::EventToConsoleMessage(unsigned char phase,
const TimeTicks& timestamp,
TraceEvent* trace_event) {
+ HEAP_PROFILER_SCOPED_IGNORE;
AutoLock thread_info_lock(thread_info_lock_);
// The caller should translate TRACE_EVENT_PHASE_COMPLETE to
@@ -1664,6 +1669,7 @@ void TraceLog::SetCurrentThreadBlocksMessageLoop() {
}
TraceBuffer* TraceLog::CreateTraceBuffer() {
+ HEAP_PROFILER_SCOPED_IGNORE;
InternalTraceOptions options = trace_options();
if (options & kInternalRecordContinuously)
return TraceBuffer::CreateTraceBufferRingBuffer(
« no previous file with comments | « base/trace_event/trace_event.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698