summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-02-22 19:36:48 +0100
committerJens Axboe <jens.axboe@oracle.com>2007-02-22 19:36:48 +0100
commite1161c325f7866bae879e686d1c673ca32ab09ae (patch)
treee2cac2756d9bfc28150c495673613ba765168953 /memory.c
parent94cd00dd6cf1cec4c593a74aabfbb79f4d80afb6 (diff)
downloadfio-e1161c325f7866bae879e686d1c673ca32ab09ae.tar.gz
fio-e1161c325f7866bae879e686d1c673ca32ab09ae.tar.bz2
Add more context to the error messages
Errors like: fio: pid=0, err=22/file:filesetup.c:380, error=Invalid argument do not give a lot of clue as to what is wrong, unless you have a matching source. So add a context relevant info message as well. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/memory.c b/memory.c
index 079c0760..d9cfe9ba 100644
--- a/memory.c
+++ b/memory.c
@@ -69,14 +69,14 @@ int allocate_io_mem(struct thread_data *td)
td->shm_id = shmget(IPC_PRIVATE, td->orig_buffer_size, flags);
if (td->shm_id < 0) {
- td_verror(td, errno);
+ td_verror(td, errno, "shmget");
perror("shmget");
return 1;
}
td->orig_buffer = shmat(td->shm_id, NULL, 0);
if (td->orig_buffer == (void *) -1) {
- td_verror(td, errno);
+ td_verror(td, errno, "shmat");
perror("shmat");
td->orig_buffer = NULL;
return 1;
@@ -90,7 +90,7 @@ int allocate_io_mem(struct thread_data *td)
td->mmapfd = open(td->mmapfile, O_RDWR|O_CREAT, 0644);
if (td->mmapfd < 0) {
- td_verror(td, errno);
+ td_verror(td, errno, "open");
perror("open mmap file");
td->orig_buffer = NULL;
return 1;
@@ -100,7 +100,7 @@ int allocate_io_mem(struct thread_data *td)
td->orig_buffer = mmap(NULL, td->orig_buffer_size, PROT_READ | PROT_WRITE, flags, td->mmapfd, 0);
if (td->orig_buffer == MAP_FAILED) {
- td_verror(td, errno);
+ td_verror(td, errno, "mmap");
perror("mmap");
td->orig_buffer = NULL;
if (td->mmapfd) {