refactoring CpuProfiler::FindProfile and HeapProfiler::FindSnapshot