All of lore.kernel.org
 help / color / mirror / Atom feed
* [for-nex][PATCH 0/2] ftrace: Therapy updates
@ 2014-09-13 14:49 Steven Rostedt
  2014-09-13 14:49 ` [for-nex][PATCH 1/2] ftrace: Add sanity check when unregistering last ftrace_ops Steven Rostedt
  2014-09-13 14:49 ` [for-nex][PATCH 2/2] ftrace: Only disable ftrace_enabled to test buffer in selftest Steven Rostedt
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2014-09-13 14:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Clark Williams


What? Me working? Um, no! This is just, um, my physical therapy. Yeah,
that's it. Part of my therapy is to stare at a monitor and randomly
raise and lower my fingers on top of a keyboard.

Alright, alright, you caught me  :-p  Please don't tell my wife!!!!

(me cleaning things up for more work to come, when I'm better)

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
for-next

Head SHA1: 3ddee63a099ebbdc8f84697fe46730b58240c09d


Steven Rostedt (Red Hat) (2):
      ftrace: Add sanity check when unregistering last ftrace_ops
      ftrace: Only disable ftrace_enabled to test buffer in selftest

----
 kernel/trace/ftrace.c         | 15 +++++++++++++++
 kernel/trace/trace_selftest.c |  4 ++++
 2 files changed, 19 insertions(+)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [for-nex][PATCH 1/2] ftrace: Add sanity check when unregistering last ftrace_ops
  2014-09-13 14:49 [for-nex][PATCH 0/2] ftrace: Therapy updates Steven Rostedt
@ 2014-09-13 14:49 ` Steven Rostedt
  2014-09-13 14:49 ` [for-nex][PATCH 2/2] ftrace: Only disable ftrace_enabled to test buffer in selftest Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2014-09-13 14:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Clark Williams

[-- Attachment #1: 0001-ftrace-Add-sanity-check-when-unregistering-last-ftra.patch --]
[-- Type: text/plain, Size: 1146 bytes --]

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

When the last ftrace_ops is unregistered, all the function records should
have a zeroed flags value. Make sure that is the case when the last ftrace_ops
is unregistered.

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

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index d325a1e76554..fb186b9ddf51 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2416,6 +2416,21 @@ static int ftrace_shutdown(struct ftrace_ops *ops, int command)
 
 	ftrace_run_update_code(command);
 
+	/*
+	 * If there's no more ops registered with ftrace, run a
+	 * sanity check to make sure all rec flags are cleared.
+	 */
+	if (ftrace_ops_list == &ftrace_list_end) {
+		struct ftrace_page *pg;
+		struct dyn_ftrace *rec;
+
+		do_for_each_ftrace_rec(pg, rec) {
+			if (FTRACE_WARN_ON_ONCE(rec->flags))
+				pr_warn("  %pS flags:%lx\n",
+					(void *)rec->ip, rec->flags);
+		} while_for_each_ftrace_rec();
+	}
+
 	ops->old_hash.filter_hash = NULL;
 	ops->old_hash.notrace_hash = NULL;
 
-- 
2.0.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [for-nex][PATCH 2/2] ftrace: Only disable ftrace_enabled to test buffer in selftest
  2014-09-13 14:49 [for-nex][PATCH 0/2] ftrace: Therapy updates Steven Rostedt
  2014-09-13 14:49 ` [for-nex][PATCH 1/2] ftrace: Add sanity check when unregistering last ftrace_ops Steven Rostedt
@ 2014-09-13 14:49 ` Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2014-09-13 14:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Clark Williams

[-- Attachment #1: 0002-ftrace-Only-disable-ftrace_enabled-to-test-buffer-in.patch --]
[-- Type: text/plain, Size: 1259 bytes --]

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

The ftrace_enabled variable is set to zero in the self tests to keep
delayed functions from being traced and messing with the checks. This
only needs to be done when the checks are being performed, otherwise,
if ftrace_enabled is off when calls back to the utility that is being
tested, it can cause errors to happen and the tests can fail with
false positives.

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

diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index 5ef60499dc8e..61a6acd6025d 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -382,6 +382,8 @@ static int trace_selftest_startup_dynamic_tracing(struct tracer *trace,
 
 	/* check the trace buffer */
 	ret = trace_test_buffer(&tr->trace_buffer, &count);
+
+	ftrace_enabled = 1;
 	tracing_start();
 
 	/* we should only have one item */
@@ -679,6 +681,8 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr)
 
 	/* check the trace buffer */
 	ret = trace_test_buffer(&tr->trace_buffer, &count);
+
+	ftrace_enabled = 1;
 	trace->reset(tr);
 	tracing_start();
 
-- 
2.0.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-13 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-13 14:49 [for-nex][PATCH 0/2] ftrace: Therapy updates Steven Rostedt
2014-09-13 14:49 ` [for-nex][PATCH 1/2] ftrace: Add sanity check when unregistering last ftrace_ops Steven Rostedt
2014-09-13 14:49 ` [for-nex][PATCH 2/2] ftrace: Only disable ftrace_enabled to test buffer in selftest Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.