Implementation of path profiling.