OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 // Using non-relative system time in order to be able to synchronize with | 998 // Using non-relative system time in order to be able to synchronize with |
999 // external memory profiling events (e.g. DOM memory size). | 999 // external memory profiling events (e.g. DOM memory size). |
1000 msg.Append("heap-sample-begin,\"%s\",\"%s\",%.0f\n", | 1000 msg.Append("heap-sample-begin,\"%s\",\"%s\",%.0f\n", |
1001 space, kind, OS::TimeCurrentMillis()); | 1001 space, kind, OS::TimeCurrentMillis()); |
1002 msg.WriteToLogFile(); | 1002 msg.WriteToLogFile(); |
1003 #endif | 1003 #endif |
1004 } | 1004 } |
1005 | 1005 |
1006 | 1006 |
1007 void Logger::HeapSampleStats(const char* space, const char* kind, | 1007 void Logger::HeapSampleStats(const char* space, const char* kind, |
1008 intptr_t capacity, intptr_t used) { | 1008 int capacity, int used) { |
1009 #ifdef ENABLE_LOGGING_AND_PROFILING | 1009 #ifdef ENABLE_LOGGING_AND_PROFILING |
1010 if (!Log::IsEnabled() || !FLAG_log_gc) return; | 1010 if (!Log::IsEnabled() || !FLAG_log_gc) return; |
1011 LogMessageBuilder msg; | 1011 LogMessageBuilder msg; |
1012 msg.Append("heap-sample-stats,\"%s\",\"%s\"," | 1012 msg.Append("heap-sample-stats,\"%s\",\"%s\",%d,%d\n", |
1013 "%" V8_PTR_PREFIX "d,%" V8_PTR_PREFIX "d\n", | |
1014 space, kind, capacity, used); | 1013 space, kind, capacity, used); |
1015 msg.WriteToLogFile(); | 1014 msg.WriteToLogFile(); |
1016 #endif | 1015 #endif |
1017 } | 1016 } |
1018 | 1017 |
1019 | 1018 |
1020 void Logger::HeapSampleEndEvent(const char* space, const char* kind) { | 1019 void Logger::HeapSampleEndEvent(const char* space, const char* kind) { |
1021 #ifdef ENABLE_LOGGING_AND_PROFILING | 1020 #ifdef ENABLE_LOGGING_AND_PROFILING |
1022 if (!Log::IsEnabled() || !FLAG_log_gc) return; | 1021 if (!Log::IsEnabled() || !FLAG_log_gc) return; |
1023 LogMessageBuilder msg; | 1022 LogMessageBuilder msg; |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 } | 1569 } |
1571 // Otherwise, if the sliding state window computation has not been | 1570 // Otherwise, if the sliding state window computation has not been |
1572 // started we do it now. | 1571 // started we do it now. |
1573 if (sliding_state_window_ == NULL) { | 1572 if (sliding_state_window_ == NULL) { |
1574 sliding_state_window_ = new SlidingStateWindow(); | 1573 sliding_state_window_ = new SlidingStateWindow(); |
1575 } | 1574 } |
1576 #endif | 1575 #endif |
1577 } | 1576 } |
1578 | 1577 |
1579 } } // namespace v8::internal | 1578 } } // namespace v8::internal |
OLD | NEW |