History

kprobes: Use module_name() macro

It is advised to use module_name() macro instead of dereferencing mod->name directly. This makes sense for consistencys sake and also it prevents a hard dependency to CONFIG_MODULES. Link: https://lkml.kernel.org/r/20200818050857.117998-1-jarkko.sakkinen@linux.intel.com

Jarkko Sakkinen committed 6 years ago

Commit f3d36421 parent b427e761 file · +4 −3Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/trace/trace_kprobe.c+4−3
@@ -106,9 +106,10 @@ static nokprobe_inline bool trace_kprobe_has_gone(struct trace_kprobe *tk) · 105 unmodified lines
106static nokprobe_inline bool trace_kprobe_within_module(struct trace_kprobe *tk,106static nokprobe_inline bool trace_kprobe_within_module(struct trace_kprobe *tk,
107 struct module *mod)107 struct module *mod)
108{108{
109 int len = strlen(mod->name);109 int len = strlen(module_name(mod));
110 const char *name = trace_kprobe_symbol(tk);110 const char *name = trace_kprobe_symbol(tk);
111 return strncmp(mod->name, name, len) == 0 && name[len] == ':';111
112 return strncmp(module_name(mod), name, len) == 0 && name[len] == ':';
112}113}
113 114
114static nokprobe_inline bool trace_kprobe_module_exist(struct trace_kprobe *tk)115static nokprobe_inline bool trace_kprobe_module_exist(struct trace_kprobe *tk)
@@ -688,7 +689,7 @@ static int trace_kprobe_module_callback(struct notifier_block *nb, · 573 unmodified lines
688 if (ret)689 if (ret)
689 pr_warn("Failed to re-register probe %s on %s: %d\n",690 pr_warn("Failed to re-register probe %s on %s: %d\n",
690 trace_probe_name(&tk->tp),691 trace_probe_name(&tk->tp),
691 mod->name, ret);692 module_name(mod), ret);
692 }693 }
693 }694 }
694 mutex_unlock(&event_mutex);695 mutex_unlock(&event_mutex);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t