| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include "base/debug/trace_event_win.h" | 10 #include "base/debug/trace_event_win.h" |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 | 519 |
| 520 void TraceLog::AddTraceEventEtw(TraceEventPhase phase, | 520 void TraceLog::AddTraceEventEtw(TraceEventPhase phase, |
| 521 const char* name, | 521 const char* name, |
| 522 const void* id, | 522 const void* id, |
| 523 const char* extra) { | 523 const char* extra) { |
| 524 #if defined(OS_WIN) | 524 #if defined(OS_WIN) |
| 525 TraceEventETWProvider::Trace(name, phase, id, extra); | 525 TraceEventETWProvider::Trace(name, phase, id, extra); |
| 526 #endif | 526 #endif |
| 527 INTERNAL_TRACE_EVENT_ADD(phase, | 527 INTERNAL_TRACE_EVENT_ADD(phase, |
| 528 "ETW Trace Event", name, "id", id, "extra", TRACE_STR_COPY(extra), | 528 "ETW Trace Event", name, "id", id, "extra", TRACE_STR_COPY(extra), |
| 529 base::debug::TraceLog::EVENT_FLAG_NONE); | 529 base::debug::TraceLog::EVENT_FLAG_COPY); |
| 530 } | 530 } |
| 531 | 531 |
| 532 void TraceLog::AddTraceEventEtw(TraceEventPhase phase, | 532 void TraceLog::AddTraceEventEtw(TraceEventPhase phase, |
| 533 const char* name, | 533 const char* name, |
| 534 const void* id, | 534 const void* id, |
| 535 const std::string& extra) | 535 const std::string& extra) |
| 536 { | 536 { |
| 537 #if defined(OS_WIN) | 537 #if defined(OS_WIN) |
| 538 TraceEventETWProvider::Trace(name, phase, id, extra); | 538 TraceEventETWProvider::Trace(name, phase, id, extra); |
| 539 #endif | 539 #endif |
| 540 INTERNAL_TRACE_EVENT_ADD(phase, | 540 INTERNAL_TRACE_EVENT_ADD(phase, |
| 541 "ETW Trace Event", name, "id", id, "extra", extra, | 541 "ETW Trace Event", name, "id", id, "extra", extra, |
| 542 base::debug::TraceLog::EVENT_FLAG_NONE); | 542 base::debug::TraceLog::EVENT_FLAG_COPY); |
| 543 } | 543 } |
| 544 | 544 |
| 545 void TraceLog::AddCurrentMetadataEvents() { | 545 void TraceLog::AddCurrentMetadataEvents() { |
| 546 lock_.AssertAcquired(); | 546 lock_.AssertAcquired(); |
| 547 for(base::hash_map<PlatformThreadId, std::string>::iterator it = | 547 for(base::hash_map<PlatformThreadId, std::string>::iterator it = |
| 548 thread_names_.begin(); | 548 thread_names_.begin(); |
| 549 it != thread_names_.end(); | 549 it != thread_names_.end(); |
| 550 it++) { | 550 it++) { |
| 551 if (!it->second.empty()) | 551 if (!it->second.empty()) |
| 552 logged_events_.push_back( | 552 logged_events_.push_back( |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 NULL, 0, NULL, 0, | 610 NULL, 0, NULL, 0, |
| 611 p_data_->threshold_begin_id, p_data_->threshold, | 611 p_data_->threshold_begin_id, p_data_->threshold, |
| 612 TraceLog::EVENT_FLAG_NONE); | 612 TraceLog::EVENT_FLAG_NONE); |
| 613 } | 613 } |
| 614 } | 614 } |
| 615 | 615 |
| 616 } // namespace internal | 616 } // namespace internal |
| 617 | 617 |
| 618 } // namespace debug | 618 } // namespace debug |
| 619 } // namespace base | 619 } // namespace base |
| OLD | NEW |