I know exactly how it was done, I am just amazed that it was done. It's a great idea that I have never come up with, nor would I be able to.
A similar idea is used to trace what 'make install' does so that stuff can be uninstalled later - or made into a package (rpm, dpkg etc)
I forget what that tool is called.