Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added module name as parameter to function to avoid run time conflicts #8213

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
passed an argument with module name to differentiatiate b/w xocl and …
…xclmgmt function calling .

Signed-off-by: mnaguban <[email protected]>
  • Loading branch information
mnaguban committed Jun 4, 2024
commit ab454dbfb16b83432c9a2b833a0e53978317afd2
Original file line number Diff line number Diff line change
Expand Up @@ -1773,8 +1773,8 @@ static int __init xclmgmt_init(void)

if (IS_ERR(xrt_class))
return PTR_ERR(xrt_class);

res = xocl_debug_init();
char *module="mgmtpf";
res = xocl_debug_init(module);
if (res) {
pr_err("failed to init debug");
goto alloc_err;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1993,6 +1993,7 @@ static int __init xocl_init(void)
int ret, i = 0;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
char *module="xocl";\
xrt_class = class_create(THIS_MODULE, "xrt_user");
#else
xrt_class = class_create("xrt_user");
Expand All @@ -2003,7 +2004,7 @@ static int __init xocl_init(void)
goto err_class_create;
}

ret = xocl_debug_init();
ret = xocl_debug_init(module);
if (ret) {
pr_err("failed to init debug");
goto failed;
Expand Down
4 changes: 2 additions & 2 deletions src/runtime_src/core/pcie/driver/linux/xocl/xocl_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void xocl_debug_fini(void)
mutex_destroy(&xrt_debug.mod_lock);
}

int xocl_debug_init(void)
int xocl_debug_init(char *module)
{
struct xocl_dbg_reg reg = { .name = "global" };
int ret;
Expand All @@ -276,7 +276,7 @@ int xocl_debug_init(void)
xrt_debug.last_char = xrt_debug.buffer;
xrt_debug.read_all = true;

xrt_debug.debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
xrt_debug.debugfs_root = debugfs_create_dir(module, NULL);
if (IS_ERR(xrt_debug.debugfs_root)) {
pr_info("creating debugfs root failed");
return PTR_ERR(xrt_debug.debugfs_root);
Expand Down
2 changes: 1 addition & 1 deletion src/runtime_src/core/pcie/driver/linux/xocl/xocl_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2638,7 +2638,7 @@ enum {
XRT_TRACE_LEVEL_VERBOSE,
};

int xocl_debug_init(void);
int xocl_debug_init(char *module);
void xocl_debug_fini(void);
int xocl_debug_register(struct xocl_dbg_reg *reg);
int xocl_debug_unreg(unsigned long hdl);
Expand Down
Loading