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

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

Issue 1897963002: Add --timeline-recorder= flag and fix --timeline-dir flag (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | runtime/vm/timeline.cc » ('j') | runtime/vm/timeline.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 "vm/log.h" 5 #include "vm/log.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/thread.h" 8 #include "vm/thread.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 13 matching lines...) Expand all
24 24
25 25
26 Log::~Log() { 26 Log::~Log() {
27 // Did someone enable manual flushing and then forgot to Flush? 27 // Did someone enable manual flushing and then forgot to Flush?
28 ASSERT(cursor() == 0); 28 ASSERT(cursor() == 0);
29 } 29 }
30 30
31 31
32 Log* Log::Current() { 32 Log* Log::Current() {
33 Thread* thread = Thread::Current(); 33 Thread* thread = Thread::Current();
34 if (thread == NULL) {
35 OSThread* os_thread = OSThread::Current();
36 ASSERT(os_thread != NULL);
37 return os_thread->log();
38 }
34 Isolate* isolate = thread->isolate(); 39 Isolate* isolate = thread->isolate();
35 if (isolate != NULL && Log::ShouldLogForIsolate(isolate)) { 40 if (isolate != NULL && Log::ShouldLogForIsolate(isolate)) {
36 OSThread* os_thread = thread->os_thread(); 41 OSThread* os_thread = thread->os_thread();
37 ASSERT(os_thread != NULL); 42 ASSERT(os_thread != NULL);
38 return os_thread->log(); 43 return os_thread->log();
39 } else { 44 } else {
40 return Log::NoOpLog(); 45 return Log::NoOpLog();
41 } 46 }
42 } 47 }
43 48
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 log_->EnableManualFlush(); 178 log_->EnableManualFlush();
174 } 179 }
175 180
176 181
177 LogBlock::~LogBlock() { 182 LogBlock::~LogBlock() {
178 log_->Flush(cursor_); 183 log_->Flush(cursor_);
179 log_->DisableManualFlush(); 184 log_->DisableManualFlush();
180 } 185 }
181 186
182 } // namespace dart 187 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/timeline.cc » ('j') | runtime/vm/timeline.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698