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

Side by Side Diff: src/log.cc

Issue 11412125: Add parallel recompilation time to histogram and plot execution pause times. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: make new counters non-histograms Created 8 years, 1 month 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/log.h ('k') | src/log-utils.cc » ('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 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 cpu_profiler_nesting_(0), 524 cpu_profiler_nesting_(0),
525 log_(new Log(this)), 525 log_(new Log(this)),
526 name_buffer_(new NameBuffer), 526 name_buffer_(new NameBuffer),
527 address_to_name_map_(NULL), 527 address_to_name_map_(NULL),
528 is_initialized_(false), 528 is_initialized_(false),
529 code_event_handler_(NULL), 529 code_event_handler_(NULL),
530 last_address_(NULL), 530 last_address_(NULL),
531 prev_sp_(NULL), 531 prev_sp_(NULL),
532 prev_function_(NULL), 532 prev_function_(NULL),
533 prev_to_(NULL), 533 prev_to_(NULL),
534 prev_code_(NULL) { 534 prev_code_(NULL),
535 epoch_(0) {
535 } 536 }
536 537
537 538
538 Logger::~Logger() { 539 Logger::~Logger() {
539 delete address_to_name_map_; 540 delete address_to_name_map_;
540 delete name_buffer_; 541 delete name_buffer_;
541 delete log_; 542 delete log_;
542 } 543 }
543 544
544 545
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 if (!log_->IsEnabled() || !FLAG_prof) return; 698 if (!log_->IsEnabled() || !FLAG_prof) return;
698 LogMessageBuilder msg(this); 699 LogMessageBuilder msg(this);
699 msg.Append("shared-library,\"%ls\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR "\n", 700 msg.Append("shared-library,\"%ls\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR "\n",
700 library_path, 701 library_path,
701 start, 702 start,
702 end); 703 end);
703 msg.WriteToLogFile(); 704 msg.WriteToLogFile();
704 } 705 }
705 706
706 707
708 void Logger::TimerEvent(const char* name, int64_t start, int64_t end) {
709 ASSERT(FLAG_log_timer_events);
710 LogMessageBuilder msg(this);
711 int since_epoch = static_cast<int>(start - epoch_);
712 int pause_time = static_cast<int>(end - start);
713 msg.Append("timer-event,\"%s\",%ld,%ld\n", name, since_epoch, pause_time);
714 msg.WriteToLogFile();
715 }
716
717
718 const char* Logger::TimerEventScope::v8_recompile_synchronous =
719 "V8.RecompileSynchronous";
720 const char* Logger::TimerEventScope::v8_recompile_parallel =
721 "V8.RecompileParallel";
722 const char* Logger::TimerEventScope::v8_compile_full_code =
723 "V8.CompileFullCode";
724 const char* Logger::TimerEventScope::v8_execute = "V8.Execute";
725
726
707 void Logger::LogRegExpSource(Handle<JSRegExp> regexp) { 727 void Logger::LogRegExpSource(Handle<JSRegExp> regexp) {
708 // Prints "/" + re.source + "/" + 728 // Prints "/" + re.source + "/" +
709 // (re.global?"g":"") + (re.ignorecase?"i":"") + (re.multiline?"m":"") 729 // (re.global?"g":"") + (re.ignorecase?"i":"") + (re.multiline?"m":"")
710 LogMessageBuilder msg(this); 730 LogMessageBuilder msg(this);
711 731
712 Handle<Object> source = GetProperty(regexp, "source"); 732 Handle<Object> source = GetProperty(regexp, "source");
713 if (!source->IsString()) { 733 if (!source->IsString()) {
714 msg.Append("no source"); 734 msg.Append("no source");
715 return; 735 return;
716 } 736 }
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 1740
1721 Isolate* isolate = Isolate::Current(); 1741 Isolate* isolate = Isolate::Current();
1722 ticker_ = new Ticker(isolate, kSamplingIntervalMs); 1742 ticker_ = new Ticker(isolate, kSamplingIntervalMs);
1723 1743
1724 if (FLAG_sliding_state_window && sliding_state_window_ == NULL) { 1744 if (FLAG_sliding_state_window && sliding_state_window_ == NULL) {
1725 sliding_state_window_ = new SlidingStateWindow(isolate); 1745 sliding_state_window_ = new SlidingStateWindow(isolate);
1726 } 1746 }
1727 1747
1728 bool start_logging = FLAG_log || FLAG_log_runtime || FLAG_log_api 1748 bool start_logging = FLAG_log || FLAG_log_runtime || FLAG_log_api
1729 || FLAG_log_code || FLAG_log_gc || FLAG_log_handles || FLAG_log_suspect 1749 || FLAG_log_code || FLAG_log_gc || FLAG_log_handles || FLAG_log_suspect
1730 || FLAG_log_regexp || FLAG_log_state_changes || FLAG_ll_prof; 1750 || FLAG_log_regexp || FLAG_log_state_changes || FLAG_ll_prof
1751 || FLAG_log_timer_events;
1731 1752
1732 if (start_logging) { 1753 if (start_logging) {
1733 logging_nesting_ = 1; 1754 logging_nesting_ = 1;
1734 } 1755 }
1735 1756
1736 if (FLAG_prof) { 1757 if (FLAG_prof) {
1737 profiler_ = new Profiler(isolate); 1758 profiler_ = new Profiler(isolate);
1738 if (!FLAG_prof_auto) { 1759 if (!FLAG_prof_auto) {
1739 profiler_->pause(); 1760 profiler_->pause();
1740 } else { 1761 } else {
1741 logging_nesting_ = 1; 1762 logging_nesting_ = 1;
1742 } 1763 }
1743 if (!FLAG_prof_lazy) { 1764 if (!FLAG_prof_lazy) {
1744 profiler_->Engage(); 1765 profiler_->Engage();
1745 } 1766 }
1746 } 1767 }
1747 1768
1769 if (FLAG_log_timer_events) epoch_ = OS::Ticks();
1770
1748 return true; 1771 return true;
1749 } 1772 }
1750 1773
1751 1774
1752 void Logger::SetCodeEventHandler(uint32_t options, 1775 void Logger::SetCodeEventHandler(uint32_t options,
1753 JitCodeEventHandler event_handler) { 1776 JitCodeEventHandler event_handler) {
1754 code_event_handler_ = event_handler; 1777 code_event_handler_ = event_handler;
1755 1778
1756 if (code_event_handler_ != NULL && (options & kJitCodeEventEnumExisting)) { 1779 if (code_event_handler_ != NULL && (options & kJitCodeEventEnumExisting)) {
1757 HandleScope scope; 1780 HandleScope scope;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1868 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { 1891 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) {
1869 ASSERT(sampler->IsActive()); 1892 ASSERT(sampler->IsActive());
1870 ScopedLock lock(active_samplers_mutex); 1893 ScopedLock lock(active_samplers_mutex);
1871 ASSERT(active_samplers_ != NULL); 1894 ASSERT(active_samplers_ != NULL);
1872 bool removed = active_samplers_->RemoveElement(sampler); 1895 bool removed = active_samplers_->RemoveElement(sampler);
1873 ASSERT(removed); 1896 ASSERT(removed);
1874 USE(removed); 1897 USE(removed);
1875 } 1898 }
1876 1899
1877 } } // namespace v8::internal 1900 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/log.h ('k') | src/log-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698