From 7e98349d0db57e5ff01cae3b47e25388a82b8acc Mon Sep 17 00:00:00 2001 From: markgalvan-intel Date: Wed, 7 Aug 2024 09:37:20 -0700 Subject: [PATCH] Add fflush to ConsoleApplication 2.0 metrics csv Flushes were accidentally removed at some point. v2.0.1 added them back in, but only for the --use_v1_metrics CSV. This change adds them back in for the default CSV as well. See issue #232 --- PresentMon/CsvOutput.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PresentMon/CsvOutput.cpp b/PresentMon/CsvOutput.cpp index d0e370599..3a7209fdf 100644 --- a/PresentMon/CsvOutput.cpp +++ b/PresentMon/CsvOutput.cpp @@ -307,6 +307,10 @@ void WriteCsvHeader(FILE* fp) fwprintf(fp, L",FrameId"); } fwprintf(fp, L"\n"); + + if (args.mCSVOutput == CSVOutput::Stdout) { + fflush(fp); + } } template<> @@ -395,6 +399,10 @@ void WriteCsvRow( fwprintf(fp, L",%u", p.FrameId); } fwprintf(fp, L"\n"); + + if (args.mCSVOutput == CSVOutput::Stdout) { + fflush(fp); + } } template