Index: src/log.cc |
diff --git a/src/log.cc b/src/log.cc |
index 16f3fb5bf81044be2147322d2442fd90291be6cf..33cf8e271affd4dcb6bd2ae6d3e53ad1ff1e8005 100644 |
--- a/src/log.cc |
+++ b/src/log.cc |
@@ -843,12 +843,22 @@ void Logger::HeapSampleBeginEvent(const char* space, const char* kind) { |
#ifdef ENABLE_LOGGING_AND_PROFILING |
if (!Log::IsEnabled() || !FLAG_log_gc) return; |
LogMessageBuilder msg; |
- msg.Append("heap-sample-begin,\"%s\",\"%s\"", space, kind); |
- uint32_t sec, usec; |
- if (OS::GetUserTime(&sec, &usec) != -1) { |
- msg.Append(",%d,%d", sec, usec); |
- } |
- msg.Append('\n'); |
+ // Using non-relative system time in order to be able to synchronize with |
+ // external memory profiling events (e.g. DOM memory size). |
+ msg.Append("heap-sample-begin,\"%s\",\"%s\",%.0f\n", |
+ space, kind, OS::TimeCurrentMillis()); |
+ msg.WriteToLogFile(); |
+#endif |
+} |
+ |
+ |
+void Logger::HeapSampleStats(const char* space, const char* kind, |
+ int capacity, int used) { |
+#ifdef ENABLE_LOGGING_AND_PROFILING |
+ if (!Log::IsEnabled() || !FLAG_log_gc) return; |
+ LogMessageBuilder msg; |
+ msg.Append("heap-sample-stats,\"%s\",\"%s\",%d,%d\n", |
+ space, kind, capacity, used); |
msg.WriteToLogFile(); |
#endif |
} |