| OLD | NEW |
| 1 // Copyright (c) 2014, Google Inc. | 1 // Copyright (c) 2014, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 497 |
| 498 size_t next = NextOrderedMapping(mappings, curr); | 498 size_t next = NextOrderedMapping(mappings, curr); |
| 499 if (next == std::numeric_limits<size_t>::max()) | 499 if (next == std::numeric_limits<size_t>::max()) |
| 500 break; | 500 break; |
| 501 | 501 |
| 502 uintptr_t hole_lo = mappings[curr]->start_addr + mappings[curr]->size; | 502 uintptr_t hole_lo = mappings[curr]->start_addr + mappings[curr]->size; |
| 503 uintptr_t hole_hi = mappings[next]->start_addr; | 503 uintptr_t hole_hi = mappings[next]->start_addr; |
| 504 | 504 |
| 505 if (hole_hi > hole_lo) { | 505 if (hole_hi > hole_lo) { |
| 506 size_t hole_sz = hole_hi - hole_lo; | 506 size_t hole_sz = hole_hi - hole_lo; |
| 507 int log2_hole_sz = Log2Floor(hole_sz); | |
| 508 hole_sum += hole_sz; | 507 hole_sum += hole_sz; |
| 509 hole_max = std::max(hole_sz, hole_max); | 508 hole_max = std::max(hole_sz, hole_max); |
| 510 ++hole_cnt; | 509 ++hole_cnt; |
| 511 ++hole_histogram[Log2Floor(hole_sz)]; | 510 ++hole_histogram[Log2Floor(hole_sz)]; |
| 512 } | 511 } |
| 513 curr = next; | 512 curr = next; |
| 514 } | 513 } |
| 515 | 514 |
| 516 uintptr_t hi_addr = mappings[curr]->start_addr + mappings[curr]->size; | 515 uintptr_t hi_addr = mappings[curr]->start_addr + mappings[curr]->size; |
| 517 | 516 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 dumper.set_crash_signal(context->siginfo.si_signo); | 589 dumper.set_crash_signal(context->siginfo.si_signo); |
| 591 dumper.set_crash_thread(context->tid); | 590 dumper.set_crash_thread(context->tid); |
| 592 } | 591 } |
| 593 MicrodumpWriter writer(context, mappings, microdump_extra_info, &dumper); | 592 MicrodumpWriter writer(context, mappings, microdump_extra_info, &dumper); |
| 594 if (!writer.Init()) | 593 if (!writer.Init()) |
| 595 return false; | 594 return false; |
| 596 return writer.Dump(); | 595 return writer.Dump(); |
| 597 } | 596 } |
| 598 | 597 |
| 599 } // namespace google_breakpad | 598 } // namespace google_breakpad |
| OLD | NEW |