/* SPDX-License-Identifier: GPL-2.0 */1/*2* GPU memory trace points3*4* Copyright (C) 2020 Google, Inc.5*/67#undef TRACE_SYSTEM8#define TRACE_SYSTEM gpu_mem910#if !defined(_TRACE_GPU_MEM_H) || defined(TRACE_HEADER_MULTI_READ)11#define _TRACE_GPU_MEM_H1213#include <linux/tracepoint.h>1415/*16* The gpu_memory_total event indicates that there's an update to either the17* global or process total gpu memory counters.18*19* This event should be emitted whenever the kernel device driver allocates,20* frees, imports, unimports memory in the GPU addressable space.21*22* @gpu_id: This is the gpu id.23*24* @pid: Put 0 for global total, while positive pid for process total.25*26* @size: Size of the allocation in bytes.27*28*/29TRACE_EVENT(gpu_mem_total,3031TP_PROTO(uint32_t gpu_id, uint32_t pid, uint64_t size),3233TP_ARGS(gpu_id, pid, size),3435TP_STRUCT__entry(36__field(uint32_t, gpu_id)37__field(uint32_t, pid)38__field(uint64_t, size)39),4041TP_fast_assign(42__entry->gpu_id = gpu_id;43__entry->pid = pid;44__entry->size = size;45),4647TP_printk("gpu_id=%u pid=%u size=%llu",48__entry->gpu_id,49__entry->pid,50__entry->size)51);5253#endif /* _TRACE_GPU_MEM_H */5455/* This part must be outside protection */56#include <trace/define_trace.h>575859