[PATCH v2 08/13] perf: cs-etm: Move mapping of Trace ID and cpu into helper function