| 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 <strstream> | 7 #include <strstream> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // provider. | 108 // provider. |
| 109 TraceEventETWProvider* tracelog = NULL; | 109 TraceEventETWProvider* tracelog = NULL; |
| 110 if (!is_xp) { | 110 if (!is_xp) { |
| 111 TraceEventETWProvider::Resurrect(); | 111 TraceEventETWProvider::Resurrect(); |
| 112 tracelog = TraceEventETWProvider::GetInstance(); | 112 tracelog = TraceEventETWProvider::GetInstance(); |
| 113 ASSERT_TRUE(tracelog != NULL); | 113 ASSERT_TRUE(tracelog != NULL); |
| 114 ASSERT_FALSE(tracelog->IsTracing()); | 114 ASSERT_FALSE(tracelog->IsTracing()); |
| 115 } | 115 } |
| 116 | 116 |
| 117 // Create the log file. | 117 // Create the log file. |
| 118 ASSERT_TRUE(file_util::CreateTemporaryFile(&log_file_)); | 118 ASSERT_TRUE(base::CreateTemporaryFile(&log_file_)); |
| 119 | 119 |
| 120 // Create a private log session on the file. | 120 // Create a private log session on the file. |
| 121 EtwTraceProperties prop; | 121 EtwTraceProperties prop; |
| 122 ASSERT_HRESULT_SUCCEEDED(prop.SetLoggerFileName(log_file_.value().c_str())); | 122 ASSERT_HRESULT_SUCCEEDED(prop.SetLoggerFileName(log_file_.value().c_str())); |
| 123 EVENT_TRACE_PROPERTIES& p = *prop.get(); | 123 EVENT_TRACE_PROPERTIES& p = *prop.get(); |
| 124 p.Wnode.ClientContext = 1; // QPC timer accuracy. | 124 p.Wnode.ClientContext = 1; // QPC timer accuracy. |
| 125 p.LogFileMode = EVENT_TRACE_FILE_MODE_SEQUENTIAL; // Sequential log. | 125 p.LogFileMode = EVENT_TRACE_FILE_MODE_SEQUENTIAL; // Sequential log. |
| 126 | 126 |
| 127 // On Vista and later, we create a private in-process log session, because | 127 // On Vista and later, we create a private in-process log session, because |
| 128 // otherwise we'd need administrator privileges. Unfortunately we can't | 128 // otherwise we'd need administrator privileges. Unfortunately we can't |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 kTraceEventTypeInstant, | 310 kTraceEventTypeInstant, |
| 311 kName, strlen(kName), | 311 kName, strlen(kName), |
| 312 kId, | 312 kId, |
| 313 kExtra, strlen(kExtra)); | 313 kExtra, strlen(kExtra)); |
| 314 | 314 |
| 315 PlayLog(); | 315 PlayLog(); |
| 316 } | 316 } |
| 317 | 317 |
| 318 } // namespace debug | 318 } // namespace debug |
| 319 } // namespace base | 319 } // namespace base |
| OLD | NEW |