Commit 0162d621ddf3bd02bf7de324dcf002d9c84c5059

Authored by Steven Rostedt (Red Hat)
Committed by Steven Rostedt
1 parent ba1afef6a4

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>

Showing 2 changed files with 6 additions and 6 deletions Side-by-side Diff

include/linux/ftrace.h
... ... @@ -120,7 +120,7 @@
120 120 void *private;
121 121 int __percpu *disabled;
122 122 #ifdef CONFIG_DYNAMIC_FTRACE
123   - int trampolines;
  123 + int nr_trampolines;
124 124 struct ftrace_hash *notrace_hash;
125 125 struct ftrace_hash *filter_hash;
126 126 struct ftrace_hash *tramp_hash;
kernel/trace/ftrace.c
... ... @@ -1513,7 +1513,7 @@
1513 1513 * The tramp_hash entry will be removed at time
1514 1514 * of update.
1515 1515 */
1516   - ops->trampolines--;
  1516 + ops->nr_trampolines--;
1517 1517 rec->flags &= ~FTRACE_FL_TRAMP;
1518 1518 }
1519 1519  
... ... @@ -1522,7 +1522,7 @@
1522 1522 struct ftrace_ops *op;
1523 1523  
1524 1524 do_for_each_ftrace_op(op, ftrace_ops_list) {
1525   - if (op->trampolines)
  1525 + if (op->nr_trampolines)
1526 1526 ftrace_remove_tramp(op, rec);
1527 1527 } while_for_each_ftrace_op(op);
1528 1528 }
... ... @@ -1617,7 +1617,7 @@
1617 1617 */
1618 1618 if (ftrace_rec_count(rec) == 1 && ops->trampoline) {
1619 1619 rec->flags |= FTRACE_FL_TRAMP;
1620   - ops->trampolines++;
  1620 + ops->nr_trampolines++;
1621 1621 } else {
1622 1622 /*
1623 1623 * If we are adding another function callback
... ... @@ -2185,7 +2185,7 @@
2185 2185 int size, bits;
2186 2186 int ret;
2187 2187  
2188   - size = ops->trampolines;
  2188 + size = ops->nr_trampolines;
2189 2189 bits = 0;
2190 2190 /*
2191 2191 * Make the hash size about 1/2 the # found
... ... @@ -2239,7 +2239,7 @@
2239 2239 free_ftrace_hash(op->tramp_hash);
2240 2240 op->tramp_hash = NULL;
2241 2241  
2242   - if (op->trampolines) {
  2242 + if (op->nr_trampolines) {
2243 2243 ret = ftrace_save_ops_tramp_hash(op);
2244 2244 if (ret)
2245 2245 return ret;