[CRIU] [PATCH 11/16] mem/pmc: Print pid for debug sake

Cyrill Gorcunov gorcunov at gmail.com
Fri Jul 5 18:38:06 MSK 2019


When logs are massive it is convenient for grepping.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 criu/pagemap-cache.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/criu/pagemap-cache.c b/criu/pagemap-cache.c
index c8077612330a..61ab09387f6f 100644
--- a/criu/pagemap-cache.c
+++ b/criu/pagemap-cache.c
@@ -105,8 +105,8 @@ static int pmc_fill_cache(pmc_t *pmc, const struct vma_area *vma)
 	pmc->start = vma->e->start;
 	pmc->end = vma->e->end;
 
-	pr_debug("filling VMA %lx-%lx (%zuK) [l:%lx h:%lx]\n",
-		 (long)vma->e->start, (long)vma->e->end, len >> 10, low, high);
+	pr_debug("%d: filling VMA %lx-%lx (%zuK) [l:%lx h:%lx]\n",
+		 pmc->pid, (long)vma->e->start, (long)vma->e->end, len >> 10, low, high);
 
 	/*
 	 * If we meet a small VMA, lets try to fit 2M cache
@@ -123,8 +123,8 @@ static int pmc_fill_cache(pmc_t *pmc, const struct vma_area *vma)
 		size_t size_cov = len;
 		size_t nr_vmas = 1;
 
-		pr_debug("\t%16lx-%-16lx nr:%-5zu cov:%zu\n",
-			 (long)vma->e->start, (long)vma->e->end, nr_vmas, size_cov);
+		pr_debug("\t%d: %16lx-%-16lx nr:%-5zu cov:%zu\n",
+			 pmc->pid, (long)vma->e->start, (long)vma->e->end, nr_vmas, size_cov);
 
 		list_for_each_entry_continue(vma, pmc->vma_head, list) {
 			if (vma->e->start > high || vma->e->end > high)
@@ -134,8 +134,8 @@ static int pmc_fill_cache(pmc_t *pmc, const struct vma_area *vma)
 			size_cov += vma_area_len(vma);
 			nr_vmas++;
 
-			pr_debug("\t%16lx-%-16lx nr:%-5zu cov:%zu\n",
-				 (long)vma->e->start, (long)vma->e->end, nr_vmas, size_cov);
+			pr_debug("\t%d: %16lx-%-16lx nr:%-5zu cov:%zu\n",
+				 pmc->pid, (long)vma->e->start, (long)vma->e->end, nr_vmas, size_cov);
 		}
 
 		if (nr_vmas > 1) {
@@ -145,9 +145,9 @@ static int pmc_fill_cache(pmc_t *pmc, const struct vma_area *vma)
 			 * allows us to save a couple of code bytes.
 			 */
 			pmc->end = high;
-			pr_debug("\tcache  mode [l:%lx h:%lx]\n", pmc->start, pmc->end);
+			pr_debug("\t%d: cache  mode [l:%lx h:%lx]\n", pmc->pid, pmc->start, pmc->end);
 		} else
-			pr_debug("\tsimple mode [l:%lx h:%lx]\n", pmc->start, pmc->end);
+			pr_debug("\t%d: simple mode [l:%lx h:%lx]\n", pmc->pid, pmc->start, pmc->end);
 	}
 
 	size_map = PAGEMAP_LEN(pmc->end - pmc->start);
-- 
2.20.1



More information about the CRIU mailing list