]> www.infradead.org Git - users/willy/pagecache.git/commit
tools/power turbostat: Consolidate graphics sysfs access
authorZhang Rui <rui.zhang@intel.com>
Thu, 14 Nov 2024 07:59:44 +0000 (15:59 +0800)
committerLen Brown <len.brown@intel.com>
Sat, 30 Nov 2024 21:42:07 +0000 (16:42 -0500)
commitd071004e623b7433573019d67cba79e345d83006
tree7967169c1edcb1494661fec9e46ed6443f8d9f00
parentba99a4fc8c24dc7d35f18edb6e3b0a65345fbfa3
tools/power turbostat: Consolidate graphics sysfs access

Currently, there is an inconsistency in how graphics sysfs knobs are
accessed: graphics residency sysfs knobs are opened and closed for each
read, while graphics frequency sysfs knobs are opened once and remain
open until turbostat exits. This inconsistency is confusing and adds
unnecessary code complexity.

Consolidate the access method by opening the sysfs files once and
reusing the file pointers for subsequent accesses. This approach
simplifies the code and ensures a consistent method for accessing
graphics sysfs knobs.

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