]> www.infradead.org Git - nvme.git/commitdiff
tools/power turbostat: Restore GFX sysfs fflush() call
authorZhang Rui <rui.zhang@intel.com>
Wed, 19 Mar 2025 00:53:07 +0000 (08:53 +0800)
committerLen Brown <len.brown@intel.com>
Sun, 6 Apr 2025 16:36:03 +0000 (12:36 -0400)
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

index 70e17d4ad9b60a80da00eab42a38b7a31f229711..c9a34c16c7a8105b15fded1d8a5bafd4ef493008 100644 (file)
@@ -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: