Skip to content

Commit da73f6d

Browse files
committed
ftrace: Add comments to ftrace_hash_rec_disable/enable()
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/[email protected] Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Acked-by: Mark Rutland <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 07bbe08 commit da73f6d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

kernel/trace/ftrace.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,14 +1863,24 @@ static bool __ftrace_hash_rec_update(struct ftrace_ops *ops,
18631863
return update;
18641864
}
18651865

1866+
/*
1867+
* This is called when an ops is removed from tracing. It will decrement
1868+
* the counters of the dyn_ftrace records for all the functions that
1869+
* the @ops attached to.
1870+
*/
18661871
static bool ftrace_hash_rec_disable(struct ftrace_ops *ops)
18671872
{
1868-
return __ftrace_hash_rec_update(ops, 0);
1873+
return __ftrace_hash_rec_update(ops, false);
18691874
}
18701875

1876+
/*
1877+
* This is called when an ops is added to tracing. It will increment
1878+
* the counters of the dyn_ftrace records for all the functions that
1879+
* the @ops attached to.
1880+
*/
18711881
static bool ftrace_hash_rec_enable(struct ftrace_ops *ops)
18721882
{
1873-
return __ftrace_hash_rec_update(ops, 1);
1883+
return __ftrace_hash_rec_update(ops, true);
18741884
}
18751885

18761886
static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops, int inc)

0 commit comments

Comments
 (0)