This is an archive of the discontinued LLVM Phabricator instance.

[memprof] Fix the text format print for live on exit blocks.
ClosedPublic

Authored by snehasish on Nov 19 2021, 2:13 PM.

Details

Summary

We dropped the printing of live on exit blocks in rG1243cef245f6 -
the commit changed the insertOrMerge logic. This regression was
hard to catch since there was no further text printed out to indicate
the subsequent blocks were from the block table. This commit adds
another print to separate out these two printed sections. When post
processing the text profiles, the "live on exit" is informative only. The
actual MIBs are printed again as part of the recorded MIBs.

Diff Detail

Event Timeline

snehasish requested review of this revision.Nov 19 2021, 2:13 PM
snehasish created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2021, 2:13 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
tejohnson added inline comments.Nov 19 2021, 3:33 PM
compiler-rt/lib/memprof/memprof_allocator.cpp
257

I'm confused - shouldn't this handling print any MIB blocks merged during InsertLiveBlocks (i.e. so include the live on exit blocks)?

I think the print I had of "Live on exit:" below was misleading/incorrect - I meant to distinguish those that we evicted from the MIB table when it was finite from the full table at the end which included the live on exit blocks. We should simply remove that "Live on exit" message below, since it isn't needed anymore and wasn't really correct before. I don't believe we were ever printing just those live on exit, separately from the full MIB table.

snehasish updated this revision to Diff 388653.Nov 19 2021, 3:43 PM

Remove the live on exit print statement.
Update the memprof_profile_dump.cpp test.

snehasish updated this revision to Diff 388655.Nov 19 2021, 3:44 PM

Actually update the test this time.

snehasish updated this revision to Diff 388657.Nov 19 2021, 3:48 PM

Remove -Wl,-build-id from the test (meant to be a local change).

Thanks, PTAL.

compiler-rt/lib/memprof/memprof_allocator.cpp
257

Yes, it does. I interpreted the prior "Live on exit" print statements as a snapshot of what was live followed by all the recorded mibs (incl. live mibs). I assumed it was used for debugging etc so I wanted to retain the behaviour. I noted this in the description of the patch. Removing this sounds good to me.

tejohnson accepted this revision.Nov 19 2021, 3:58 PM

lgtm, sorry for the confusion!

This revision is now accepted and ready to land.Nov 19 2021, 3:58 PM