gpu: nvgpu: kmem debug bitrot update

Fix bitrot that was incurred when large amounts of the debugfs
stuff was moved the Linux struct. Since the debugfs debugging
is largely hidden under a config for the kmem code the necessary
changes for the kmem debugging were missed until now.

Change-Id: I105549ce39343e503212e302f39ede36c6ea5194
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1575564
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Alex Waterman
2017-10-09 15:05:08 -07:00
committed by mobile promotions
parent 9b20f2a15e
commit fc5c787339

View File

@@ -9,16 +9,15 @@
* 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.
*
*/
#include "debug_kmem.h"
#include "kmem_priv.h"
#include "gk20a/platform_gk20a.h"
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include "os_linux.h"
#include "debug_kmem.h"
#include "kmem_priv.h"
#ifdef CONFIG_NVGPU_TRACK_MEM_USAGE
/**
* to_human_readable_bytes - Determine suffix for passed size.
@@ -295,21 +294,21 @@ static const struct file_operations __kmem_traces_fops = {
void nvgpu_kmem_debugfs_init(struct gk20a *g)
{
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g));
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *node;
g->debugfs_kmem = debugfs_create_dir("kmem_tracking", platform->debugfs);
if (IS_ERR_OR_NULL(g->debugfs_kmem))
l->debugfs_kmem = debugfs_create_dir("kmem_tracking", l->debugfs);
if (IS_ERR_OR_NULL(l->debugfs_kmem))
return;
node = debugfs_create_file(g->vmallocs->name, S_IRUGO,
g->debugfs_kmem,
l->debugfs_kmem,
g->vmallocs, &__kmem_tracking_fops);
node = debugfs_create_file(g->kmallocs->name, S_IRUGO,
g->debugfs_kmem,
l->debugfs_kmem,
g->kmallocs, &__kmem_tracking_fops);
node = debugfs_create_file("traces", S_IRUGO,
g->debugfs_kmem,
l->debugfs_kmem,
g, &__kmem_traces_fops);
}
#endif