Add more profiling hooks.

I'm trying to dig up why my indexing of jawiki is so slow and these can
only be useful.

Change-Id: I80cf8bbd920f27d3f03d273ba9926088a0a00dc0
Merge "Add more profiling hooks."