Skip to content

Commit

Permalink
mm/vmalloc: Use a trace_alloc_vmap_area event
Browse files Browse the repository at this point in the history
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.

Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
  • Loading branch information
urezki authored and intel-lab-lkp committed Oct 17, 2022
1 parent 56fc292 commit fbc853c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mm/vmalloc.c
Expand Up @@ -43,6 +43,9 @@
#include <asm/tlbflush.h>
#include <asm/shmparam.h>

#define CREATE_TRACE_POINTS
#include <trace/events/vmap.h>

#include "internal.h"
#include "pgalloc-track.h"

Expand Down Expand Up @@ -1620,6 +1623,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.
Expand Down

0 comments on commit fbc853c

Please sign in to comment.