[CRIU] [PATCH cr 3/4] log: remove pid from messages

Andrey Vagin avagin at openvz.org
Wed May 2 06:42:44 EDT 2012


Now log messages may be splitted by pid

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-restore.c |   22 +++++++++++-----------
 files.c      |   10 +++++-----
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 69b226c..8344e1b 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -71,10 +71,10 @@ static int shmem_wait_and_open(int pid, struct shmem_info *si)
 	sprintf(path, "/proc/%d/map_files/%lx-%lx",
 		si->pid, si->start, si->end);
 
-	pr_info("%d: Waiting for [%s] to appear\n", pid, path);
+	pr_info("Waiting for [%s] to appear\n", path);
 	futex_wait_until(&si->lock, 1);
 
-	pr_info("%d: Opening shmem [%s] \n", pid, path);
+	pr_info("Opening shmem [%s] \n", path);
 	ret = open(path, O_RDWR);
 	if (ret < 0)
 		pr_perror("     %d: Can't stat shmem at %s",
@@ -156,7 +156,7 @@ static int prepare_shmem_pid(int pid)
 		if (ret <= 0)
 			break;
 
-		pr_info("%d: vma 0x%lx 0x%lx\n", pid, vi.start, vi.end);
+		pr_info("vma 0x%lx 0x%lx\n", vi.start, vi.end);
 
 		if (!vma_entry_is(&vi, VMA_ANON_SHARED))
 			continue;
@@ -349,7 +349,7 @@ static int get_shmem_fd(int pid, struct vma_entry *vi)
 	int f;
 
 	si = find_shmem(shmems, vi->shmid);
-	pr_info("%d: Search for 0x%016lx shmem 0x%lx %p/%d\n", pid, vi->start, vi->shmid, si, si ? si->pid : -1);
+	pr_info("Search for 0x%016lx shmem 0x%lx %p/%d\n", vi->start, vi->shmid, si, si ? si->pid : -1);
 	if (!si) {
 		pr_err("Can't find my shmem 0x%016lx\n", vi->start);
 		return -1;
@@ -418,8 +418,8 @@ static int read_and_open_vmas(int pid, struct list_head *vmas, int *nr_vmas)
 		if (!(vma_entry_is(&vma->vma, VMA_AREA_REGULAR)))
 			continue;
 
-		pr_info("%d: Opening 0x%016lx-0x%016lx 0x%016lx vma\n",
-				pid, vma->vma.start, vma->vma.end, vma->vma.pgoff);
+		pr_info("Opening 0x%016lx-0x%016lx 0x%016lx vma\n",
+				vma->vma.start, vma->vma.end, vma->vma.pgoff);
 
 		if (vma_entry_is(&vma->vma, VMA_AREA_SYSVIPC))
 			ret = vma->vma.shmid;
@@ -503,7 +503,7 @@ err:
 
 static int restore_one_alive_task(int pid)
 {
-	pr_info("%d: Restoring resources\n", pid);
+	pr_info("Restoring resources\n");
 
 	if (prepare_fds(me))
 		return -1;
@@ -832,7 +832,7 @@ static int restore_task_with_children(void *_arg)
 		exit(1);
 	}
 
-	pr_info("%d: Restoring %d children:\n", me->pid, me->nr_children);
+	pr_info("Restoring %d children:\n", me->nr_children);
 	for (i = 0; i < me->nr_children; i++) {
 		ret = fork_with_pid(me->children[i], 0);
 		if (ret < 0)
@@ -1152,7 +1152,7 @@ static int sigreturn_restore(pid_t pid, struct list_head *tgt_vmas, int nr_vmas)
 
 	int *fd_core_threads;
 
-	pr_info("%d: Restore via sigreturn\n", pid);
+	pr_info("Restore via sigreturn\n");
 
 	restore_code_len	= 0;
 	restore_task_vma_len	= 0;
@@ -1204,8 +1204,8 @@ static int sigreturn_restore(pid_t pid, struct list_head *tgt_vmas, int nr_vmas)
 	restore_thread_vma_len = sizeof(*thread_args) * me->nr_threads;
 	restore_thread_vma_len = round_up(restore_thread_vma_len, 16);
 
-	pr_info("%d: %d threads require %ldK of memory\n",
-			pid, me->nr_threads,
+	pr_info("%d threads require %ldK of memory\n",
+			me->nr_threads,
 			KBYTES(restore_thread_vma_len));
 
 	restore_thread_vma_len = round_up(restore_thread_vma_len, PAGE_SIZE);
diff --git a/files.c b/files.c
index 137f8e3..c8f503a 100644
--- a/files.c
+++ b/files.c
@@ -495,7 +495,7 @@ static int open_transport_fd(int pid, struct fdinfo_entry *fe, struct file_desc
 
 	transport_name_gen(&saddr, &sun_len, getpid(), fe->fd);
 
-	pr_info("\t%d: Create transport fd for %d\n", pid, fe->fd);
+	pr_info("\tCreate transport fd for %d\n", fe->fd);
 
 	list_for_each_entry(fle, &d->fd_info_head, desc_list)
 		if ((fle->pid == pid) && (fle->fe.fd == fe->fd))
@@ -562,7 +562,7 @@ static int open_fd(int pid, struct fdinfo_entry *fe, struct file_desc *d)
 		return -1;
 	}
 
-	pr_info("\t%d: Create fd for %d\n", pid, fe->fd);
+	pr_info("\tCreate fd for %d\n", fe->fd);
 
 	list_for_each_entry(fle, &d->fd_info_head, desc_list) {
 		if (pid == fle->pid) {
@@ -605,7 +605,7 @@ static int receive_fd(int pid, struct fdinfo_entry *fe, struct file_desc *d)
 	if (fle->pid == pid)
 		return 0;
 
-	pr_info("\t%d: Receive fd for %d\n", pid, fe->fd);
+	pr_info("\tReceive fd for %d\n", fe->fd);
 
 	tmp = recv_fd(fe->fd);
 	if (tmp < 0) {
@@ -628,7 +628,7 @@ static int open_fdinfo(int pid, struct fdinfo_entry *fe, int state)
 	struct file_desc *fdesc;
 
 	fdesc = find_file_desc(fe);
-	pr_info("\t%d: Restoring fd %d (state -> %d)\n", pid, fe->fd, state);
+	pr_info("\tRestoring fd %d (state -> %d)\n", fe->fd, state);
 
 	switch (state) {
 	case FD_STATE_PREP:
@@ -652,7 +652,7 @@ int prepare_fds(struct pstree_item *me)
 	struct fdinfo_list_entry *fle;
 	int nr = 0;
 
-	pr_info("%d: Opening fdinfo-s\n", me->pid);
+	pr_info("Opening fdinfo-s\n");
 
 	for (state = 0; state < FD_STATE_MAX; state++)
 		list_for_each_entry(fle, &me->rst->fds, ps_list) {
-- 
1.7.1



More information about the CRIU mailing list