I think he is generating unique strings as "DEBUG_NAME" (concatinating file and line).
Then he just writes every event atomically into a buffer. At the end of every frame he goes through the buffer and "CollateDebugRecords", to figure out whatever he is interested in.
If you haven't, I recommend buying the source and looking at it yourself.