All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Elliott <elliott@hpe.com>
To: fio@vger.kernel.org
Cc: Robert Elliott <elliott@hpe.com>
Subject: [PATCH 3/4] pmemblk,dev-dax: clean up error logs
Date: Wed,  4 Jan 2017 00:54:52 -0600	[thread overview]
Message-ID: <20170104065453.15106-4-elliott@hpe.com> (raw)
In-Reply-To: <20170104065453.15106-1-elliott@hpe.com>

Print the errno string rather than the number, and prefix
all log_err prints with pmemblk or dev-dax rather than fio.
---
 engines/dev-dax.c | 22 +++++++++++-----------
 engines/pmemblk.c |  9 ++++-----
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/engines/dev-dax.c b/engines/dev-dax.c
index 45aca4e..235a31e 100644
--- a/engines/dev-dax.c
+++ b/engines/dev-dax.c
@@ -106,7 +106,7 @@ static int fio_devdax_prep_limited(struct thread_data *td, struct io_u *io_u)
 	struct fio_devdax_data *fdd = FILE_ENG_DATA(f);
 
 	if (io_u->buflen > f->real_file_size) {
-		log_err("fio: bs too big for dev-dax engine\n");
+		log_err("dev-dax: bs too big for dev-dax engine\n");
 		return EIO;
 	}
 
@@ -213,8 +213,8 @@ static int fio_devdax_init(struct thread_data *td)
 
 	if ((o->rw_min_bs & page_mask) &&
 	    (o->fsync_blocks || o->fdatasync_blocks)) {
-		log_err("fio: mmap options dictate a minimum block size of "
-			"%llu bytes\n", (unsigned long long) page_size);
+		log_err("dev-dax: mmap options dictate a minimum block size of %llu bytes\n",
+			(unsigned long long) page_size);
 		return 1;
 	}
 
@@ -272,8 +272,8 @@ fio_devdax_get_file_size(struct thread_data *td, struct fio_file *f)
 
 	rc = stat(f->file_name, &st);
 	if (rc < 0) {
-		log_err("%s: failed to stat file %s: %d\n",
-			td->o.name, f->file_name, errno);
+		log_err("%s: failed to stat file %s (%s)\n",
+			td->o.name, f->file_name, strerror(errno));
 		return -errno;
 	}
 
@@ -282,8 +282,8 @@ fio_devdax_get_file_size(struct thread_data *td, struct fio_file *f)
 
 	rpath = realpath(spath, npath);
 	if (!rpath) {
-		log_err("%s: realpath on %s failed: %d\n",
-			td->o.name, spath, errno);
+		log_err("%s: realpath on %s failed (%s)\n",
+			td->o.name, spath, strerror(errno));
 		return -errno;
 	}
 
@@ -298,15 +298,15 @@ fio_devdax_get_file_size(struct thread_data *td, struct fio_file *f)
 
 	sfile = fopen(spath, "r");
 	if (!sfile) {
-		log_err("%s: fopen on %s failed: %d\n",
-			td->o.name, spath, errno);
+		log_err("%s: fopen on %s failed (%s)\n",
+			td->o.name, spath, strerror(errno));
 		return 1;
 	}
 
 	rc = fscanf(sfile, "%lu", &size);
 	if (rc < 0) {
-		log_err("%s: fscanf on %s failed: %d\n",
-			td->o.name, spath, errno);
+		log_err("%s: fscanf on %s failed (%s)\n",
+			td->o.name, spath, strerror(errno));
 		return 1;
 	}
 
diff --git a/engines/pmemblk.c b/engines/pmemblk.c
index 7b1affa..7c609cf 100644
--- a/engines/pmemblk.c
+++ b/engines/pmemblk.c
@@ -203,9 +203,8 @@ static fio_pmemblk_file_t pmb_open(const char *pathspec, int flags)
 			    pmemblk_create(path, bsize, fsize, 0644);
 		}
 		if (!pmb->pmb_pool) {
-			log_err
-			    ("fio: enable to open pmemblk pool file (errno %d)\n",
-			     errno);
+			log_err("pmemblk: unable to open pmemblk pool file %s (%s)\n",
+			     path, strerror(errno));
 			goto error;
 		}
 
@@ -267,14 +266,14 @@ static int pmb_get_flags(struct thread_data *td, uint64_t *pflags)
 	if (!td->o.use_thread) {
 		if (!thread_warned) {
 			thread_warned = 1;
-			log_err("fio: must set thread=1 for pmemblk engine\n");
+			log_err("pmemblk: must set thread=1 for pmemblk engine\n");
 		}
 		return 1;
 	}
 
 	if (!td->o.odirect && !odirect_warned) {
 		odirect_warned = 1;
-		log_info("fio: direct == 0, but pmemblk is always direct\n");
+		log_info("pmemblk: direct == 0, but pmemblk is always direct\n");
 	}
 
 	if (td->o.allow_create)
-- 
2.9.3


  parent reply	other threads:[~2017-01-04  6:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04  6:54 pmemblk and dev-dax cleanups Robert Elliott
2017-01-04  6:54 ` [PATCH 1/4] pmemblk, dev-dax: load libpmem and libpmemblk at startup Robert Elliott
2017-01-04 23:48   ` Elliott, Robert (Persistent Memory)
2017-01-04  6:54 ` [PATCH 2/4] pmemblk, dev-dax: Update descriptions Robert Elliott
2017-01-04  6:54 ` Robert Elliott [this message]
2017-01-04  6:54 ` [PATCH 4/4] pmemblk: Clarify fsize is in MiB not MB Robert Elliott
2017-01-05 18:47 ` pmemblk and dev-dax cleanups Jens Axboe
2017-01-10 21:21 ` [PATCH v2 1/4] pmemblk, dev-dax: load libpmem and libpmemblk at startup Robert Elliott
2017-01-10 21:21   ` [PATCH v2 2/4] pmemblk, dev-dax: Update descriptions Robert Elliott
2017-01-10 21:21   ` [PATCH v2 3/4] pmemblk, dev-dax: clean up error logs Robert Elliott
2017-01-10 21:21   ` [PATCH v2 4/4] pmemblk: Clarify fsize is in MiB not MB Robert Elliott
2017-01-12  4:00   ` [PATCH v2 1/4] pmemblk, dev-dax: load libpmem and libpmemblk at startup Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170104065453.15106-4-elliott@hpe.com \
    --to=elliott@hpe.com \
    --cc=fio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.