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

Submitted by Cyrill Gorcunov on July 5, 2019, 3:38 p.m.

Details

Message ID 20190705153811.22652-12-gorcunov@gmail.com
State Accepted
Series "mem: Cleanup and fixups"
Commit c93090c4ef1612e65c2c9a501899e6533568ffad
Headers show

Commit Message

Cyrill Gorcunov July 5, 2019, 3:38 p.m.
When logs are massive it is convenient for grepping.

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

Patch hide | download patch | download mbox

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);

Comments

Mike Rapoport July 8, 2019, 5:05 p.m.
On Fri, Jul 05, 2019 at 06:38:06PM +0300, Cyrill Gorcunov wrote:
> When logs are massive it is convenient for grepping.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>

Reviewed-by: Mike Rapoport <rppt@linux.ibm.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
> 
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu