Fix incompatibilities with 3.12 in perf utils