--flush_stdout to disable flushing.

This commit is contained in:
Ben Vanik 2015-03-22 11:49:13 -07:00
parent f8db3774cb
commit 6486299496
2 changed files with 6 additions and 3 deletions

View File

@ -18,6 +18,7 @@
DEFINE_bool(fast_stdout, false, DEFINE_bool(fast_stdout, false,
"Don't lock around stdout/stderr. May introduce weirdness."); "Don't lock around stdout/stderr. May introduce weirdness.");
DEFINE_bool(flush_stdout, true, "Flush stdout after each log line.");
DEFINE_bool(log_filenames, false, DEFINE_bool(log_filenames, false,
"Log filenames/line numbers in log statements."); "Log filenames/line numbers in log statements.");
@ -82,7 +83,9 @@ void log_line(const char* file_path, const uint32_t line_number,
OutputDebugStringA(log_buffer); OutputDebugStringA(log_buffer);
#else #else
fprintf(stdout, "%s", log_buffer); fprintf(stdout, "%s", log_buffer);
fflush(stdout); if (FLAGS_flush_stdout) {
fflush(stdout);
}
#endif // OutputDebugString #endif // OutputDebugString
if (!FLAGS_fast_stdout) { if (!FLAGS_fast_stdout) {
log_lock.unlock(); log_lock.unlock();

View File

@ -56,8 +56,8 @@ void GraphicsSystem::DispatchInterruptCallback(uint32_t source, uint32_t cpu) {
cpu = 2; cpu = 2;
} }
XELOGGPU("Dispatching GPU interrupt at %.8X w/ mode %d on cpu %d", // XELOGGPU("Dispatching GPU interrupt at %.8X w/ mode %d on cpu %d",
interrupt_callback_, source, cpu); // interrupt_callback_, source, cpu);
// NOTE: we may be executing in some random thread. // NOTE: we may be executing in some random thread.
uint64_t args[] = {source, interrupt_callback_data_}; uint64_t args[] = {source, interrupt_callback_data_};