OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // Read heap stats. | 158 // Read heap stats. |
159 | 159 |
160 #define READ_FIELD(offset) \ | 160 #define READ_FIELD(offset) \ |
161 ReadPointedValue(memory_region, heap_stats_addr, offset) | 161 ReadPointedValue(memory_region, heap_stats_addr, offset) |
162 | 162 |
163 CHECK(READ_FIELD(0) == v8::internal::HeapStats::kStartMarker); | 163 CHECK(READ_FIELD(0) == v8::internal::HeapStats::kStartMarker); |
164 CHECK(READ_FIELD(24) == v8::internal::HeapStats::kEndMarker); | 164 CHECK(READ_FIELD(24) == v8::internal::HeapStats::kEndMarker); |
165 | 165 |
166 const int new_space_size = READ_FIELD(1); | 166 const int new_space_size = READ_FIELD(1); |
167 const int new_space_capacity = READ_FIELD(2); | 167 const int new_space_capacity = READ_FIELD(2); |
168 const int old_pointer_space_size = READ_FIELD(3); | 168 const int old_space_size = READ_FIELD(3); |
169 const int old_pointer_space_capacity = READ_FIELD(4); | 169 const int old_space_capacity = READ_FIELD(4); |
170 const int old_data_space_size = READ_FIELD(5); | 170 const int code_space_size = READ_FIELD(5); |
171 const int old_data_space_capacity = READ_FIELD(6); | 171 const int code_space_capacity = READ_FIELD(6); |
172 const int code_space_size = READ_FIELD(7); | 172 const int map_space_size = READ_FIELD(7); |
173 const int code_space_capacity = READ_FIELD(8); | 173 const int map_space_capacity = READ_FIELD(8); |
174 const int map_space_size = READ_FIELD(9); | 174 const int cell_space_size = READ_FIELD(9); |
175 const int map_space_capacity = READ_FIELD(10); | 175 const int cell_space_capacity = READ_FIELD(10); |
176 const int cell_space_size = READ_FIELD(11); | 176 const int lo_space_size = READ_FIELD(11); |
177 const int cell_space_capacity = READ_FIELD(12); | 177 const int global_handle_count = READ_FIELD(12); |
178 const int lo_space_size = READ_FIELD(13); | 178 const int weak_global_handle_count = READ_FIELD(13); |
179 const int global_handle_count = READ_FIELD(14); | 179 const int pending_global_handle_count = READ_FIELD(14); |
180 const int weak_global_handle_count = READ_FIELD(15); | 180 const int near_death_global_handle_count = READ_FIELD(15); |
181 const int pending_global_handle_count = READ_FIELD(16); | 181 const int destroyed_global_handle_count = READ_FIELD(16); |
182 const int near_death_global_handle_count = READ_FIELD(17); | 182 const int memory_allocator_size = READ_FIELD(17); |
183 const int destroyed_global_handle_count = READ_FIELD(18); | 183 const int memory_allocator_capacity = READ_FIELD(18); |
184 const int memory_allocator_size = READ_FIELD(19); | 184 const int os_error = READ_FIELD(19); |
185 const int memory_allocator_capacity = READ_FIELD(20); | |
186 const int os_error = READ_FIELD(23); | |
187 #undef READ_FIELD | 185 #undef READ_FIELD |
188 | 186 |
189 int objects_per_type[v8::internal::LAST_TYPE + 1] = {0}; | 187 int objects_per_type[v8::internal::LAST_TYPE + 1] = {0}; |
190 ReadArrayFrom(memory_region, heap_stats_addr, 21, | 188 ReadArrayFrom(memory_region, heap_stats_addr, 21, |
191 v8::internal::LAST_TYPE + 1, objects_per_type); | 189 v8::internal::LAST_TYPE + 1, objects_per_type); |
192 | 190 |
193 int size_per_type[v8::internal::LAST_TYPE + 1] = {0}; | 191 int size_per_type[v8::internal::LAST_TYPE + 1] = {0}; |
194 ReadArrayFrom(memory_region, heap_stats_addr, 22, v8::internal::LAST_TYPE + 1, | 192 ReadArrayFrom(memory_region, heap_stats_addr, 22, v8::internal::LAST_TYPE + 1, |
195 size_per_type); | 193 size_per_type); |
196 | 194 |
(...skipping 21 matching lines...) Expand all Loading... |
218 | 216 |
219 printf("exception thread ID: %" PRIu32 " (%#" PRIx32 ")\n", | 217 printf("exception thread ID: %" PRIu32 " (%#" PRIx32 ")\n", |
220 exception_thread_id, exception_thread_id); | 218 exception_thread_id, exception_thread_id); |
221 printf("heap stats address: %#" PRIx64 "\n", heap_stats_addr); | 219 printf("heap stats address: %#" PRIx64 "\n", heap_stats_addr); |
222 #define PRINT_INT_STAT(stat) \ | 220 #define PRINT_INT_STAT(stat) \ |
223 printf("\t%-25s\t% 10d\n", #stat ":", stat); | 221 printf("\t%-25s\t% 10d\n", #stat ":", stat); |
224 #define PRINT_MB_STAT(stat) \ | 222 #define PRINT_MB_STAT(stat) \ |
225 printf("\t%-25s\t% 10.3f MB\n", #stat ":", toM(stat)); | 223 printf("\t%-25s\t% 10.3f MB\n", #stat ":", toM(stat)); |
226 PRINT_MB_STAT(new_space_size); | 224 PRINT_MB_STAT(new_space_size); |
227 PRINT_MB_STAT(new_space_capacity); | 225 PRINT_MB_STAT(new_space_capacity); |
228 PRINT_MB_STAT(old_pointer_space_size); | 226 PRINT_MB_STAT(old_space_size); |
229 PRINT_MB_STAT(old_pointer_space_capacity); | 227 PRINT_MB_STAT(old_space_capacity); |
230 PRINT_MB_STAT(old_data_space_size); | |
231 PRINT_MB_STAT(old_data_space_capacity); | |
232 PRINT_MB_STAT(code_space_size); | 228 PRINT_MB_STAT(code_space_size); |
233 PRINT_MB_STAT(code_space_capacity); | 229 PRINT_MB_STAT(code_space_capacity); |
234 PRINT_MB_STAT(map_space_size); | 230 PRINT_MB_STAT(map_space_size); |
235 PRINT_MB_STAT(map_space_capacity); | 231 PRINT_MB_STAT(map_space_capacity); |
236 PRINT_MB_STAT(cell_space_size); | 232 PRINT_MB_STAT(cell_space_size); |
237 PRINT_MB_STAT(cell_space_capacity); | 233 PRINT_MB_STAT(cell_space_capacity); |
238 PRINT_MB_STAT(lo_space_size); | 234 PRINT_MB_STAT(lo_space_size); |
239 PRINT_INT_STAT(global_handle_count); | 235 PRINT_INT_STAT(global_handle_count); |
240 PRINT_INT_STAT(weak_global_handle_count); | 236 PRINT_INT_STAT(weak_global_handle_count); |
241 PRINT_INT_STAT(pending_global_handle_count); | 237 PRINT_INT_STAT(pending_global_handle_count); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 int main(int argc, char **argv) { | 274 int main(int argc, char **argv) { |
279 if (argc != 2) { | 275 if (argc != 2) { |
280 fprintf(stderr, "usage: %s <minidump>\n", argv[0]); | 276 fprintf(stderr, "usage: %s <minidump>\n", argv[0]); |
281 return 1; | 277 return 1; |
282 } | 278 } |
283 | 279 |
284 DumpHeapStats(argv[1]); | 280 DumpHeapStats(argv[1]); |
285 | 281 |
286 return 0; | 282 return 0; |
287 } | 283 } |
OLD | NEW |