From 5021588dceacd2d919ef09cd146e473ced8332f7 Mon Sep 17 00:00:00 2001 From: Greg Hackmann Date: Mon, 13 Oct 2014 14:39:06 -0700 Subject: video: tegra: nvmap: create per-pid debugfs memory data /sys/kernel/debug/nvmap/handles_by_pid/ will list the nvmap handles owned by that pid in a versioned binary format. This is intended for automated collection of memory usage by a specific process. For this usecase, human-readability and per-heap breakdowns are unimportant, and the reduced allocation size can help reduce memory fragmentation. For the curious, /sys/kernel/debug/nvmap//maps will still contain per-heap mapping data in a human-readable format. Change-Id: I22544a449c000e4bfec549cfadbb165703b64bd3 Signed-off-by: Greg Hackmann Signed-off-by: Maneet Singh Reviewed-on: http://git-master/r/663318 (cherry picked from commit ecf87ac1f886125a2c11fb9b1ecc145fe6301565) Reviewed-on: http://git-master/r/677358 GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Reddy --- include/linux/nvmap.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include/linux/nvmap.h') diff --git a/include/linux/nvmap.h b/include/linux/nvmap.h index 290fa8484..11bfc9155 100644 --- a/include/linux/nvmap.h +++ b/include/linux/nvmap.h @@ -3,7 +3,7 @@ * * structure declarations for nvmem and nvmap user-space ioctls * - * Copyright (c) 2009-2014, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2009-2015, NVIDIA CORPORATION. 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 as published by @@ -235,6 +235,18 @@ struct nvmap_cache_op_list { __s32 op; /* wb/wb_inv/inv */ }; +struct nvmap_debugfs_handles_header { + __u8 version; +}; + +struct nvmap_debugfs_handles_entry { + __u64 base; + __u64 size; + __u32 flags; + __u32 share_count; + __u64 mapped_size; +}; + #define NVMAP_IOC_MAGIC 'N' /* Creates a new memory handle. On input, the argument is the size of the new -- cgit v1.2.2