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

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

Issue 1508233003: Record OSThread::trace_id() instead of OSThread::id() in profile samples. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/address_sanitizer.h" 5 #include "platform/address_sanitizer.h"
6 #include "platform/memory_sanitizer.h" 6 #include "platform/memory_sanitizer.h"
7 #include "platform/utils.h" 7 #include "platform/utils.h"
8 8
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/atomic.h" 10 #include "vm/atomic.h"
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 891
892 if (!GetAndValidateIsolateStackBounds(thread, 892 if (!GetAndValidateIsolateStackBounds(thread,
893 fp, 893 fp,
894 sp, 894 sp,
895 &stack_lower, 895 &stack_lower,
896 &stack_upper)) { 896 &stack_upper)) {
897 // Could not get stack boundary. 897 // Could not get stack boundary.
898 return; 898 return;
899 } 899 }
900 900
901 Sample* sample = SetupSample(thread, sample_buffer, os_thread->id()); 901 Sample* sample = SetupSample(thread, sample_buffer, os_thread->trace_id());
902 sample->SetAllocationCid(cid); 902 sample->SetAllocationCid(cid);
903 ProfilerNativeStackWalker native_stack_walker(isolate, 903 ProfilerNativeStackWalker native_stack_walker(isolate,
904 sample, 904 sample,
905 sample_buffer, 905 sample_buffer,
906 stack_lower, 906 stack_lower,
907 stack_upper, 907 stack_upper,
908 pc, 908 pc,
909 fp, 909 fp,
910 sp); 910 sp);
911 native_stack_walker.walk(); 911 native_stack_walker.walk();
912 } else if (exited_dart_code) { 912 } else if (exited_dart_code) {
913 Sample* sample = SetupSample(thread, sample_buffer, os_thread->id()); 913 Sample* sample = SetupSample(thread, sample_buffer, os_thread->trace_id());
914 sample->SetAllocationCid(cid); 914 sample->SetAllocationCid(cid);
915 ProfilerDartExitStackWalker dart_exit_stack_walker(thread, 915 ProfilerDartExitStackWalker dart_exit_stack_walker(thread,
916 isolate, 916 isolate,
917 sample, 917 sample,
918 sample_buffer); 918 sample_buffer);
919 dart_exit_stack_walker.walk(); 919 dart_exit_stack_walker.walk();
920 } else { 920 } else {
921 // Fall back. 921 // Fall back.
922 uintptr_t pc = GetProgramCounter(); 922 uintptr_t pc = GetProgramCounter();
923 Sample* sample = SetupSample(thread, sample_buffer, os_thread->id()); 923 Sample* sample = SetupSample(thread, sample_buffer, os_thread->trace_id());
924 sample->SetAllocationCid(cid); 924 sample->SetAllocationCid(cid);
925 sample->SetAt(0, pc); 925 sample->SetAt(0, pc);
926 } 926 }
927 } 927 }
928 928
929 929
930 void Profiler::SampleThread(Thread* thread, 930 void Profiler::SampleThread(Thread* thread,
931 const InterruptedThreadState& state) { 931 const InterruptedThreadState& state) {
932 ASSERT(thread != NULL); 932 ASSERT(thread != NULL);
933 OSThread* os_thread = thread->os_thread(); 933 OSThread* os_thread = thread->os_thread();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 993
994 // At this point we have a valid stack boundary for this isolate and 994 // At this point we have a valid stack boundary for this isolate and
995 // know that our initial stack and frame pointers are within the boundary. 995 // know that our initial stack and frame pointers are within the boundary.
996 SampleBuffer* sample_buffer = Profiler::sample_buffer(); 996 SampleBuffer* sample_buffer = Profiler::sample_buffer();
997 if (sample_buffer == NULL) { 997 if (sample_buffer == NULL) {
998 // Profiler not initialized. 998 // Profiler not initialized.
999 return; 999 return;
1000 } 1000 }
1001 1001
1002 // Setup sample. 1002 // Setup sample.
1003 Sample* sample = SetupSample(thread, sample_buffer, os_thread->id()); 1003 Sample* sample = SetupSample(thread, sample_buffer, os_thread->trace_id());
1004 // Increment counter for vm tag. 1004 // Increment counter for vm tag.
1005 VMTagCounters* counters = isolate->vm_tag_counters(); 1005 VMTagCounters* counters = isolate->vm_tag_counters();
1006 ASSERT(counters != NULL); 1006 ASSERT(counters != NULL);
1007 counters->Increment(sample->vm_tag()); 1007 counters->Increment(sample->vm_tag());
1008 1008
1009 ProfilerNativeStackWalker native_stack_walker(isolate, 1009 ProfilerNativeStackWalker native_stack_walker(isolate,
1010 sample, 1010 sample,
1011 sample_buffer, 1011 sample_buffer,
1012 stack_lower, 1012 stack_lower,
1013 stack_upper, 1013 stack_upper,
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 } 1361 }
1362 } 1362 }
1363 1363
1364 1364
1365 ProcessedSampleBuffer::ProcessedSampleBuffer() 1365 ProcessedSampleBuffer::ProcessedSampleBuffer()
1366 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { 1366 : code_lookup_table_(new CodeLookupTable(Thread::Current())) {
1367 ASSERT(code_lookup_table_ != NULL); 1367 ASSERT(code_lookup_table_ != NULL);
1368 } 1368 }
1369 1369
1370 } // namespace dart 1370 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698