diff --git a/source/lib/rocprofiler-sdk-tool/tool.cpp b/source/lib/rocprofiler-sdk-tool/tool.cpp index 7a33b89b69..b70607b7a0 100644 --- a/source/lib/rocprofiler-sdk-tool/tool.cpp +++ b/source/lib/rocprofiler-sdk-tool/tool.cpp @@ -1643,12 +1643,14 @@ generate_output(tool::buffered_output& output_v, { if(!output_v) return; - // if it has reached this point, the generator is not empty - num_output_v += 1; - // opens temporary file and sets read position to beginning output_v.read(); + if(output_v.get_generator().empty()) return; + + // if it has reached this point, the generator is not empty + num_output_v += 1; + if(tool::get_config().stats || tool::get_config().summary_output) { output_v.stats =