public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 4/4] ftrace: Add warning if tramp hash does not match nr_trampolines
Date: Fri, 25 Jul 2014 10:05:18 -0400	[thread overview]
Message-ID: <20140725140612.935514580@goodmis.org> (raw)
In-Reply-To: 20140725140514.377803118@goodmis.org

[-- Attachment #1: 0004-ftrace-Add-warning-if-tramp-hash-does-not-match-nr_t.patch --]
[-- Type: text/plain, Size: 833 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

After adding all the records to the tramp_hash, add a check that makes
sure that the number of records added matches the number of records
expected to match and do a WARN_ON and disable ftrace if they do
not match.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 6ef1989c2b2e..979bd8cb4349 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2226,6 +2226,9 @@ static int ftrace_save_ops_tramp_hash(struct ftrace_ops *ops)
 		}
 	} while_for_each_ftrace_rec();
 
+	/* The number of recs in the hash must match nr_trampolines */
+	FTRACE_WARN_ON(ops->tramp_hash->count != ops->nr_trampolines);
+
 	return 0;
 }
 
-- 
2.0.1



      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 ` [for-next][PATCH 1/4] ftrace: Rename ftrace_ops field from trampolines to nr_trampolines Steven Rostedt
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 ` Steven Rostedt [this message]

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.935514580@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