| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "base/trace_event/trace_log.h" | 5 #include "base/trace_event/trace_log.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <cmath> | 8 #include <cmath> | 
| 9 #include <memory> | 9 #include <memory> | 
| 10 #include <utility> | 10 #include <utility> | 
| (...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1523   // If buffer is full, add a metadata record to report this. | 1523   // If buffer is full, add a metadata record to report this. | 
| 1524   if (!buffer_limit_reached_timestamp_.is_null()) { | 1524   if (!buffer_limit_reached_timestamp_.is_null()) { | 
| 1525     InitializeMetadataEvent(AddEventToThreadSharedChunkWhileLocked(NULL, false), | 1525     InitializeMetadataEvent(AddEventToThreadSharedChunkWhileLocked(NULL, false), | 
| 1526                             current_thread_id, "trace_buffer_overflowed", | 1526                             current_thread_id, "trace_buffer_overflowed", | 
| 1527                             "overflowed_at_ts", | 1527                             "overflowed_at_ts", | 
| 1528                             buffer_limit_reached_timestamp_); | 1528                             buffer_limit_reached_timestamp_); | 
| 1529   } | 1529   } | 
| 1530 } | 1530 } | 
| 1531 | 1531 | 
| 1532 void TraceLog::DeleteForTesting() { | 1532 void TraceLog::DeleteForTesting() { | 
| 1533   internal::DeleteTraceLogForTesting::Delete(); | 1533   base::internal::DeleteTraceLogForTesting::Delete(); | 
| 1534   CategoryRegistry::ResetForTesting(); | 1534   CategoryRegistry::ResetForTesting(); | 
| 1535 } | 1535 } | 
| 1536 | 1536 | 
| 1537 TraceEvent* TraceLog::GetEventByHandle(TraceEventHandle handle) { | 1537 TraceEvent* TraceLog::GetEventByHandle(TraceEventHandle handle) { | 
| 1538   return GetEventByHandleInternal(handle, NULL); | 1538   return GetEventByHandleInternal(handle, NULL); | 
| 1539 } | 1539 } | 
| 1540 | 1540 | 
| 1541 TraceEvent* TraceLog::GetEventByHandleInternal(TraceEventHandle handle, | 1541 TraceEvent* TraceLog::GetEventByHandleInternal(TraceEventHandle handle, | 
| 1542                                                OptionalAutoLock* lock) { | 1542                                                OptionalAutoLock* lock) { | 
| 1543   if (!handle.chunk_seq) | 1543   if (!handle.chunk_seq) | 
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1715 } | 1715 } | 
| 1716 | 1716 | 
| 1717 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1717 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 
| 1718   if (*category_group_enabled_) { | 1718   if (*category_group_enabled_) { | 
| 1719     TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1719     TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 
| 1720                                                 event_handle_); | 1720                                                 event_handle_); | 
| 1721   } | 1721   } | 
| 1722 } | 1722 } | 
| 1723 | 1723 | 
| 1724 }  // namespace trace_event_internal | 1724 }  // namespace trace_event_internal | 
| OLD | NEW | 
|---|