OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 Semaphore* current_profiles_semaphore_; | 326 Semaphore* current_profiles_semaphore_; |
327 | 327 |
328 DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection); | 328 DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection); |
329 }; | 329 }; |
330 | 330 |
331 | 331 |
332 class SampleRateCalculator { | 332 class SampleRateCalculator { |
333 public: | 333 public: |
334 SampleRateCalculator() | 334 SampleRateCalculator() |
335 : result_(Logger::kSamplingIntervalMs * kResultScale), | 335 : result_(Logger::kSamplingIntervalMs * kResultScale), |
336 ticks_per_ms_(Logger::kSamplingIntervalMs), | 336 ticks_per_ms_(1.0 / Logger::kSamplingIntervalMs), |
337 measurements_count_(0), | 337 measurements_count_(0), |
338 wall_time_query_countdown_(1) { | 338 wall_time_query_countdown_(1) { |
339 } | 339 } |
340 | 340 |
341 double ticks_per_ms() { | 341 double ticks_per_ms() { |
342 return result_ / static_cast<double>(kResultScale); | 342 return result_ / static_cast<double>(kResultScale); |
343 } | 343 } |
344 void Tick(); | 344 void Tick(); |
345 void UpdateMeasurements(double current_time); | 345 void UpdateMeasurements(double current_time); |
346 | 346 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 CodeEntry* unresolved_entry_; | 397 CodeEntry* unresolved_entry_; |
398 SampleRateCalculator sample_rate_calc_; | 398 SampleRateCalculator sample_rate_calc_; |
399 | 399 |
400 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 400 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
401 }; | 401 }; |
402 | 402 |
403 | 403 |
404 } } // namespace v8::internal | 404 } } // namespace v8::internal |
405 | 405 |
406 #endif // V8_PROFILE_GENERATOR_H_ | 406 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |