From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Oleg Nesterov <oleg@redhat.com>
Subject: [for-next][PATCH 1/4] ftrace: Rename ftrace_ops field from trampolines to nr_trampolines
Date: Fri, 25 Jul 2014 10:05:15 -0400 [thread overview]
Message-ID: <20140725140612.497746850@goodmis.org> (raw)
In-Reply-To: 20140725140514.377803118@goodmis.org
[-- Attachment #1: 0001-ftrace-Rename-ftrace_ops-field-from-trampolines-to-n.patch --]
[-- Type: text/plain, Size: 2433 bytes --]
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
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>
---
include/linux/ftrace.h | 2 +-
kernel/trace/ftrace.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 7a5b7b97e539..6bb5e3f2a3b4 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -120,7 +120,7 @@ struct ftrace_ops {
void *private;
int __percpu *disabled;
#ifdef CONFIG_DYNAMIC_FTRACE
- int trampolines;
+ int nr_trampolines;
struct ftrace_hash *notrace_hash;
struct ftrace_hash *filter_hash;
struct ftrace_hash *tramp_hash;
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 762806026561..eda69c9f78d0 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1513,7 +1513,7 @@ static void ftrace_remove_tramp(struct ftrace_ops *ops,
* The tramp_hash entry will be removed at time
* of update.
*/
- ops->trampolines--;
+ ops->nr_trampolines--;
rec->flags &= ~FTRACE_FL_TRAMP;
}
@@ -1522,7 +1522,7 @@ static void ftrace_clear_tramps(struct dyn_ftrace *rec)
struct ftrace_ops *op;
do_for_each_ftrace_op(op, ftrace_ops_list) {
- if (op->trampolines)
+ if (op->nr_trampolines)
ftrace_remove_tramp(op, rec);
} 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) {
rec->flags |= FTRACE_FL_TRAMP;
- ops->trampolines++;
+ ops->nr_trampolines++;
} else {
/*
* 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 ret;
- size = ops->trampolines;
+ size = ops->nr_trampolines;
bits = 0;
/*
* 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);
op->tramp_hash = NULL;
- if (op->trampolines) {
+ if (op->nr_trampolines) {
ret = ftrace_save_ops_tramp_hash(op);
if (ret)
return ret;
--
2.0.1
next prev parent reply other threads:[~2014-07-25 14:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 14:05 [for-next][PATCH 0/4] ftrace: Fix the tramp count accounting Steven Rostedt
2014-07-25 14:05 ` Steven Rostedt [this message]
2014-07-25 14:05 ` [for-next][PATCH 2/4] ring-buffer: Use rb_page_size() instead of open coded head_page size Steven Rostedt
2014-07-25 14:05 ` [for-next][PATCH 3/4] ftrace: Fix trampoline hash update check on rec->flags Steven Rostedt
2014-07-25 14:05 ` [for-next][PATCH 4/4] ftrace: Add warning if tramp hash does not match nr_trampolines Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140725140612.497746850@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox