[PATCH v6 09/14] perf: cs-etm: Move mapping of Trace ID and cpu into helper function