Skip to content
Snippets Groups Projects
Commit 275c859d authored by lhausamm's avatar lhausamm Committed by Loic Hausammann
Browse files

Update error message dump_ensure

parent 98704824
No related branches found
No related tags found
1 merge request!502Logger
...@@ -85,8 +85,14 @@ void dump_ensure(struct dump *d, size_t size) { ...@@ -85,8 +85,14 @@ void dump_ensure(struct dump *d, size_t size) {
/* Re-map starting at the end of the file. */ /* Re-map starting at the end of the file. */
if ((d->data = mmap(NULL, d->size, PROT_WRITE, MAP_SHARED, d->fd, if ((d->data = mmap(NULL, d->size, PROT_WRITE, MAP_SHARED, d->fd,
d->file_offset)) == MAP_FAILED) { d->file_offset)) == MAP_FAILED) {
error("Failed to allocate map of size %zi bytes (%s).", d->size, message("Offset %lu, size %lu", d->file_offset, d->size);
strerror(errno)); size_t mega = 1e6;
if (d->size > mega)
error("Failed to allocate map of size %zi Mbytes (%s).", d->size / mega,
strerror(errno));
else
error("Failed to allocate map of size %zi bytes (%s).", d->size,
strerror(errno));
} }
} }
......
...@@ -6718,6 +6718,7 @@ void engine_init(struct engine *e, struct space *s, struct swift_params *params, ...@@ -6718,6 +6718,7 @@ void engine_init(struct engine *e, struct space *s, struct swift_params *params,
struct dump *dump_file = e->logger_dump; struct dump *dump_file = e->logger_dump;
dump_init(dump_file, logger_name_file, e->logger_size); dump_init(dump_file, logger_name_file, e->logger_size);
logger_write_file_header(dump_file); logger_write_file_header(dump_file);
dump_ensure(dump_file, e->logger_size);
e->logger_time_offset = 0; e->logger_time_offset = 0;
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment