From 9c77f6d411224800d39fbe6e884be6e9ec587adf Mon Sep 17 00:00:00 2001 From: Karel Brinda Date: Mon, 29 Aug 2016 16:52:38 +0200 Subject: [PATCH] Fix bug in logging (counting updates) --- Makefile | 2 +- src/caller.h | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index b715619..351c968 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CXX ?= g++ -CXXFLAGS = -std=c++11 -Wall -Wextra -Wno-missing-field-initializers -Wshadow -g -O2 +CXXFLAGS = -std=c++11 -Wall -Wextra -Wno-missing-field-initializers -g -O2 LIBS = -lm -lz -lpthread PREFIX = $(DESTDIR)/usr/local diff --git a/src/caller.h b/src/caller.h index a55cea8..4435b57 100644 --- a/src/caller.h +++ b/src/caller.h @@ -318,12 +318,13 @@ void caller_t::run() { break; } - if (stats->params->log_file != nullptr) { - fprintf(stats->params->log_file, - "%" PRIu64 "\t%s\t%" PRIu64 "\n", i_read, rname, - stats->params->n_upd - n_upd0); - n_upd0 = stats->params->n_upd; - } + } + + if (stats->params->log_file != nullptr) { + fprintf(stats->params->log_file, + "%" PRIu64 "\t%s\t%" PRIu64 "\n", i_read, rname, + stats->params->n_upd - n_upd0); + n_upd0 = stats->params->n_upd; } i_read += 1;