2009-04-10 06:54:16 -06:00
|
|
|
#if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ)
|
2009-04-10 00:26:18 -06:00
|
|
|
#define _TRACE_KMEM_H
|
2008-08-10 11:14:03 -06:00
|
|
|
|
|
|
|
#include <linux/types.h>
|
2009-04-10 00:27:38 -06:00
|
|
|
#include <linux/tracepoint.h>
|
2008-08-10 11:14:03 -06:00
|
|
|
|
2009-04-10 06:54:16 -06:00
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM kmem
|
2008-08-10 11:14:03 -06:00
|
|
|
|
2009-04-10 06:54:16 -06:00
|
|
|
TRACE_EVENT(kmalloc,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long call_site,
|
|
|
|
const void *ptr,
|
|
|
|
size_t bytes_req,
|
|
|
|
size_t bytes_alloc,
|
|
|
|
gfp_t gfp_flags),
|
|
|
|
|
|
|
|
TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field( unsigned long, call_site )
|
|
|
|
__field( const void *, ptr )
|
|
|
|
__field( size_t, bytes_req )
|
|
|
|
__field( size_t, bytes_alloc )
|
|
|
|
__field( gfp_t, gfp_flags )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->call_site = call_site;
|
|
|
|
__entry->ptr = ptr;
|
|
|
|
__entry->bytes_req = bytes_req;
|
|
|
|
__entry->bytes_alloc = bytes_alloc;
|
|
|
|
__entry->gfp_flags = gfp_flags;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x",
|
|
|
|
__entry->call_site,
|
|
|
|
__entry->ptr,
|
|
|
|
__entry->bytes_req,
|
|
|
|
__entry->bytes_alloc,
|
|
|
|
__entry->gfp_flags)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(kmem_cache_alloc,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long call_site,
|
|
|
|
const void *ptr,
|
|
|
|
size_t bytes_req,
|
|
|
|
size_t bytes_alloc,
|
|
|
|
gfp_t gfp_flags),
|
|
|
|
|
|
|
|
TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field( unsigned long, call_site )
|
|
|
|
__field( const void *, ptr )
|
|
|
|
__field( size_t, bytes_req )
|
|
|
|
__field( size_t, bytes_alloc )
|
|
|
|
__field( gfp_t, gfp_flags )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->call_site = call_site;
|
|
|
|
__entry->ptr = ptr;
|
|
|
|
__entry->bytes_req = bytes_req;
|
|
|
|
__entry->bytes_alloc = bytes_alloc;
|
|
|
|
__entry->gfp_flags = gfp_flags;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x",
|
|
|
|
__entry->call_site,
|
|
|
|
__entry->ptr,
|
|
|
|
__entry->bytes_req,
|
|
|
|
__entry->bytes_alloc,
|
|
|
|
__entry->gfp_flags)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(kmalloc_node,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long call_site,
|
|
|
|
const void *ptr,
|
|
|
|
size_t bytes_req,
|
|
|
|
size_t bytes_alloc,
|
|
|
|
gfp_t gfp_flags,
|
|
|
|
int node),
|
|
|
|
|
|
|
|
TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field( unsigned long, call_site )
|
|
|
|
__field( const void *, ptr )
|
|
|
|
__field( size_t, bytes_req )
|
|
|
|
__field( size_t, bytes_alloc )
|
|
|
|
__field( gfp_t, gfp_flags )
|
|
|
|
__field( int, node )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->call_site = call_site;
|
|
|
|
__entry->ptr = ptr;
|
|
|
|
__entry->bytes_req = bytes_req;
|
|
|
|
__entry->bytes_alloc = bytes_alloc;
|
|
|
|
__entry->gfp_flags = gfp_flags;
|
|
|
|
__entry->node = node;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d",
|
|
|
|
__entry->call_site,
|
|
|
|
__entry->ptr,
|
|
|
|
__entry->bytes_req,
|
|
|
|
__entry->bytes_alloc,
|
|
|
|
__entry->gfp_flags,
|
|
|
|
__entry->node)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(kmem_cache_alloc_node,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long call_site,
|
|
|
|
const void *ptr,
|
|
|
|
size_t bytes_req,
|
|
|
|
size_t bytes_alloc,
|
|
|
|
gfp_t gfp_flags,
|
|
|
|
int node),
|
|
|
|
|
|
|
|
TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field( unsigned long, call_site )
|
|
|
|
__field( const void *, ptr )
|
|
|
|
__field( size_t, bytes_req )
|
|
|
|
__field( size_t, bytes_alloc )
|
|
|
|
__field( gfp_t, gfp_flags )
|
|
|
|
__field( int, node )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->call_site = call_site;
|
|
|
|
__entry->ptr = ptr;
|
|
|
|
__entry->bytes_req = bytes_req;
|
|
|
|
__entry->bytes_alloc = bytes_alloc;
|
|
|
|
__entry->gfp_flags = gfp_flags;
|
|
|
|
__entry->node = node;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d",
|
|
|
|
__entry->call_site,
|
|
|
|
__entry->ptr,
|
|
|
|
__entry->bytes_req,
|
|
|
|
__entry->bytes_alloc,
|
|
|
|
__entry->gfp_flags,
|
|
|
|
__entry->node)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(kfree,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long call_site, const void *ptr),
|
|
|
|
|
|
|
|
TP_ARGS(call_site, ptr),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field( unsigned long, call_site )
|
|
|
|
__field( const void *, ptr )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->call_site = call_site;
|
|
|
|
__entry->ptr = ptr;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(kmem_cache_free,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long call_site, const void *ptr),
|
|
|
|
|
|
|
|
TP_ARGS(call_site, ptr),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field( unsigned long, call_site )
|
|
|
|
__field( const void *, ptr )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->call_site = call_site;
|
|
|
|
__entry->ptr = ptr;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|