Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 058e297d authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt
Browse files

ftrace: Only update the function code on write to filter files



If function tracing is enabled, a read of the filter files will
cause the call to stop_machine to update the function trace sites.
It should only call stop_machine on write.

Cc: stable@kernel.org
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 2bce5dac
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -2413,13 +2413,15 @@ ftrace_regex_release(struct inode *inode, struct file *file, int enable)
		ftrace_match_records(parser->buffer, parser->idx, enable);
	}

	trace_parser_put(parser);
	kfree(iter);

	if (file->f_mode & FMODE_WRITE) {
		mutex_lock(&ftrace_lock);
		if (ftrace_start_up && ftrace_enabled)
			ftrace_run_update_code(FTRACE_ENABLE_CALLS);
		mutex_unlock(&ftrace_lock);

	trace_parser_put(parser);
	kfree(iter);
	}

	mutex_unlock(&ftrace_regex_lock);
	return 0;