NXP-12465: refactor - unify the way to get the trace output, in trace mode or not