perf machine: Add threads__get_last_match function