tools/power/turbostat: Support alternative graphics sysfs knobs
authorZhang Rui <rui.zhang@intel.com>
Sun, 21 Aug 2022 14:39:16 +0000 (22:39 +0800)
committerZhang Rui <rui.zhang@intel.com>
Wed, 27 Sep 2023 14:14:18 +0000 (22:14 +0800)
commit2c019d657968bdd93e11615e0919d8181a54742d
treeead0d09ffd61a694177119788b570447e6037f52
parentb98a6d78768ec459d394db8bc086d071eb6556c8
tools/power/turbostat: Support alternative graphics sysfs knobs

/sys/class/graphics/fb0/device/drm/card0/ and /sys/class/drm/card0/
point to the same device node.
But in some cases, one exists and the other one does not.

Prefer to use /sys/class/drm/card0/, and fall back to
/sys/class/graphics/fb0/device/drm/card0/.

This recovers the "GFXMHz" and "GFXAMHz" columns on some platforms like
a SPR server.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c