summaryrefslogtreecommitdiffstats
path: root/include/linux/nvmap.h
diff options
context:
space:
mode:
authorGreg Hackmann <ghackmann@google.com>2014-10-13 17:39:06 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:04:10 -0400
commit5021588dceacd2d919ef09cd146e473ced8332f7 (patch)
treead0c0f86581931ea17e98e87c7a7d8e7e4804e8d /include/linux/nvmap.h
parentb20b26fd3d882fe72b0df40078c086b861db2ede (diff)
video: tegra: nvmap: create per-pid debugfs memory data
/sys/kernel/debug/nvmap/handles_by_pid/<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/<heap>/maps will still contain per-heap mapping data in a human-readable format. Change-Id: I22544a449c000e4bfec549cfadbb165703b64bd3 Signed-off-by: Greg Hackmann <ghackmann@google.com> Signed-off-by: Maneet Singh <mmaneetsingh@nvidia.com> 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 <vdumpa@nvidia.com>
Diffstat (limited to 'include/linux/nvmap.h')
-rw-r--r--include/linux/nvmap.h14
1 files changed, 13 insertions, 1 deletions
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 @@
3 * 3 *
4 * structure declarations for nvmem and nvmap user-space ioctls 4 * structure declarations for nvmem and nvmap user-space ioctls
5 * 5 *
6 * Copyright (c) 2009-2014, NVIDIA CORPORATION. All rights reserved. 6 * Copyright (c) 2009-2015, NVIDIA CORPORATION. All rights reserved.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -235,6 +235,18 @@ struct nvmap_cache_op_list {
235 __s32 op; /* wb/wb_inv/inv */ 235 __s32 op; /* wb/wb_inv/inv */
236}; 236};
237 237
238struct nvmap_debugfs_handles_header {
239 __u8 version;
240};
241
242struct nvmap_debugfs_handles_entry {
243 __u64 base;
244 __u64 size;
245 __u32 flags;
246 __u32 share_count;
247 __u64 mapped_size;
248};
249
238#define NVMAP_IOC_MAGIC 'N' 250#define NVMAP_IOC_MAGIC 'N'
239 251
240/* Creates a new memory handle. On input, the argument is the size of the new 252/* Creates a new memory handle. On input, the argument is the size of the new