| 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 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 TraceEventETWExport::AddCompleteEndEvent(name); | 1460 TraceEventETWExport::AddCompleteEndEvent(name); |
| 1461 #endif // OS_WIN | 1461 #endif // OS_WIN |
| 1462 | 1462 |
| 1463 std::string console_message; | 1463 std::string console_message; |
| 1464 if (category_group_enabled_local & ENABLED_FOR_RECORDING) { | 1464 if (category_group_enabled_local & ENABLED_FOR_RECORDING) { |
| 1465 OptionalAutoLock lock(&lock_); | 1465 OptionalAutoLock lock(&lock_); |
| 1466 | 1466 |
| 1467 TraceEvent* trace_event = GetEventByHandleInternal(handle, &lock); | 1467 TraceEvent* trace_event = GetEventByHandleInternal(handle, &lock); |
| 1468 if (trace_event) { | 1468 if (trace_event) { |
| 1469 DCHECK(trace_event->phase() == TRACE_EVENT_PHASE_COMPLETE); | 1469 DCHECK(trace_event->phase() == TRACE_EVENT_PHASE_COMPLETE); |
| 1470 // TEMP(oysteine) to debug crbug.com/638744 |
| 1471 if (trace_event->duration().ToInternalValue() != -1) { |
| 1472 DVLOG(1) << "TraceHandle: chunk_seq " << handle.chunk_seq |
| 1473 << ", chunk_index " << handle.chunk_index << ", event_index " |
| 1474 << handle.event_index; |
| 1475 |
| 1476 std::string serialized_event; |
| 1477 trace_event->AppendAsJSON(&serialized_event, ArgumentFilterPredicate()); |
| 1478 DVLOG(1) << "TraceEvent: " << serialized_event; |
| 1479 lock_.AssertAcquired(); |
| 1480 } |
| 1481 |
| 1470 trace_event->UpdateDuration(now, thread_now); | 1482 trace_event->UpdateDuration(now, thread_now); |
| 1471 #if defined(OS_ANDROID) | 1483 #if defined(OS_ANDROID) |
| 1472 trace_event->SendToATrace(); | 1484 trace_event->SendToATrace(); |
| 1473 #endif | 1485 #endif |
| 1474 } | 1486 } |
| 1475 | 1487 |
| 1476 if (trace_options() & kInternalEchoToConsole) { | 1488 if (trace_options() & kInternalEchoToConsole) { |
| 1477 console_message = | 1489 console_message = |
| 1478 EventToConsoleMessage(TRACE_EVENT_PHASE_END, now, trace_event); | 1490 EventToConsoleMessage(TRACE_EVENT_PHASE_END, now, trace_event); |
| 1479 } | 1491 } |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1779 } | 1791 } |
| 1780 | 1792 |
| 1781 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1793 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
| 1782 if (*category_group_enabled_) { | 1794 if (*category_group_enabled_) { |
| 1783 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1795 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
| 1784 event_handle_); | 1796 event_handle_); |
| 1785 } | 1797 } |
| 1786 } | 1798 } |
| 1787 | 1799 |
| 1788 } // namespace trace_event_internal | 1800 } // namespace trace_event_internal |
| OLD | NEW |