| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Implementation of a Windows event trace controller class. | 5 // Implementation of a Windows event trace controller class. |
| 6 #include "base/event_trace_controller_win.h" | 6 #include "base/win/event_trace_controller.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace base { |
| 10 namespace win { |
| 11 |
| 9 EtwTraceProperties::EtwTraceProperties() { | 12 EtwTraceProperties::EtwTraceProperties() { |
| 10 memset(buffer_, 0, sizeof(buffer_)); | 13 memset(buffer_, 0, sizeof(buffer_)); |
| 11 EVENT_TRACE_PROPERTIES* prop = get(); | 14 EVENT_TRACE_PROPERTIES* prop = get(); |
| 12 | 15 |
| 13 prop->Wnode.BufferSize = sizeof(buffer_); | 16 prop->Wnode.BufferSize = sizeof(buffer_); |
| 14 prop->Wnode.Flags = WNODE_FLAG_TRACED_GUID; | 17 prop->Wnode.Flags = WNODE_FLAG_TRACED_GUID; |
| 15 prop->LoggerNameOffset = sizeof(EVENT_TRACE_PROPERTIES); | 18 prop->LoggerNameOffset = sizeof(EVENT_TRACE_PROPERTIES); |
| 16 prop->LogFileNameOffset = sizeof(EVENT_TRACE_PROPERTIES) + | 19 prop->LogFileNameOffset = sizeof(EVENT_TRACE_PROPERTIES) + |
| 17 sizeof(wchar_t) * kMaxStringLen; | 20 sizeof(wchar_t) * kMaxStringLen; |
| 18 } | 21 } |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 return HRESULT_FROM_WIN32(err); | 161 return HRESULT_FROM_WIN32(err); |
| 159 } | 162 } |
| 160 | 163 |
| 161 HRESULT EtwTraceController::Flush(const wchar_t* session_name, | 164 HRESULT EtwTraceController::Flush(const wchar_t* session_name, |
| 162 EtwTraceProperties* properties) { | 165 EtwTraceProperties* properties) { |
| 163 DCHECK(properties != NULL); | 166 DCHECK(properties != NULL); |
| 164 ULONG err = ::ControlTrace(NULL, session_name, properties->get(), | 167 ULONG err = ::ControlTrace(NULL, session_name, properties->get(), |
| 165 EVENT_TRACE_CONTROL_FLUSH); | 168 EVENT_TRACE_CONTROL_FLUSH); |
| 166 return HRESULT_FROM_WIN32(err); | 169 return HRESULT_FROM_WIN32(err); |
| 167 } | 170 } |
| 171 |
| 172 } // namespace win |
| 173 } // namespace base |
| OLD | NEW |