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

Side by Side Diff: src/log.cc

Issue 24566004: Add an API for additional profile log records (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 2 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
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 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 msg.Append(String::cast(name)); 1434 msg.Append(String::cast(name));
1435 msg.Append('"'); 1435 msg.Append('"');
1436 } else { 1436 } else {
1437 msg.AppendSymbolName(Symbol::cast(name)); 1437 msg.AppendSymbolName(Symbol::cast(name));
1438 } 1438 }
1439 msg.Append('\n'); 1439 msg.Append('\n');
1440 msg.WriteToLogFile(); 1440 msg.WriteToLogFile();
1441 } 1441 }
1442 1442
1443 1443
1444 void Logger::MarkEvent(char* mark) {
1445 if (!log_->IsEnabled()) return;
1446 Log::MessageBuilder msg(log_);
1447 msg.Append("%s,%s\n", kLogEventsNames[MARK_EVENT], mark);
1448 msg.WriteToLogFile();
1449 }
1450
1451
1444 void Logger::HeapSampleBeginEvent(const char* space, const char* kind) { 1452 void Logger::HeapSampleBeginEvent(const char* space, const char* kind) {
1445 if (!log_->IsEnabled() || !FLAG_log_gc) return; 1453 if (!log_->IsEnabled() || !FLAG_log_gc) return;
1446 Log::MessageBuilder msg(log_); 1454 Log::MessageBuilder msg(log_);
1447 // Using non-relative system time in order to be able to synchronize with 1455 // Using non-relative system time in order to be able to synchronize with
1448 // external memory profiling events (e.g. DOM memory size). 1456 // external memory profiling events (e.g. DOM memory size).
1449 msg.Append("heap-sample-begin,\"%s\",\"%s\",%.0f\n", 1457 msg.Append("heap-sample-begin,\"%s\",\"%s\",%.0f\n",
1450 space, kind, OS::TimeCurrentMillis()); 1458 space, kind, OS::TimeCurrentMillis());
1451 msg.WriteToLogFile(); 1459 msg.WriteToLogFile();
1452 } 1460 }
1453 1461
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 if (jit_logger_) { 1913 if (jit_logger_) {
1906 removeCodeEventListener(jit_logger_); 1914 removeCodeEventListener(jit_logger_);
1907 delete jit_logger_; 1915 delete jit_logger_;
1908 jit_logger_ = NULL; 1916 jit_logger_ = NULL;
1909 } 1917 }
1910 1918
1911 return log_->Close(); 1919 return log_->Close();
1912 } 1920 }
1913 1921
1914 } } // namespace v8::internal 1922 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698