This is an archive of the discontinued LLVM Phabricator instance.

[msf] Figure out the rest of the FPM and dump more detailed page allocation stats
ClosedPublic

Authored by zturner on Aug 1 2016, 11:30 AM.

Details

Summary

The FPM is split at regular intervals across the MSF file, as the MS code suggests. It turns out that the value of the interval is precisely the block size. If the block size is 4096, then there are two Fpm pages every 4096 blocks.

So here we teach the PDBFile class to parse a split FPM, and also add more options when dumping the FPM to display some additional information such as orphaned pages (pages which the FPM says are allocated, but which nothing appears to use), use after free pages (pages which the FPM says are not allocated, but which are referenced by a stream), and multiple use pages (pages which the FPM says are allocated but are used more than once).

Diff Detail

Event Timeline

zturner updated this revision to Diff 66343.Aug 1 2016, 11:30 AM
zturner retitled this revision from to [msf] Figure out the rest of the FPM and dump more detailed page allocation stats.
zturner updated this object.
zturner added reviewers: majnemer, ruiu.
zturner added a subscriber: llvm-commits.
ruiu edited edge metadata.Aug 1 2016, 1:03 PM

Do you want to add a test?

zturner updated this revision to Diff 66374.Aug 1 2016, 1:46 PM
zturner edited edge metadata.

Fix the test to exercise the new option.

ruiu accepted this revision.Aug 1 2016, 2:07 PM
ruiu edited edge metadata.

LGTM

lib/DebugInfo/PDB/Raw/PDBFile.cpp
130

You are mixing kilo=1000 and kilo=1024 (32K=32*1024, 4K=4*1024, but 134MB=134*1000*1000). It's more accurate to say that the total is 128MB.

This revision is now accepted and ready to land.Aug 1 2016, 2:07 PM
zturner added inline comments.Aug 1 2016, 2:13 PM
lib/DebugInfo/PDB/Raw/PDBFile.cpp
130

Ahh, thanks for catching that. Gotta be careful using Google. I wrote "4096 * 4096 * 8 bytes to megabytes" into Google and it told me the answer is 134 Megabytes. I guess I have to write KiB and MiB to be accurate, ugh.

This revision was automatically updated to reflect the committed changes.