Recent changes (master)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit de8f6de97438d5664cd8765e60102b9109a273e2:

  Fix misspellings using 'codespell' tool (2013-09-27 08:28:55 -0600)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Jens Axboe (1):
      log: disable log, if realloc fails

 iolog.h |    5 +++++
 stat.c  |   12 +++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

---

Diff of recent changes:

diff --git a/iolog.h b/iolog.h
index 8fedc19..6503acf 100644
--- a/iolog.h
+++ b/iolog.h
@@ -50,6 +50,11 @@ struct io_log {
 	unsigned int log_type;
 
 	/*
+	 * If we fail extending the log, stop collecting more entries.
+	 */
+	unsigned int disabled;
+
+	/*
 	 * Windowed average, for logging single entries average over some
 	 * period of time.
 	 */
diff --git a/stat.c b/stat.c
index 10d9efe..fec3639 100644
--- a/stat.c
+++ b/stat.c
@@ -1504,13 +1504,23 @@ static void __add_log_sample(struct io_log *iolog, unsigned long val,
 {
 	const int nr_samples = iolog->nr_samples;
 
+	if (iolog->disabled)
+		return;
+
 	if (!iolog->nr_samples)
 		iolog->avg_last = t;
 
 	if (iolog->nr_samples == iolog->max_samples) {
 		int new_size = sizeof(struct io_sample) * iolog->max_samples*2;
+		void *new_log;
 
-		iolog->log = realloc(iolog->log, new_size);
+		new_log = realloc(iolog->log, new_size);
+		if (!new_log) {
+			log_err("fio: failed extending iolog! Will stop logging.\n");
+			iolog->disabled = 1;
+			return;
+		}
+		iolog->log = new_log;
 		iolog->max_samples <<= 1;
 	}
 
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux