[CRIU] [PATCH v2 2/4] aio: Change pair of debug messages

Kirill Tkhai ktkhai at virtuozzo.com
Thu May 19 06:12:12 PDT 2016


The first is a preparation to kill aio_nr_req. The second
and the third are to have more debug info at restore.

v2: Print mmap err code

Signed-off-by: Kirill Tkhai <ktkhai at vituozzo.com>
---
 criu/aio.c          |    5 ++---
 criu/pie/restorer.c |    7 ++++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/criu/aio.c b/criu/aio.c
index 888a640..26bca30 100644
--- a/criu/aio.c
+++ b/criu/aio.c
@@ -13,9 +13,6 @@ int dump_aio_ring(MmEntry *mme, struct vma_area *vma)
 	int nr = mme->n_aios;
 	AioRingEntry *re;
 
-	pr_info("Dumping AIO ring @%"PRIx64", %u reqs\n",
-			vma->e->start, vma->aio_nr_req);
-
 	mme->aios = xrealloc(mme->aios, (nr + 1) * sizeof(re));
 	if (!mme->aios)
 		return -1;
@@ -30,6 +27,8 @@ int dump_aio_ring(MmEntry *mme, struct vma_area *vma)
 	re->ring_len = vma->e->end - vma->e->start;
 	mme->aios[nr] = re;
 	mme->n_aios = nr + 1;
+	pr_info("Dumping AIO ring @%"PRIx64"-%"PRIx64"\n",
+		vma->e->start, vma->e->end);
 	return 0;
 }
 
diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
index 9249b9d..5defb3f 100644
--- a/criu/pie/restorer.c
+++ b/criu/pie/restorer.c
@@ -586,8 +586,9 @@ static int restore_aio_ring(struct rst_aio_ring *raio)
 	i = (raio->len - sizeof(struct aio_ring)) / sizeof(struct io_event);
 	if (tail >= ring->nr || head >= ring->nr || ring->nr != i ||
 	    new->nr != ring->nr) {
-		pr_err("wrong aio parametrs: tail=%x head=%x nr=%x len=%lx\n",
-			tail, head, raio->nr_req, raio->len);
+		pr_err("wrong aio: tail=%x head=%x req=%x old_nr=%x new_nr=%x expect=%x\n",
+			tail, head, raio->nr_req, ring->nr, new->nr, i);
+
 		return -1;
 	}
 
@@ -625,7 +626,7 @@ static int restore_aio_ring(struct rst_aio_ring *raio)
 	iocbp = (void *)iocb + sizeof(struct iocb);
 
 	if (IS_ERR(iocb)) {
-		pr_err("Can't mmap aio tmp buffer\n");
+		pr_err("Can't mmap aio tmp buffer: %ld\n", PTR_ERR(iocb));
 		return -1;
 	}
 



More information about the CRIU mailing list