OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "platform/EventTracer.h" | 31 #include "platform/EventTracer.h" |
32 | 32 |
33 #include "base/time/time.h" | 33 #include "base/time/time.h" |
| 34 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" |
34 #include "base/trace_event/trace_event.h" | 35 #include "base/trace_event/trace_event.h" |
35 #include "base/trace_event/trace_event_argument.h" | 36 #include "base/trace_event/trace_event_argument.h" |
36 #include "platform/TracedValue.h" | 37 #include "platform/TracedValue.h" |
37 #include "public/platform/Platform.h" | 38 #include "public/platform/Platform.h" |
38 #include "wtf/Assertions.h" | 39 #include "wtf/Assertions.h" |
39 #include "wtf/text/StringUTF8Adaptor.h" | 40 #include "wtf/text/StringUTF8Adaptor.h" |
40 #include <stdio.h> | 41 #include <stdio.h> |
41 | 42 |
42 namespace blink { | 43 namespace blink { |
43 | 44 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 base::trace_event::TraceEventHandle traceEventHandle; | 113 base::trace_event::TraceEventHandle traceEventHandle; |
113 memcpy(&traceEventHandle, &handle, sizeof(handle)); | 114 memcpy(&traceEventHandle, &handle, sizeof(handle)); |
114 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(categoryEnabledFlag, name, trace
EventHandle); | 115 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(categoryEnabledFlag, name, trace
EventHandle); |
115 } | 116 } |
116 | 117 |
117 double EventTracer::systemTraceTime() | 118 double EventTracer::systemTraceTime() |
118 { | 119 { |
119 return (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); | 120 return (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); |
120 } | 121 } |
121 | 122 |
| 123 void EventTracer::pushPseudoStackFrame(const char* stackFrame) |
| 124 { |
| 125 base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread() |
| 126 ->PushPseudoStackFrame(stackFrame); |
| 127 } |
| 128 |
| 129 void EventTracer::popPseudoStackFrame(const char* stackFrame) |
| 130 { |
| 131 base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread() |
| 132 ->PopPseudoStackFrame(stackFrame); |
| 133 } |
| 134 |
122 } // namespace blink | 135 } // namespace blink |
OLD | NEW |