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

Side by Side Diff: runtime/vm/timeline_linux.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_LINUX) && !defined(PRODUCT) 6 #if defined(HOST_OS_LINUX) && !defined(PRODUCT)
7 7
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <cstdlib> 10 #include <cstdlib>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 const char* TimelineEventPlatformRecorder::name() const { 103 const char* TimelineEventPlatformRecorder::name() const {
104 return "Systrace"; 104 return "Systrace";
105 } 105 }
106 106
107 TimelineEventBlock* TimelineEventPlatformRecorder::GetNewBlockLocked() { 107 TimelineEventBlock* TimelineEventPlatformRecorder::GetNewBlockLocked() {
108 // TODO(johnmccutchan): This function should only hand out blocks 108 // TODO(johnmccutchan): This function should only hand out blocks
109 // which have been marked as finished. 109 // which have been marked as finished.
110 if (block_cursor_ == num_blocks_) { 110 if (block_cursor_ == num_blocks_) {
111 block_cursor_ = 0; 111 block_cursor_ = 0;
112 } 112 }
113 TimelineEventBlock* block = blocks_[block_cursor_++]; 113 TimelineEventBlock* block = &blocks_[block_cursor_++];
114 block->Reset(); 114 block->Reset();
115 block->Open(); 115 block->Open();
116 return block; 116 return block;
117 } 117 }
118 118
119 void TimelineEventPlatformRecorder::CompleteEvent(TimelineEvent* event) { 119 void TimelineEventPlatformRecorder::CompleteEvent(TimelineEvent* event) {
120 UNREACHABLE(); 120 UNREACHABLE();
121 } 121 }
122 122
123 void DartTimelineEventHelpers::ReportTaskEvent(Thread* thread, 123 void DartTimelineEventHelpers::ReportTaskEvent(Thread* thread,
(...skipping 28 matching lines...) Expand all
152 const char* category, 152 const char* category,
153 const char* name, 153 const char* name,
154 const char* args) { 154 const char* args) {
155 DartCommonTimelineEventHelpers::ReportInstantEvent(thread, zone, event, start, 155 DartCommonTimelineEventHelpers::ReportInstantEvent(thread, zone, event, start,
156 category, name, args); 156 category, name, args);
157 } 157 }
158 158
159 } // namespace dart 159 } // namespace dart
160 160
161 #endif // defined(HOST_OS_LINUX) && !defined(PRODUCT) 161 #endif // defined(HOST_OS_LINUX) && !defined(PRODUCT)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698