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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 duration_ = now - timestamp_; | 191 duration_ = now - timestamp_; |
192 | 192 |
193 // |thread_timestamp_| can be empty if the thread ticks clock wasn't | 193 // |thread_timestamp_| can be empty if the thread ticks clock wasn't |
194 // initialized when it was recorded. | 194 // initialized when it was recorded. |
195 if (thread_timestamp_ != ThreadTicks()) | 195 if (thread_timestamp_ != ThreadTicks()) |
196 thread_duration_ = thread_now - thread_timestamp_; | 196 thread_duration_ = thread_now - thread_timestamp_; |
197 } | 197 } |
198 | 198 |
199 void TraceEvent::EstimateTraceMemoryOverhead( | 199 void TraceEvent::EstimateTraceMemoryOverhead( |
200 TraceEventMemoryOverhead* overhead) { | 200 TraceEventMemoryOverhead* overhead) { |
201 overhead->Add("TraceEvent", sizeof(*this)); | 201 overhead->Add(TraceEventMemoryOverhead::kTraceEvent, sizeof(*this)); |
202 | 202 |
203 if (parameter_copy_storage_) | 203 if (parameter_copy_storage_) |
204 overhead->AddString(*parameter_copy_storage_); | 204 overhead->AddString(*parameter_copy_storage_); |
205 | 205 |
206 for (size_t i = 0; i < kTraceMaxNumArgs; ++i) { | 206 for (size_t i = 0; i < kTraceMaxNumArgs; ++i) { |
207 if (arg_types_[i] == TRACE_VALUE_TYPE_CONVERTABLE) | 207 if (arg_types_[i] == TRACE_VALUE_TYPE_CONVERTABLE) |
208 convertable_values_[i]->EstimateTraceMemoryOverhead(overhead); | 208 convertable_values_[i]->EstimateTraceMemoryOverhead(overhead); |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 base::StringPrintf("0x%" PRIx64, static_cast<uint64_t>(raw_id_))); | 481 base::StringPrintf("0x%" PRIx64, static_cast<uint64_t>(raw_id_))); |
482 } | 482 } |
483 | 483 |
484 if (id_flags_ != TRACE_EVENT_FLAG_HAS_ID) | 484 if (id_flags_ != TRACE_EVENT_FLAG_HAS_ID) |
485 value->EndDictionary(); | 485 value->EndDictionary(); |
486 | 486 |
487 return std::move(value); | 487 return std::move(value); |
488 } | 488 } |
489 | 489 |
490 } // namespace trace_event_internal | 490 } // namespace trace_event_internal |
OLD | NEW |