ftrace: Rename ftrace_ops field from trampolines to nr_trampolines
Having two fields within the same struct that is off by one character can be confusing and error prone. Rename the counter "trampolines" to "nr_trampolines" to explicitly show it is a counter and not to be confused by the "trampoline" field. Suggested-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
ba1afef6a4
commit
0162d621dd
@ -120,7 +120,7 @@ struct ftrace_ops {
|
|||||||
void *private;
|
void *private;
|
||||||
int __percpu *disabled;
|
int __percpu *disabled;
|
||||||
#ifdef CONFIG_DYNAMIC_FTRACE
|
#ifdef CONFIG_DYNAMIC_FTRACE
|
||||||
int trampolines;
|
int nr_trampolines;
|
||||||
struct ftrace_hash *notrace_hash;
|
struct ftrace_hash *notrace_hash;
|
||||||
struct ftrace_hash *filter_hash;
|
struct ftrace_hash *filter_hash;
|
||||||
struct ftrace_hash *tramp_hash;
|
struct ftrace_hash *tramp_hash;
|
||||||
|
@ -1513,7 +1513,7 @@ static void ftrace_remove_tramp(struct ftrace_ops *ops,
|
|||||||
* The tramp_hash entry will be removed at time
|
* The tramp_hash entry will be removed at time
|
||||||
* of update.
|
* of update.
|
||||||
*/
|
*/
|
||||||
ops->trampolines--;
|
ops->nr_trampolines--;
|
||||||
rec->flags &= ~FTRACE_FL_TRAMP;
|
rec->flags &= ~FTRACE_FL_TRAMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1522,7 +1522,7 @@ static void ftrace_clear_tramps(struct dyn_ftrace *rec)
|
|||||||
struct ftrace_ops *op;
|
struct ftrace_ops *op;
|
||||||
|
|
||||||
do_for_each_ftrace_op(op, ftrace_ops_list) {
|
do_for_each_ftrace_op(op, ftrace_ops_list) {
|
||||||
if (op->trampolines)
|
if (op->nr_trampolines)
|
||||||
ftrace_remove_tramp(op, rec);
|
ftrace_remove_tramp(op, rec);
|
||||||
} while_for_each_ftrace_op(op);
|
} while_for_each_ftrace_op(op);
|
||||||
}
|
}
|
||||||
@ -1617,7 +1617,7 @@ static void __ftrace_hash_rec_update(struct ftrace_ops *ops,
|
|||||||
*/
|
*/
|
||||||
if (ftrace_rec_count(rec) == 1 && ops->trampoline) {
|
if (ftrace_rec_count(rec) == 1 && ops->trampoline) {
|
||||||
rec->flags |= FTRACE_FL_TRAMP;
|
rec->flags |= FTRACE_FL_TRAMP;
|
||||||
ops->trampolines++;
|
ops->nr_trampolines++;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* If we are adding another function callback
|
* If we are adding another function callback
|
||||||
@ -2185,7 +2185,7 @@ static int ftrace_save_ops_tramp_hash(struct ftrace_ops *ops)
|
|||||||
int size, bits;
|
int size, bits;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
size = ops->trampolines;
|
size = ops->nr_trampolines;
|
||||||
bits = 0;
|
bits = 0;
|
||||||
/*
|
/*
|
||||||
* Make the hash size about 1/2 the # found
|
* Make the hash size about 1/2 the # found
|
||||||
@ -2239,7 +2239,7 @@ static int ftrace_save_tramp_hashes(void)
|
|||||||
free_ftrace_hash(op->tramp_hash);
|
free_ftrace_hash(op->tramp_hash);
|
||||||
op->tramp_hash = NULL;
|
op->tramp_hash = NULL;
|
||||||
|
|
||||||
if (op->trampolines) {
|
if (op->nr_trampolines) {
|
||||||
ret = ftrace_save_ops_tramp_hash(op);
|
ret = ftrace_save_ops_tramp_hash(op);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user