From f0decea728d5bc351e820e77429e427f16f4933c Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Wed, 2 May 2012 14:42:00 +0400 Subject: [PATCH] log: remove pid from messages Now log messages may be splitted by pid Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- cr-restore.c | 14 +++++++------- files.c | 10 +++++----- shmem.c | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cr-restore.c b/cr-restore.c index 81267cb26..19233e7e2 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -225,8 +225,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; @@ -310,7 +310,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; @@ -639,7 +639,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) @@ -959,7 +959,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; @@ -1011,8 +1011,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 9bc4acb26..154d2f7ef 100644 --- a/files.c +++ b/files.c @@ -494,7 +494,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)) @@ -561,7 +561,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) { @@ -604,7 +604,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) { @@ -627,7 +627,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: @@ -651,7 +651,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) { diff --git a/shmem.c b/shmem.c index d5d810580..a0a2e9a05 100644 --- a/shmem.c +++ b/shmem.c @@ -95,7 +95,7 @@ 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; @@ -122,10 +122,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", @@ -169,7 +169,7 @@ int get_shmem_fd(int pid, struct vma_entry *vi) int f; si = find_shmem(rst_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;