tests/pm_rc6_residency: factor out the code to measure residencies
tests/pm_rc6_residency: factor out the code to measure residencies

The upcoming patches will add some additional logic around reading out
the counter values, so factor out the readout code to prepare for those
patches.

No functional change.

Signed-off-by: Imre Deak <fbd5edba1988036c8923f0cca0cce6ac4811db29@intel.com>
Acked-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>

tiagovignatti/intel-gpu-tools,tiagovignatti/intel-gpu-tools,chenxianqin/intel-gpu-tools,dlespiau/checkmate-test-igt,dlespiau/checkmate-test-igt,mv0/intel-gpu-tools,chenxianqin/intel-gpu-tools,chenxianqin/intel-gpu-tools,tiagovignatti/intel-gpu-tools,dlespiau/checkmate-test-igt,tiagovignatti/intel-gpu-tools,mv0/intel-gpu-tools,mv0/intel-gpu-tools,mv0/intel-gpu-tools,dlespiau/checkmate-test-igt,chenxianqin/intel-gpu-tools