perf tools: Allocate thread map_groups's dynamically