mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
tracepoint: Do not waste memory on mods with no tracepoints
No reason to allocate tp_module structures for modules that have no
tracepoints. This just wastes memory.
Fixes: b75ef8b44b
"Tracepoint: Dissociate from module mutex"
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
12729f14d8
commit
7dec935a3a
1 changed files with 6 additions and 0 deletions
|
@ -636,6 +636,9 @@ static int tracepoint_module_coming(struct module *mod)
|
||||||
struct tp_module *tp_mod, *iter;
|
struct tp_module *tp_mod, *iter;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
if (!mod->num_tracepoints)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We skip modules that taint the kernel, especially those with different
|
* We skip modules that taint the kernel, especially those with different
|
||||||
* module headers (for forced load), to make sure we don't cause a crash.
|
* module headers (for forced load), to make sure we don't cause a crash.
|
||||||
|
@ -679,6 +682,9 @@ static int tracepoint_module_going(struct module *mod)
|
||||||
{
|
{
|
||||||
struct tp_module *pos;
|
struct tp_module *pos;
|
||||||
|
|
||||||
|
if (!mod->num_tracepoints)
|
||||||
|
return 0;
|
||||||
|
|
||||||
mutex_lock(&tracepoints_mutex);
|
mutex_lock(&tracepoints_mutex);
|
||||||
tracepoint_update_probe_range(mod->tracepoints_ptrs,
|
tracepoint_update_probe_range(mod->tracepoints_ptrs,
|
||||||
mod->tracepoints_ptrs + mod->num_tracepoints);
|
mod->tracepoints_ptrs + mod->num_tracepoints);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue