[PATCH 5.2 210/413] perf stat: Make metric event lookup more robust