perf script: Share code and output format for uregs and iregs output