Re: ftraced and suspend to ram

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ingo Molnar
Date: Thursday, August 21, 2008 - 9:46 pm

* Rafael J. Wysocki <rjw@sisk.pl> wrote:


makes sense - i've applied it to tip/tracing/urgent, see the tidied up 
commit below.

It should be no big issue not being able to trace across suspend+resume 
- and that restriction will go away with Steve's build-time based mcount 
patching mechanism in v2.6.28.

	Ingo

------------->
From 0e556695ddc8eebf6f6dd86bb0c4911b2b90c12a Mon Sep 17 00:00:00 2001
From: Rafael J. Wysocki <rjw@sisk.pl>
Date: Thu, 21 Aug 2008 21:59:36 +0200
Subject: [PATCH] ftrace: fix ftraced and suspend to ram

Steven Rostedt observed:


It will suffice to make it freezable, so that it doesn't run while the
system is suspending and resuming.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/trace/ftrace.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 639e16c..49f4c3f 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -819,8 +819,13 @@ static int ftraced(void *ignore)
 {
 	unsigned long usecs;
 
+	set_freezable();
+
 	while (!kthread_should_stop()) {
 
+		if (try_to_freeze())
+			continue;
+
 		set_current_state(TASK_INTERRUPTIBLE);
 
 		/* check once a second */
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ftraced and suspend to ram, Steven Rostedt, (Thu Aug 21, 8:49 am)
Re: ftraced and suspend to ram, Rafael J. Wysocki, (Thu Aug 21, 11:15 am)
Re: ftraced and suspend to ram, Steven Rostedt, (Thu Aug 21, 11:26 am)
Re: ftraced and suspend to ram, Rafael J. Wysocki, (Thu Aug 21, 11:37 am)
Re: ftraced and suspend to ram, Rafael J. Wysocki, (Thu Aug 21, 12:59 pm)
Re: ftraced and suspend to ram, Ingo Molnar, (Thu Aug 21, 9:46 pm)
Re: ftraced and suspend to ram, Pavel Machek, (Fri Aug 22, 12:23 am)
Re: ftraced and suspend to ram, Rafael J. Wysocki, (Fri Aug 22, 3:22 am)
Re: ftraced and suspend to ram, Marcin Slusarz, (Fri Aug 22, 3:35 am)
Re: ftraced and suspend to ram, Pavel Machek, (Fri Aug 22, 3:46 am)
Re: ftraced and suspend to ram, Rafael J. Wysocki, (Fri Aug 22, 9:39 am)
Re: ftraced and suspend to ram, Steven Rostedt, (Fri Aug 22, 1:33 pm)
Re: ftraced and suspend to ram, Rafael J. Wysocki, (Fri Aug 22, 1:52 pm)
Re: ftraced and suspend to ram, Marcin Slusarz, (Fri Aug 22, 1:54 pm)
Re: ftraced and suspend to ram, Steven Rostedt, (Fri Aug 22, 1:55 pm)
Re: ftraced and suspend to ram, Rafael J. Wysocki, (Fri Aug 22, 2:11 pm)
Re: ftraced and suspend to ram, Rafael J. Wysocki, (Fri Aug 22, 2:17 pm)
[PATCH] ftrace: disable tracing for suspend to ram, Steven Rostedt, (Wed Aug 27, 6:14 am)
Re: [PATCH] ftrace: disable tracing for suspend to ram, Rafael J. Wysocki, (Wed Aug 27, 6:26 am)
Re: [PATCH] ftrace: disable tracing for suspend to ram, Marcin Slusarz, (Wed Aug 27, 2:27 pm)
Re: [PATCH] ftrace: disable tracing for suspend to ram, Pavel Machek, (Thu Aug 28, 12:28 am)
[PATCH] ftrace: disable tracing for hibernation, Rafael J. Wysocki, (Thu Aug 28, 5:39 am)
Re: [PATCH] ftrace: disable tracing for hibernation, Ingo Molnar, (Thu Aug 28, 5:42 am)
Re: [PATCH] ftrace: disable tracing for hibernation, Steven Rostedt, (Thu Aug 28, 5:44 am)
Re: [PATCH] ftrace: disable tracing for suspend to ram, Steven Rostedt, (Fri Aug 29, 6:43 am)
Re: [PATCH] ftrace: disable tracing for hibernation, Pavel Machek, (Fri Aug 29, 4:53 pm)