Added some profiling machinery.