perf trace: Fix detection of script extension