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

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

Issue 23490015: Reland^2 "Add Chromium-style TimeDelta, Time and TimeTicks classes, and a new ElapsedTimer class." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Some windows cleanup Created 7 years, 3 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/win32-headers.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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 stack.RemoveLast(); 327 stack.RemoveLast();
328 } 328 }
329 } 329 }
330 } 330 }
331 331
332 332
333 CpuProfile::CpuProfile(const char* title, unsigned uid, bool record_samples) 333 CpuProfile::CpuProfile(const char* title, unsigned uid, bool record_samples)
334 : title_(title), 334 : title_(title),
335 uid_(uid), 335 uid_(uid),
336 record_samples_(record_samples), 336 record_samples_(record_samples),
337 start_time_us_(OS::Ticks()), 337 start_time_(Time::NowFromSystemTime()) {
338 end_time_us_(0) { 338 timer_.Start();
339 } 339 }
340 340
341 341
342 void CpuProfile::AddPath(const Vector<CodeEntry*>& path) { 342 void CpuProfile::AddPath(const Vector<CodeEntry*>& path) {
343 ProfileNode* top_frame_node = top_down_.AddPathFromEnd(path); 343 ProfileNode* top_frame_node = top_down_.AddPathFromEnd(path);
344 if (record_samples_) samples_.Add(top_frame_node); 344 if (record_samples_) samples_.Add(top_frame_node);
345 } 345 }
346 346
347 347
348 void CpuProfile::CalculateTotalTicksAndSamplingRate() { 348 void CpuProfile::CalculateTotalTicksAndSamplingRate() {
349 end_time_us_ = OS::Ticks(); 349 end_time_ = start_time_ + timer_.Elapsed();
350 } 350 }
351 351
352 352
353 void CpuProfile::Print() { 353 void CpuProfile::Print() {
354 OS::Print("[Top down]:\n"); 354 OS::Print("[Top down]:\n");
355 top_down_.Print(); 355 top_down_.Print();
356 } 356 }
357 357
358 358
359 CodeEntry* const CodeMap::kSharedFunctionCodeEntry = NULL; 359 CodeEntry* const CodeMap::kSharedFunctionCodeEntry = NULL;
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 if (no_symbolized_entries) { 652 if (no_symbolized_entries) {
653 *entry++ = EntryForVMState(sample.state); 653 *entry++ = EntryForVMState(sample.state);
654 } 654 }
655 } 655 }
656 656
657 profiles_->AddPathToCurrentProfiles(entries); 657 profiles_->AddPathToCurrentProfiles(entries);
658 } 658 }
659 659
660 660
661 } } // namespace v8::internal 661 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/profile-generator.h ('k') | src/win32-headers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698