Profiling for hook calls.

This is similar to profiloing for db queries.

Change-Id: I14051f8aff30d249f4197270337e4080adfa5417
Merge "Profiling for hook calls."