Skip to content

Commit 1a88c07

Browse files
committed
ftrace: Convert "inc" parameter to bool in ftrace_hash_rec_update_modify()
The parameter "inc" in the function ftrace_hash_rec_update_modify() is boolean. Change it to be such. Also add documentation to what the function does. Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Acked-by: Mark Rutland <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent da73f6d commit 1a88c07

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

kernel/trace/ftrace.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,24 @@ static bool ftrace_hash_rec_enable(struct ftrace_ops *ops)
18831883
return __ftrace_hash_rec_update(ops, true);
18841884
}
18851885

1886-
static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops, int inc)
1886+
/*
1887+
* This function will update what functions @ops traces when its filter
1888+
* changes.
1889+
*
1890+
* The @inc states if the @ops callbacks are going to be added or removed.
1891+
* When one of the @ops hashes are updated to a "new_hash" the dyn_ftrace
1892+
* records are update via:
1893+
*
1894+
* ftrace_hash_rec_disable_modify(ops);
1895+
* ops->hash = new_hash
1896+
* ftrace_hash_rec_enable_modify(ops);
1897+
*
1898+
* Where the @ops is removed from all the records it is tracing using
1899+
* its old hash. The @ops hash is updated to the new hash, and then
1900+
* the @ops is added back to the records so that it is tracing all
1901+
* the new functions.
1902+
*/
1903+
static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops, bool inc)
18871904
{
18881905
struct ftrace_ops *op;
18891906

@@ -1907,12 +1924,12 @@ static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops, int inc)
19071924

19081925
static void ftrace_hash_rec_disable_modify(struct ftrace_ops *ops)
19091926
{
1910-
ftrace_hash_rec_update_modify(ops, 0);
1927+
ftrace_hash_rec_update_modify(ops, false);
19111928
}
19121929

19131930
static void ftrace_hash_rec_enable_modify(struct ftrace_ops *ops)
19141931
{
1915-
ftrace_hash_rec_update_modify(ops, 1);
1932+
ftrace_hash_rec_update_modify(ops, true);
19161933
}
19171934

19181935
/*

0 commit comments

Comments
 (0)