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/trace_event/trace_event_impl.h" | 5 #include "base/trace_event/trace_event_impl.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include "base/format_macros.h" | 11 #include "base/format_macros.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/posix/eintr_wrapper.h" | 13 #include "base/posix/eintr_wrapper.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
| 16 #include "base/threading/thread.h" |
16 #include "base/trace_event/trace_event.h" | 17 #include "base/trace_event/trace_event.h" |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 namespace trace_event { | 20 namespace trace_event { |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 int g_atrace_fd = -1; | 24 int g_atrace_fd = -1; |
24 const char kATraceMarkerFile[] = "/sys/kernel/debug/tracing/trace_marker"; | 25 const char kATraceMarkerFile[] = "/sys/kernel/debug/tracing/trace_marker"; |
25 | 26 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // trace buffer. | 207 // trace buffer. |
207 double now_in_seconds = (TimeTicks::Now() - TimeTicks()).InSecondsF(); | 208 double now_in_seconds = (TimeTicks::Now() - TimeTicks()).InSecondsF(); |
208 std::string marker = StringPrintf( | 209 std::string marker = StringPrintf( |
209 "trace_event_clock_sync: parent_ts=%f\n", now_in_seconds); | 210 "trace_event_clock_sync: parent_ts=%f\n", now_in_seconds); |
210 WriteToATrace(atrace_fd, marker.c_str(), marker.size()); | 211 WriteToATrace(atrace_fd, marker.c_str(), marker.size()); |
211 close(atrace_fd); | 212 close(atrace_fd); |
212 } | 213 } |
213 | 214 |
214 } // namespace trace_event | 215 } // namespace trace_event |
215 } // namespace base | 216 } // namespace base |
OLD | NEW |