123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977 |
- /* Copyright (c) 2016, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
- #undef TRACE_SYSTEM
- #define TRACE_SYSTEM kmem
- #if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ)
- #define _TRACE_KMEM_H
- #include <linux/types.h>
- #include <linux/tracepoint.h>
- #include <trace/events/mmflags.h>
- DECLARE_EVENT_CLASS(kmem_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=%s",
- __entry->call_site,
- __entry->ptr,
- __entry->bytes_req,
- __entry->bytes_alloc,
- show_gfp_flags(__entry->gfp_flags))
- );
- DEFINE_EVENT(kmem_alloc, 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)
- );
- DEFINE_EVENT(kmem_alloc, 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)
- );
- DECLARE_EVENT_CLASS(kmem_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=%s node=%d",
- __entry->call_site,
- __entry->ptr,
- __entry->bytes_req,
- __entry->bytes_alloc,
- show_gfp_flags(__entry->gfp_flags),
- __entry->node)
- );
- DEFINE_EVENT(kmem_alloc_node, 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)
- );
- DEFINE_EVENT(kmem_alloc_node, 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)
- );
- DECLARE_EVENT_CLASS(kmem_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)
- );
- DEFINE_EVENT(kmem_free, kfree,
- TP_PROTO(unsigned long call_site, const void *ptr),
- TP_ARGS(call_site, ptr)
- );
- DEFINE_EVENT(kmem_free, kmem_cache_free,
- TP_PROTO(unsigned long call_site, const void *ptr),
- TP_ARGS(call_site, ptr)
- );
- TRACE_EVENT(mm_page_free,
- TP_PROTO(struct page *page, unsigned int order),
- TP_ARGS(page, order),
- TP_STRUCT__entry(
- __field( unsigned long, pfn )
- __field( unsigned int, order )
- ),
- TP_fast_assign(
- __entry->pfn = page_to_pfn(page);
- __entry->order = order;
- ),
- TP_printk("page=%p pfn=%lu order=%d",
- pfn_to_page(__entry->pfn),
- __entry->pfn,
- __entry->order)
- );
- TRACE_EVENT(mm_page_free_batched,
- TP_PROTO(struct page *page, int cold),
- TP_ARGS(page, cold),
- TP_STRUCT__entry(
- __field( unsigned long, pfn )
- __field( int, cold )
- ),
- TP_fast_assign(
- __entry->pfn = page_to_pfn(page);
- __entry->cold = cold;
- ),
- TP_printk("page=%p pfn=%lu order=0 cold=%d",
- pfn_to_page(__entry->pfn),
- __entry->pfn,
- __entry->cold)
- );
- TRACE_EVENT(mm_page_alloc,
- TP_PROTO(struct page *page, unsigned int order,
- gfp_t gfp_flags, int migratetype),
- TP_ARGS(page, order, gfp_flags, migratetype),
- TP_STRUCT__entry(
- __field( unsigned long, pfn )
- __field( unsigned int, order )
- __field( gfp_t, gfp_flags )
- __field( int, migratetype )
- ),
- TP_fast_assign(
- __entry->pfn = page ? page_to_pfn(page) : -1UL;
- __entry->order = order;
- __entry->gfp_flags = gfp_flags;
- __entry->migratetype = migratetype;
- ),
- TP_printk("page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s",
- __entry->pfn != -1UL ? pfn_to_page(__entry->pfn) : NULL,
- __entry->pfn != -1UL ? __entry->pfn : 0,
- __entry->order,
- __entry->migratetype,
- show_gfp_flags(__entry->gfp_flags))
- );
- DECLARE_EVENT_CLASS(mm_page,
- TP_PROTO(struct page *page, unsigned int order, int migratetype),
- TP_ARGS(page, order, migratetype),
- TP_STRUCT__entry(
- __field( unsigned long, pfn )
- __field( unsigned int, order )
- __field( int, migratetype )
- ),
- TP_fast_assign(
- __entry->pfn = page ? page_to_pfn(page) : -1UL;
- __entry->order = order;
- __entry->migratetype = migratetype;
- ),
- TP_printk("page=%p pfn=%lu order=%u migratetype=%d percpu_refill=%d",
- __entry->pfn != -1UL ? pfn_to_page(__entry->pfn) : NULL,
- __entry->pfn != -1UL ? __entry->pfn : 0,
- __entry->order,
- __entry->migratetype,
- __entry->order == 0)
- );
- DEFINE_EVENT(mm_page, mm_page_alloc_zone_locked,
- TP_PROTO(struct page *page, unsigned int order, int migratetype),
- TP_ARGS(page, order, migratetype)
- );
- TRACE_EVENT(mm_page_pcpu_drain,
- TP_PROTO(struct page *page, unsigned int order, int migratetype),
- TP_ARGS(page, order, migratetype),
- TP_STRUCT__entry(
- __field( unsigned long, pfn )
- __field( unsigned int, order )
- __field( int, migratetype )
- ),
- TP_fast_assign(
- __entry->pfn = page ? page_to_pfn(page) : -1UL;
- __entry->order = order;
- __entry->migratetype = migratetype;
- ),
- TP_printk("page=%p pfn=%lu order=%d migratetype=%d",
- pfn_to_page(__entry->pfn), __entry->pfn,
- __entry->order, __entry->migratetype)
- );
- TRACE_EVENT(mm_page_alloc_extfrag,
- TP_PROTO(struct page *page,
- int alloc_order, int fallback_order,
- int alloc_migratetype, int fallback_migratetype),
- TP_ARGS(page,
- alloc_order, fallback_order,
- alloc_migratetype, fallback_migratetype),
- TP_STRUCT__entry(
- __field( unsigned long, pfn )
- __field( int, alloc_order )
- __field( int, fallback_order )
- __field( int, alloc_migratetype )
- __field( int, fallback_migratetype )
- __field( int, change_ownership )
- ),
- TP_fast_assign(
- __entry->pfn = page_to_pfn(page);
- __entry->alloc_order = alloc_order;
- __entry->fallback_order = fallback_order;
- __entry->alloc_migratetype = alloc_migratetype;
- __entry->fallback_migratetype = fallback_migratetype;
- __entry->change_ownership = (alloc_migratetype ==
- get_pageblock_migratetype(page));
- ),
- TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d",
- pfn_to_page(__entry->pfn),
- __entry->pfn,
- __entry->alloc_order,
- __entry->fallback_order,
- pageblock_order,
- __entry->alloc_migratetype,
- __entry->fallback_migratetype,
- __entry->fallback_order < pageblock_order,
- __entry->change_ownership)
- );
- TRACE_EVENT(ion_heap_shrink,
- TP_PROTO(const char *heap_name,
- size_t len,
- long total_allocated),
- TP_ARGS(heap_name, len, total_allocated),
- TP_STRUCT__entry(
- __string(heap_name, heap_name)
- __field(size_t, len)
- __field(long, total_allocated)
- ),
- TP_fast_assign(
- __assign_str(heap_name, heap_name);
- __entry->len = len;
- __entry->total_allocated = total_allocated;
- ),
- TP_printk("heap_name=%s, len=%zu, total_allocated=%ld",
- __get_str(heap_name), __entry->len, __entry->total_allocated)
- );
- TRACE_EVENT(ion_heap_grow,
- TP_PROTO(const char *heap_name,
- size_t len,
- long total_allocated),
- TP_ARGS(heap_name, len, total_allocated),
- TP_STRUCT__entry(
- __string(heap_name, heap_name)
- __field(size_t, len)
- __field(long, total_allocated)
- ),
- TP_fast_assign(
- __assign_str(heap_name, heap_name);
- __entry->len = len;
- __entry->total_allocated = total_allocated;
- ),
- TP_printk("heap_name=%s, len=%zu, total_allocated=%ld",
- __get_str(heap_name), __entry->len, __entry->total_allocated)
- );
- DECLARE_EVENT_CLASS(ion_alloc,
- TP_PROTO(const char *client_name,
- const char *heap_name,
- size_t len,
- unsigned int mask,
- unsigned int flags),
- TP_ARGS(client_name, heap_name, len, mask, flags),
- TP_STRUCT__entry(
- __array(char, client_name, 64)
- __string(heap_name, heap_name)
- __field(size_t, len)
- __field(unsigned int, mask)
- __field(unsigned int, flags)
- ),
- TP_fast_assign(
- strlcpy(__entry->client_name, client_name, 64);
- __assign_str(heap_name, heap_name);
- __entry->len = len;
- __entry->mask = mask;
- __entry->flags = flags;
- ),
- TP_printk("client_name=%s heap_name=%s len=%zu mask=0x%x flags=0x%x",
- __entry->client_name,
- __get_str(heap_name),
- __entry->len,
- __entry->mask,
- __entry->flags)
- );
- DEFINE_EVENT(ion_alloc, ion_alloc_buffer_start,
- TP_PROTO(const char *client_name,
- const char *heap_name,
- size_t len,
- unsigned int mask,
- unsigned int flags),
- TP_ARGS(client_name, heap_name, len, mask, flags)
- );
- DEFINE_EVENT(ion_alloc, ion_alloc_buffer_end,
- TP_PROTO(const char *client_name,
- const char *heap_name,
- size_t len,
- unsigned int mask,
- unsigned int flags),
- TP_ARGS(client_name, heap_name, len, mask, flags)
- );
- DECLARE_EVENT_CLASS(ion_alloc_error,
- TP_PROTO(const char *client_name,
- const char *heap_name,
- size_t len,
- unsigned int mask,
- unsigned int flags,
- long error),
- TP_ARGS(client_name, heap_name, len, mask, flags, error),
- TP_STRUCT__entry(
- __field(const char *, client_name)
- __string(heap_name, heap_name)
- __field(size_t, len)
- __field(unsigned int, mask)
- __field(unsigned int, flags)
- __field(long, error)
- ),
- TP_fast_assign(
- __entry->client_name = client_name;
- __assign_str(heap_name, heap_name);
- __entry->len = len;
- __entry->mask = mask;
- __entry->flags = flags;
- __entry->error = error;
- ),
- TP_printk(
- "client_name=%s heap_name=%s len=%zu mask=0x%x flags=0x%x error=%ld",
- __entry->client_name,
- __get_str(heap_name),
- __entry->len,
- __entry->mask,
- __entry->flags,
- __entry->error)
- );
- DEFINE_EVENT(ion_alloc_error, ion_alloc_buffer_fallback,
- TP_PROTO(const char *client_name,
- const char *heap_name,
- size_t len,
- unsigned int mask,
- unsigned int flags,
- long error),
- TP_ARGS(client_name, heap_name, len, mask, flags, error)
- );
- DEFINE_EVENT(ion_alloc_error, ion_alloc_buffer_fail,
- TP_PROTO(const char *client_name,
- const char *heap_name,
- size_t len,
- unsigned int mask,
- unsigned int flags,
- long error),
- TP_ARGS(client_name, heap_name, len, mask, flags, error)
- );
- DECLARE_EVENT_CLASS(alloc_retry,
- TP_PROTO(int tries),
- TP_ARGS(tries),
- TP_STRUCT__entry(
- __field(int, tries)
- ),
- TP_fast_assign(
- __entry->tries = tries;
- ),
- TP_printk("tries=%d",
- __entry->tries)
- );
- DEFINE_EVENT(alloc_retry, ion_cp_alloc_retry,
- TP_PROTO(int tries),
- TP_ARGS(tries)
- );
- DEFINE_EVENT(alloc_retry, migrate_retry,
- TP_PROTO(int tries),
- TP_ARGS(tries)
- );
- DEFINE_EVENT(alloc_retry, dma_alloc_contiguous_retry,
- TP_PROTO(int tries),
- TP_ARGS(tries)
- );
- DECLARE_EVENT_CLASS(migrate_pages,
- TP_PROTO(int mode),
- TP_ARGS(mode),
- TP_STRUCT__entry(
- __field(int, mode)
- ),
- TP_fast_assign(
- __entry->mode = mode;
- ),
- TP_printk("mode=%d",
- __entry->mode)
- );
- DEFINE_EVENT(migrate_pages, migrate_pages_start,
- TP_PROTO(int mode),
- TP_ARGS(mode)
- );
- DEFINE_EVENT(migrate_pages, migrate_pages_end,
- TP_PROTO(int mode),
- TP_ARGS(mode)
- );
- DECLARE_EVENT_CLASS(ion_alloc_pages,
- TP_PROTO(gfp_t gfp_flags,
- unsigned int order),
- TP_ARGS(gfp_flags, order),
- TP_STRUCT__entry(
- __field(gfp_t, gfp_flags)
- __field(unsigned int, order)
- ),
- TP_fast_assign(
- __entry->gfp_flags = gfp_flags;
- __entry->order = order;
- ),
- TP_printk("gfp_flags=%s order=%d",
- show_gfp_flags(__entry->gfp_flags),
- __entry->order)
- );
- DEFINE_EVENT(ion_alloc_pages, alloc_pages_iommu_start,
- TP_PROTO(gfp_t gfp_flags,
- unsigned int order),
- TP_ARGS(gfp_flags, order)
- );
- DEFINE_EVENT(ion_alloc_pages, alloc_pages_iommu_end,
- TP_PROTO(gfp_t gfp_flags,
- unsigned int order),
- TP_ARGS(gfp_flags, order)
- );
- DEFINE_EVENT(ion_alloc_pages, alloc_pages_iommu_fail,
- TP_PROTO(gfp_t gfp_flags,
- unsigned int order),
- TP_ARGS(gfp_flags, order)
- );
- DEFINE_EVENT(ion_alloc_pages, alloc_pages_sys_start,
- TP_PROTO(gfp_t gfp_flags,
- unsigned int order),
- TP_ARGS(gfp_flags, order)
- );
- DEFINE_EVENT(ion_alloc_pages, alloc_pages_sys_end,
- TP_PROTO(gfp_t gfp_flags,
- unsigned int order),
- TP_ARGS(gfp_flags, order)
- );
- DEFINE_EVENT(ion_alloc_pages, alloc_pages_sys_fail,
- TP_PROTO(gfp_t gfp_flags,
- unsigned int order),
- TP_ARGS(gfp_flags, order)
- );
- DECLARE_EVENT_CLASS(smmu_map,
- TP_PROTO(unsigned long va,
- phys_addr_t pa,
- unsigned long chunk_size,
- size_t len),
- TP_ARGS(va, pa, chunk_size, len),
- TP_STRUCT__entry(
- __field(unsigned long, va)
- __field(phys_addr_t, pa)
- __field(unsigned long, chunk_size)
- __field(size_t, len)
- ),
- TP_fast_assign(
- __entry->va = va;
- __entry->pa = pa;
- __entry->chunk_size = chunk_size;
- __entry->len = len;
- ),
- TP_printk("v_addr=%p p_addr=%pa chunk_size=0x%lx len=%zu",
- (void *)__entry->va,
- &__entry->pa,
- __entry->chunk_size,
- __entry->len)
- );
- DEFINE_EVENT(smmu_map, iommu_map_range,
- TP_PROTO(unsigned long va,
- phys_addr_t pa,
- unsigned long chunk_size,
- size_t len),
- TP_ARGS(va, pa, chunk_size, len)
- );
- DECLARE_EVENT_CLASS(ion_secure_cma_add_to_pool,
- TP_PROTO(unsigned long len,
- int pool_total,
- bool is_prefetch),
- TP_ARGS(len, pool_total, is_prefetch),
- TP_STRUCT__entry(
- __field(unsigned long, len)
- __field(int, pool_total)
- __field(bool, is_prefetch)
- ),
- TP_fast_assign(
- __entry->len = len;
- __entry->pool_total = pool_total;
- __entry->is_prefetch = is_prefetch;
- ),
- TP_printk("len %lx, pool total %x is_prefetch %d",
- __entry->len,
- __entry->pool_total,
- __entry->is_prefetch)
- );
- DEFINE_EVENT(ion_secure_cma_add_to_pool, ion_secure_cma_add_to_pool_start,
- TP_PROTO(unsigned long len,
- int pool_total,
- bool is_prefetch),
- TP_ARGS(len, pool_total, is_prefetch)
- );
- DEFINE_EVENT(ion_secure_cma_add_to_pool, ion_secure_cma_add_to_pool_end,
- TP_PROTO(unsigned long len,
- int pool_total,
- bool is_prefetch),
- TP_ARGS(len, pool_total, is_prefetch)
- );
- DECLARE_EVENT_CLASS(ion_secure_cma_shrink_pool,
- TP_PROTO(unsigned long drained_size,
- unsigned long skipped_size),
- TP_ARGS(drained_size, skipped_size),
- TP_STRUCT__entry(
- __field(unsigned long, drained_size)
- __field(unsigned long, skipped_size)
- ),
- TP_fast_assign(
- __entry->drained_size = drained_size;
- __entry->skipped_size = skipped_size;
- ),
- TP_printk("drained size %lx, skipped size %lx",
- __entry->drained_size,
- __entry->skipped_size)
- );
- DEFINE_EVENT(ion_secure_cma_shrink_pool, ion_secure_cma_shrink_pool_start,
- TP_PROTO(unsigned long drained_size,
- unsigned long skipped_size),
- TP_ARGS(drained_size, skipped_size)
- );
- DEFINE_EVENT(ion_secure_cma_shrink_pool, ion_secure_cma_shrink_pool_end,
- TP_PROTO(unsigned long drained_size,
- unsigned long skipped_size),
- TP_ARGS(drained_size, skipped_size)
- );
- TRACE_EVENT(ion_prefetching,
- TP_PROTO(unsigned long len),
- TP_ARGS(len),
- TP_STRUCT__entry(
- __field(unsigned long, len)
- ),
- TP_fast_assign(
- __entry->len = len;
- ),
- TP_printk("prefetch size %lx",
- __entry->len)
- );
- DECLARE_EVENT_CLASS(ion_secure_cma_allocate,
- TP_PROTO(const char *heap_name,
- unsigned long len,
- unsigned long align,
- unsigned long flags),
- TP_ARGS(heap_name, len, align, flags),
- TP_STRUCT__entry(
- __string(heap_name, heap_name)
- __field(unsigned long, len)
- __field(unsigned long, align)
- __field(unsigned long, flags)
- ),
- TP_fast_assign(
- __assign_str(heap_name, heap_name);
- __entry->len = len;
- __entry->align = align;
- __entry->flags = flags;
- ),
- TP_printk("heap_name=%s len=%lx align=%lx flags=%lx",
- __get_str(heap_name),
- __entry->len,
- __entry->align,
- __entry->flags)
- );
- DEFINE_EVENT(ion_secure_cma_allocate, ion_secure_cma_allocate_start,
- TP_PROTO(const char *heap_name,
- unsigned long len,
- unsigned long align,
- unsigned long flags),
- TP_ARGS(heap_name, len, align, flags)
- );
- DEFINE_EVENT(ion_secure_cma_allocate, ion_secure_cma_allocate_end,
- TP_PROTO(const char *heap_name,
- unsigned long len,
- unsigned long align,
- unsigned long flags),
- TP_ARGS(heap_name, len, align, flags)
- );
- DECLARE_EVENT_CLASS(ion_cp_secure_buffer,
- TP_PROTO(const char *heap_name,
- unsigned long len,
- unsigned long align,
- unsigned long flags),
- TP_ARGS(heap_name, len, align, flags),
- TP_STRUCT__entry(
- __string(heap_name, heap_name)
- __field(unsigned long, len)
- __field(unsigned long, align)
- __field(unsigned long, flags)
- ),
- TP_fast_assign(
- __assign_str(heap_name, heap_name);
- __entry->len = len;
- __entry->align = align;
- __entry->flags = flags;
- ),
- TP_printk("heap_name=%s len=%lx align=%lx flags=%lx",
- __get_str(heap_name),
- __entry->len,
- __entry->align,
- __entry->flags)
- );
- DEFINE_EVENT(ion_cp_secure_buffer, ion_cp_secure_buffer_start,
- TP_PROTO(const char *heap_name,
- unsigned long len,
- unsigned long align,
- unsigned long flags),
- TP_ARGS(heap_name, len, align, flags)
- );
- DEFINE_EVENT(ion_cp_secure_buffer, ion_cp_secure_buffer_end,
- TP_PROTO(const char *heap_name,
- unsigned long len,
- unsigned long align,
- unsigned long flags),
- TP_ARGS(heap_name, len, align, flags)
- );
- DECLARE_EVENT_CLASS(iommu_sec_ptbl_map_range,
- TP_PROTO(int sec_id,
- int num,
- unsigned long va,
- unsigned int pa,
- size_t len),
- TP_ARGS(sec_id, num, va, pa, len),
- TP_STRUCT__entry(
- __field(int, sec_id)
- __field(int, num)
- __field(unsigned long, va)
- __field(unsigned int, pa)
- __field(size_t, len)
- ),
- TP_fast_assign(
- __entry->sec_id = sec_id;
- __entry->num = num;
- __entry->va = va;
- __entry->pa = pa;
- __entry->len = len;
- ),
- TP_printk("sec_id=%d num=%d va=%lx pa=%u len=%zu",
- __entry->sec_id,
- __entry->num,
- __entry->va,
- __entry->pa,
- __entry->len)
- );
- DEFINE_EVENT(iommu_sec_ptbl_map_range, iommu_sec_ptbl_map_range_start,
- TP_PROTO(int sec_id,
- int num,
- unsigned long va,
- unsigned int pa,
- size_t len),
- TP_ARGS(sec_id, num, va, pa, len)
- );
- DEFINE_EVENT(iommu_sec_ptbl_map_range, iommu_sec_ptbl_map_range_end,
- TP_PROTO(int sec_id,
- int num,
- unsigned long va,
- unsigned int pa,
- size_t len),
- TP_ARGS(sec_id, num, va, pa, len)
- );
- /*
- * Required for uniquely and securely identifying mm in rss_stat tracepoint.
- */
- #ifndef __PTR_TO_HASHVAL
- static unsigned int __maybe_unused mm_ptr_to_hash(const void *ptr)
- {
- int ret;
- unsigned long hashval;
- ret = ptr_to_hashval(ptr, &hashval);
- if (ret)
- return 0;
- /* The hashed value is only 32-bit */
- return (unsigned int)hashval;
- }
- #define __PTR_TO_HASHVAL
- #endif
- TRACE_EVENT(rss_stat,
- TP_PROTO(struct mm_struct *mm,
- int member,
- long count),
- TP_ARGS(mm, member, count),
- TP_STRUCT__entry(
- __field(unsigned int, mm_id)
- __field(unsigned int, curr)
- __field(int, member)
- __field(long, size)
- ),
- TP_fast_assign(
- __entry->mm_id = mm_ptr_to_hash(mm);
- __entry->curr = !!(current->mm == mm);
- __entry->member = member;
- __entry->size = (count << PAGE_SHIFT);
- ),
- TP_printk("mm_id=%u curr=%d member=%d size=%ldB",
- __entry->mm_id,
- __entry->curr,
- __entry->member,
- __entry->size)
- );
- /* This part must be outside protection */
- #endif /* _TRACE_KMEM_H */
- /* This part must be outside protection */
- #include <trace/define_trace.h>
|