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

Side by Side Diff: src/profile-generator.cc

Issue 22715004: Version 3.20.15 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Add TypedArray API and correctness patches r16033 and r16084 Created 7 years, 4 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/profile-generator.h ('k') | src/runtime.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 OS::Print("root: %u %u %.2fms %.2fms\n", 369 OS::Print("root: %u %u %.2fms %.2fms\n",
370 root_->total_ticks(), root_->self_ticks(), 370 root_->total_ticks(), root_->self_ticks(),
371 root_->GetTotalMillis(), root_->GetSelfMillis()); 371 root_->GetTotalMillis(), root_->GetSelfMillis());
372 } 372 }
373 373
374 374
375 CpuProfile::CpuProfile(const char* title, unsigned uid, bool record_samples) 375 CpuProfile::CpuProfile(const char* title, unsigned uid, bool record_samples)
376 : title_(title), 376 : title_(title),
377 uid_(uid), 377 uid_(uid),
378 record_samples_(record_samples), 378 record_samples_(record_samples),
379 start_time_us_(OS::Ticks()), 379 start_time_ms_(OS::TimeCurrentMillis()),
380 end_time_us_(0) { 380 end_time_ms_(0) {
381 } 381 }
382 382
383 383
384 void CpuProfile::AddPath(const Vector<CodeEntry*>& path) { 384 void CpuProfile::AddPath(const Vector<CodeEntry*>& path) {
385 ProfileNode* top_frame_node = top_down_.AddPathFromEnd(path); 385 ProfileNode* top_frame_node = top_down_.AddPathFromEnd(path);
386 if (record_samples_) samples_.Add(top_frame_node); 386 if (record_samples_) samples_.Add(top_frame_node);
387 } 387 }
388 388
389 389
390 void CpuProfile::CalculateTotalTicksAndSamplingRate() { 390 void CpuProfile::CalculateTotalTicksAndSamplingRate() {
391 end_time_us_ = OS::Ticks(); 391 end_time_ms_ = OS::TimeCurrentMillis();
392 top_down_.CalculateTotalTicks(); 392 top_down_.CalculateTotalTicks();
393 393
394 double duration_ms = (end_time_us_ - start_time_us_) / 1000.; 394 double duration = end_time_ms_ - start_time_ms_;
395 if (duration_ms < 1) duration_ms = 1; 395 if (duration < 1) duration = 1;
396 unsigned ticks = top_down_.root()->total_ticks(); 396 unsigned ticks = top_down_.root()->total_ticks();
397 double rate = ticks / duration_ms; 397 double rate = ticks / duration;
398 top_down_.SetTickRatePerMs(rate); 398 top_down_.SetTickRatePerMs(rate);
399 } 399 }
400 400
401 401
402 void CpuProfile::ShortPrint() { 402 void CpuProfile::ShortPrint() {
403 OS::Print("top down "); 403 OS::Print("top down ");
404 top_down_.ShortPrint(); 404 top_down_.ShortPrint();
405 } 405 }
406 406
407 407
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 if (no_symbolized_entries) { 703 if (no_symbolized_entries) {
704 *entry++ = EntryForVMState(sample.state); 704 *entry++ = EntryForVMState(sample.state);
705 } 705 }
706 } 706 }
707 707
708 profiles_->AddPathToCurrentProfiles(entries); 708 profiles_->AddPathToCurrentProfiles(entries);
709 } 709 }
710 710
711 711
712 } } // namespace v8::internal 712 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/profile-generator.h ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698