OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_impl.h" | 5 #include "base/debug/trace_event_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1946 | 1946 |
1947 if (trace_options() & ECHO_TO_CONSOLE) { | 1947 if (trace_options() & ECHO_TO_CONSOLE) { |
1948 lock.EnsureAcquired(); | 1948 lock.EnsureAcquired(); |
1949 OutputEventToConsoleWhileLocked(TRACE_EVENT_PHASE_END, now, trace_event); | 1949 OutputEventToConsoleWhileLocked(TRACE_EVENT_PHASE_END, now, trace_event); |
1950 } | 1950 } |
1951 } | 1951 } |
1952 | 1952 |
1953 if (*category_group_enabled & ENABLED_FOR_EVENT_CALLBACK) { | 1953 if (*category_group_enabled & ENABLED_FOR_EVENT_CALLBACK) { |
1954 EventCallback event_callback = reinterpret_cast<EventCallback>( | 1954 EventCallback event_callback = reinterpret_cast<EventCallback>( |
1955 subtle::NoBarrier_Load(&event_callback_)); | 1955 subtle::NoBarrier_Load(&event_callback_)); |
1956 event_callback(now, TRACE_EVENT_PHASE_END, category_group_enabled, name, | 1956 if (event_callback) { |
1957 trace_event_internal::kNoEventId, 0, NULL, NULL, NULL, | 1957 event_callback(now, TRACE_EVENT_PHASE_END, category_group_enabled, name, |
1958 TRACE_EVENT_FLAG_NONE); | 1958 trace_event_internal::kNoEventId, 0, NULL, NULL, NULL, |
| 1959 TRACE_EVENT_FLAG_NONE); |
| 1960 } |
1959 } | 1961 } |
1960 } | 1962 } |
1961 | 1963 |
1962 void TraceLog::SetWatchEvent(const std::string& category_name, | 1964 void TraceLog::SetWatchEvent(const std::string& category_name, |
1963 const std::string& event_name) { | 1965 const std::string& event_name) { |
1964 const unsigned char* category = GetCategoryGroupEnabled( | 1966 const unsigned char* category = GetCategoryGroupEnabled( |
1965 category_name.c_str()); | 1967 category_name.c_str()); |
1966 AutoLock lock(lock_); | 1968 AutoLock lock(lock_); |
1967 subtle::NoBarrier_Store(&watch_category_, | 1969 subtle::NoBarrier_Store(&watch_category_, |
1968 reinterpret_cast<subtle::AtomicWord>(category)); | 1970 reinterpret_cast<subtle::AtomicWord>(category)); |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2312 } | 2314 } |
2313 | 2315 |
2314 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 2316 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
2315 if (*category_group_enabled_) { | 2317 if (*category_group_enabled_) { |
2316 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, | 2318 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, |
2317 name_, event_handle_); | 2319 name_, event_handle_); |
2318 } | 2320 } |
2319 } | 2321 } |
2320 | 2322 |
2321 } // namespace trace_event_internal | 2323 } // namespace trace_event_internal |
OLD | NEW |