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

Side by Side Diff: src/sampler.cc

Issue 259803002: Add timestamps to CPU profile samples. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix race Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/sampler.h ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 Mutex* SamplerThread::mutex_ = NULL; 582 Mutex* SamplerThread::mutex_ = NULL;
583 SamplerThread* SamplerThread::instance_ = NULL; 583 SamplerThread* SamplerThread::instance_ = NULL;
584 584
585 585
586 // 586 //
587 // StackTracer implementation 587 // StackTracer implementation
588 // 588 //
589 DISABLE_ASAN void TickSample::Init(Isolate* isolate, 589 DISABLE_ASAN void TickSample::Init(Isolate* isolate,
590 const RegisterState& regs) { 590 const RegisterState& regs) {
591 ASSERT(isolate->IsInitialized()); 591 ASSERT(isolate->IsInitialized());
592 timestamp = TimeTicks::HighResolutionNow();
592 pc = regs.pc; 593 pc = regs.pc;
593 state = isolate->current_vm_state(); 594 state = isolate->current_vm_state();
594 595
595 // Avoid collecting traces while doing GC. 596 // Avoid collecting traces while doing GC.
596 if (state == GC) return; 597 if (state == GC) return;
597 598
598 Address js_entry_sp = isolate->js_entry_sp(); 599 Address js_entry_sp = isolate->js_entry_sp();
599 if (js_entry_sp == 0) { 600 if (js_entry_sp == 0) {
600 // Not executing JS now. 601 // Not executing JS now.
601 return; 602 return;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 #endif // USE_SIMULATOR 751 #endif // USE_SIMULATOR
751 SampleStack(state); 752 SampleStack(state);
752 } 753 }
753 ResumeThread(profiled_thread); 754 ResumeThread(profiled_thread);
754 } 755 }
755 756
756 #endif // USE_SIGNALS 757 #endif // USE_SIGNALS
757 758
758 759
759 } } // namespace v8::internal 760 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/sampler.h ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698