mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: Move debugfs fields to os_linux
Move all Linux specific debugfs dentry fields to struct nvgpu_os_linux. JIRA NVGPU-62 Change-Id: I615620005f5d042943dd2e478c1629bcc912c550 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1528263 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
b8efd9d045
commit
972c42fddf
@@ -13,7 +13,6 @@
|
||||
*/
|
||||
|
||||
#include "debug_allocator.h"
|
||||
#include "gk20a/platform_gk20a.h"
|
||||
#include "os_linux.h"
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
@@ -52,11 +51,13 @@ static const struct file_operations __alloc_fops = {
|
||||
|
||||
void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a)
|
||||
{
|
||||
if (!g->debugfs_allocators)
|
||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
||||
|
||||
if (!l->debugfs_allocators)
|
||||
return;
|
||||
|
||||
a->debugfs_entry = debugfs_create_file(a->name, S_IRUGO,
|
||||
g->debugfs_allocators,
|
||||
l->debugfs_allocators,
|
||||
a, &__alloc_fops);
|
||||
}
|
||||
|
||||
@@ -68,14 +69,14 @@ void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a)
|
||||
|
||||
void nvgpu_alloc_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);
|
||||
|
||||
g->debugfs_allocators = debugfs_create_dir("allocators", platform->debugfs);
|
||||
if (IS_ERR_OR_NULL(g->debugfs_allocators)) {
|
||||
g->debugfs_allocators = NULL;
|
||||
l->debugfs_allocators = debugfs_create_dir("allocators", l->debugfs);
|
||||
if (IS_ERR_OR_NULL(l->debugfs_allocators)) {
|
||||
l->debugfs_allocators = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
debugfs_create_u32("tracing", 0664, g->debugfs_allocators,
|
||||
debugfs_create_u32("tracing", 0664, l->debugfs_allocators,
|
||||
&nvgpu_alloc_tracing_on);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user