Implementation of tracing for perf_api.