@@ -580,14 +580,14 @@ void Profiler::Init() {
580580 return ;
581581 }
582582 ASSERT (!initialized_);
583- SetSamplePeriod (FLAG_profile_period);
584583 // The profiler may have been shutdown previously, in which case the sample
585584 // buffer will have already been initialized.
586585 if (sample_block_buffer_ == nullptr ) {
587586 intptr_t num_blocks = CalculateSampleBufferCapacity ();
588587 sample_block_buffer_ = new SampleBlockBuffer (num_blocks);
589588 }
590- ThreadInterrupter::Init ();
589+ UpdateFlagProfilePeriod (FLAG_profile_period);
590+ ThreadInterrupter::Init (FLAG_profile_period);
591591 ThreadInterrupter::Startup ();
592592 SampleBlockProcessor::Init ();
593593 SampleBlockProcessor::Startup ();
@@ -656,18 +656,18 @@ intptr_t Profiler::CalculateSampleBufferCapacity() {
656656 return (sample_count / SampleBlock::kSamplesPerBlock ) + 1 ;
657657}
658658
659- void Profiler::SetSamplePeriod (intptr_t period) {
659+ void Profiler::UpdateFlagProfilePeriod (intptr_t period) {
660660 const int kMinimumProfilePeriod = 50 ;
661661 if (period < kMinimumProfilePeriod ) {
662662 FLAG_profile_period = kMinimumProfilePeriod ;
663663 } else {
664664 FLAG_profile_period = period;
665665 }
666- ThreadInterrupter::SetInterruptPeriod (FLAG_profile_period);
667666}
668667
669668void Profiler::UpdateSamplePeriod () {
670- SetSamplePeriod (FLAG_profile_period);
669+ UpdateFlagProfilePeriod (FLAG_profile_period);
670+ ThreadInterrupter::SetInterruptPeriod (FLAG_profile_period);
671671}
672672
673673SampleBlockBuffer::SampleBlockBuffer (intptr_t blocks,
0 commit comments