]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ftrace: Add comments to ftrace_hash_rec_disable/enable()
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 5 Jun 2024 18:03:37 +0000 (14:03 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 6 Jun 2024 19:21:25 +0000 (15:21 -0400)
Add comments to describe what the functions ftrace_hash_rec_disable() and
ftrace_hash_rec_enable() do. Also change the passing of the "inc" variable
to __ftrace_hash_rec_update() to a boolean value as that is what it is
supposed to take.

Link: https://lore.kernel.org/linux-trace-kernel/20240605180408.857333430@goodmis.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ftrace.c

index abcdffa4d5725336c38b7cd973bf4cd3c58e1145..4140d0ce25f1632d553c98a32eb22c9753dc9968 100644 (file)
@@ -1863,14 +1863,24 @@ static bool __ftrace_hash_rec_update(struct ftrace_ops *ops,
        return update;
 }
 
+/*
+ * This is called when an ops is removed from tracing. It will decrement
+ * the counters of the dyn_ftrace records for all the functions that
+ * the @ops attached to.
+ */
 static bool ftrace_hash_rec_disable(struct ftrace_ops *ops)
 {
-       return __ftrace_hash_rec_update(ops, 0);
+       return __ftrace_hash_rec_update(ops, false);
 }
 
+/*
+ * This is called when an ops is added to tracing. It will increment
+ * the counters of the dyn_ftrace records for all the functions that
+ * the @ops attached to.
+ */
 static bool ftrace_hash_rec_enable(struct ftrace_ops *ops)
 {
-       return __ftrace_hash_rec_update(ops, 1);
+       return __ftrace_hash_rec_update(ops, true);
 }
 
 static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops, int inc)