| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 if (!SamplerRegistry::IterateActiveSamplers(&DoCpuProfile, this)) { | 618 if (!SamplerRegistry::IterateActiveSamplers(&DoCpuProfile, this)) { |
| 619 return; | 619 return; |
| 620 } | 620 } |
| 621 } | 621 } |
| 622 if (runtime_profiler_enabled) { | 622 if (runtime_profiler_enabled) { |
| 623 if (!SamplerRegistry::IterateActiveSamplers(&DoRuntimeProfile, NULL)) { | 623 if (!SamplerRegistry::IterateActiveSamplers(&DoRuntimeProfile, NULL)) { |
| 624 return; | 624 return; |
| 625 } | 625 } |
| 626 } | 626 } |
| 627 OS::Sleep(interval_); | 627 OS::Sleep(interval_); |
| 628 state = SamplerRegistry::GetState(); |
| 628 } | 629 } |
| 629 } | 630 } |
| 630 | 631 |
| 631 static void DoCpuProfile(Sampler* sampler, void* raw_sampler_thread) { | 632 static void DoCpuProfile(Sampler* sampler, void* raw_sampler_thread) { |
| 632 if (!sampler->IsProfiling()) return; | 633 if (!sampler->IsProfiling()) return; |
| 633 SamplerThread* sampler_thread = | 634 SamplerThread* sampler_thread = |
| 634 reinterpret_cast<SamplerThread*>(raw_sampler_thread); | 635 reinterpret_cast<SamplerThread*>(raw_sampler_thread); |
| 635 sampler_thread->SampleContext(sampler); | 636 sampler_thread->SampleContext(sampler); |
| 636 } | 637 } |
| 637 | 638 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 | 727 |
| 727 void Sampler::Stop() { | 728 void Sampler::Stop() { |
| 728 ASSERT(IsActive()); | 729 ASSERT(IsActive()); |
| 729 SamplerThread::RemoveActiveSampler(this); | 730 SamplerThread::RemoveActiveSampler(this); |
| 730 SetActive(false); | 731 SetActive(false); |
| 731 } | 732 } |
| 732 | 733 |
| 733 #endif // ENABLE_LOGGING_AND_PROFILING | 734 #endif // ENABLE_LOGGING_AND_PROFILING |
| 734 | 735 |
| 735 } } // namespace v8::internal | 736 } } // namespace v8::internal |
| OLD | NEW |