Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: runtime/vm/timeline_fuchsia.cc

Issue 2984313002: Allocate the fixed-size timeline buffer with virtual memory instead of malloc. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(HOST_OS_FUCHSIA) && !defined(PRODUCT) 6 #if defined(HOST_OS_FUCHSIA) && !defined(PRODUCT)
7 7
8 #include "apps/tracing/lib/trace/cwriter.h" 8 #include "apps/tracing/lib/trace/cwriter.h"
9 #include "apps/tracing/lib/trace/event.h" 9 #include "apps/tracing/lib/trace/event.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 19 matching lines...) Expand all
30 const char* TimelineEventPlatformRecorder::name() const { 30 const char* TimelineEventPlatformRecorder::name() const {
31 return "Fuchsia"; 31 return "Fuchsia";
32 } 32 }
33 33
34 TimelineEventBlock* TimelineEventPlatformRecorder::GetNewBlockLocked() { 34 TimelineEventBlock* TimelineEventPlatformRecorder::GetNewBlockLocked() {
35 // TODO(johnmccutchan): This function should only hand out blocks 35 // TODO(johnmccutchan): This function should only hand out blocks
36 // which have been marked as finished. 36 // which have been marked as finished.
37 if (block_cursor_ == num_blocks_) { 37 if (block_cursor_ == num_blocks_) {
38 block_cursor_ = 0; 38 block_cursor_ = 0;
39 } 39 }
40 TimelineEventBlock* block = blocks_[block_cursor_++]; 40 TimelineEventBlock* block = &blocks_[block_cursor_++];
41 block->Reset(); 41 block->Reset();
42 block->Open(); 42 block->Open();
43 return block; 43 return block;
44 } 44 }
45 45
46 void TimelineEventPlatformRecorder::CompleteEvent(TimelineEvent* event) { 46 void TimelineEventPlatformRecorder::CompleteEvent(TimelineEvent* event) {
47 if (event == NULL) { 47 if (event == NULL) {
48 return; 48 return;
49 } 49 }
50 if (!ctrace_is_enabled()) { 50 if (!ctrace_is_enabled()) {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 event->Instant(strdup(name), start); 198 event->Instant(strdup(name), start);
199 event->set_owns_label(true); 199 event->set_owns_label(true);
200 event->SetNumArguments(1); 200 event->SetNumArguments(1);
201 event->CopyArgument(0, "args", args); 201 event->CopyArgument(0, "args", args);
202 event->Complete(); 202 event->Complete();
203 } 203 }
204 204
205 } // namespace dart 205 } // namespace dart
206 206
207 #endif // defined(HOST_OS_FUCHSIA) && !defined(PRODUCT) 207 #endif // defined(HOST_OS_FUCHSIA) && !defined(PRODUCT)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698