[PATCH v2 4/7] mm: vmalloc: Use trace_alloc_vmap_area event

Uladzislau Rezki (Sony) posted 7 patches 3 years, 5 months ago
[PATCH v2 4/7] mm: vmalloc: Use trace_alloc_vmap_area event
Posted by Uladzislau Rezki (Sony) 3 years, 5 months ago
This is for debug purpose and is called when an allocation
attempt occurs. This event gives some information about:
- a start address of allocated area;
- a size that is requested;
- an align that is required;
- vstart/vend restriction;
- if an allocation fails.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
 mm/vmalloc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 83b54beb12fa..aa86f21bfad0 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -43,6 +43,9 @@
 #include <asm/tlbflush.h>
 #include <asm/shmparam.h>
 
+#define CREATE_TRACE_POINTS
+#include <trace/events/vmalloc.h>
+
 #include "internal.h"
 #include "pgalloc-track.h"
 
@@ -1621,6 +1624,8 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
 		size, align, vstart, vend);
 	spin_unlock(&free_vmap_area_lock);
 
+	trace_alloc_vmap_area(addr, size, align, vstart, vend, addr == vend);
+
 	/*
 	 * If an allocation fails, the "vend" address is
 	 * returned. Therefore trigger the overflow path.
-- 
2.30.2
Re: [PATCH v2 4/7] mm: vmalloc: Use trace_alloc_vmap_area event
Posted by Christoph Hellwig 3 years, 5 months ago
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>