| 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 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 // If buffer is full, add a metadata record to report this. | 1520 // If buffer is full, add a metadata record to report this. |
| 1521 if (!buffer_limit_reached_timestamp_.is_null()) { | 1521 if (!buffer_limit_reached_timestamp_.is_null()) { |
| 1522 InitializeMetadataEvent(AddEventToThreadSharedChunkWhileLocked(NULL, false), | 1522 InitializeMetadataEvent(AddEventToThreadSharedChunkWhileLocked(NULL, false), |
| 1523 current_thread_id, "trace_buffer_overflowed", | 1523 current_thread_id, "trace_buffer_overflowed", |
| 1524 "overflowed_at_ts", | 1524 "overflowed_at_ts", |
| 1525 buffer_limit_reached_timestamp_); | 1525 buffer_limit_reached_timestamp_); |
| 1526 } | 1526 } |
| 1527 } | 1527 } |
| 1528 | 1528 |
| 1529 void TraceLog::DeleteForTesting() { | 1529 void TraceLog::DeleteForTesting() { |
| 1530 internal::DeleteTraceLogForTesting::Delete(); | 1530 base::internal::DeleteTraceLogForTesting::Delete(); |
| 1531 CategoryRegistry::ResetForTesting(); | 1531 CategoryRegistry::ResetForTesting(); |
| 1532 } | 1532 } |
| 1533 | 1533 |
| 1534 TraceEvent* TraceLog::GetEventByHandle(TraceEventHandle handle) { | 1534 TraceEvent* TraceLog::GetEventByHandle(TraceEventHandle handle) { |
| 1535 return GetEventByHandleInternal(handle, NULL); | 1535 return GetEventByHandleInternal(handle, NULL); |
| 1536 } | 1536 } |
| 1537 | 1537 |
| 1538 TraceEvent* TraceLog::GetEventByHandleInternal(TraceEventHandle handle, | 1538 TraceEvent* TraceLog::GetEventByHandleInternal(TraceEventHandle handle, |
| 1539 OptionalAutoLock* lock) { | 1539 OptionalAutoLock* lock) { |
| 1540 if (!handle.chunk_seq) | 1540 if (!handle.chunk_seq) |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 } | 1712 } |
| 1713 | 1713 |
| 1714 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1714 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
| 1715 if (*category_group_enabled_) { | 1715 if (*category_group_enabled_) { |
| 1716 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1716 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
| 1717 event_handle_); | 1717 event_handle_); |
| 1718 } | 1718 } |
| 1719 } | 1719 } |
| 1720 | 1720 |
| 1721 } // namespace trace_event_internal | 1721 } // namespace trace_event_internal |
| OLD | NEW |