perf script: Move filtering before scripting