diff mbox series

[08/10] tools/power turbostat: Restore GFX sysfs fflush() call

Message ID f8b136ef2605c1bf62020462d10e35228760aa19.1743965272.git.len.brown@intel.com
State New
Headers show
Series [01/10] tools/power turbostat: Clustered Uncore MHz counters should honor show/hide options | expand

Commit Message

Len Brown April 6, 2025, 6:57 p.m. UTC
From: Zhang Rui <rui.zhang@intel.com>

Do fflush() to discard the buffered data, before each read of the
graphics sysfs knobs.

Fixes: ba99a4fc8c24 ("tools/power turbostat: Remove unnecessary fflush() call")
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 tools/power/x86/turbostat/turbostat.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 70e17d4ad9b6..c9a34c16c7a8 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -6039,6 +6039,7 @@  int snapshot_graphics(int idx)
 	int retval;
 
 	rewind(gfx_info[idx].fp);
+	fflush(gfx_info[idx].fp);
 
 	switch (idx) {
 	case GFX_rc6: