mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter Teoh" <htmldeveloper@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	"Steven Rostedt" <srostedt@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing: allow tracing of suspend/resume & hibernation code again
Date: Sun, 23 Nov 2008 23:37:49 +0800	[thread overview]
Message-ID: <804dabb00811230737g4c958ca1p74b661faabfece0b@mail.gmail.com> (raw)
In-Reply-To: <20081123094124.GO30453@elte.hu>

Thanks Ingo,

I applied the patch (manually) agains Linus's git:

git describe
v2.6.28-rc6-7-ged31348

Previously, before the patch, I had no problem resuming - for
v2.6.28-rc6.   Now after s2ram, it cannot resume properly - nothing is
displayed.   And I had not applied any changes to ftrace's
/debug/tracing files yet.

Let me test it out again.   Thanks.   (I am on FC7).

On Sun, Nov 23, 2008 at 5:41 PM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Rafael J. Wysocki <rjw@sisk.pl> wrote:
>
>> > Q2: how to ftrace s2ram and resume?  I attempted to do it, but the
>> > trace output is always filled with "resume" related functions when
>> > it started up, which is only logical.
>>
>> The tracing is disabled during suspend/resume, so you can't.
>
> i think we could lift this restriction now that dftrace is gone for
> good - which was causing most of the trouble.
>
>  41108eb10142e0552f2de1e4c0675b108c5f018f
>  f42ac38c59e0a03d6da0c24a63fb211393f484b0
>
> Completely untested patch below. Peter, does it work for you?
>
>        Ingo
>
> ------------------->
> From 3134c953216111a35d17f77b784e5d1fa2ba36d5 Mon Sep 17 00:00:00 2001
> From: Ingo Molnar <mingo@elte.hu>
> Date: Sun, 23 Nov 2008 10:37:12 +0100
> Subject: [PATCH] tracing: allow tracing of suspend/resume & hibernation code again:
>
> Now that the ftrace kernel thread is gone, we can allow tracing
> during suspend/resume again.
>
> So revert these two commits:
>
>  f42ac38c5 "ftrace: disable tracing for suspend to ram"
>  41108eb10 "ftrace: disable tracing for hibernation"
>
> This should be tested very carefully, as it could interact with
> altneratives instruction patching, etc.
>
> Not-Yet-Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
>  kernel/power/disk.c |   13 +++----------
>  kernel/power/main.c |    5 +----
>  2 files changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/kernel/power/disk.c b/kernel/power/disk.c
> index c9d7408..f77d381 100644
> --- a/kernel/power/disk.c
> +++ b/kernel/power/disk.c
> @@ -22,7 +22,6 @@
>  #include <linux/console.h>
>  #include <linux/cpu.h>
>  #include <linux/freezer.h>
> -#include <linux/ftrace.h>
>
>  #include "power.h"
>
> @@ -257,7 +256,7 @@ static int create_image(int platform_mode)
>
>  int hibernation_snapshot(int platform_mode)
>  {
> -       int error, ftrace_save;
> +       int error;
>
>        /* Free memory before shutting down devices. */
>        error = swsusp_shrink_memory();
> @@ -269,7 +268,6 @@ int hibernation_snapshot(int platform_mode)
>                goto Close;
>
>        suspend_console();
> -       ftrace_save = __ftrace_enabled_save();
>        error = device_suspend(PMSG_FREEZE);
>        if (error)
>                goto Recover_platform;
> @@ -299,7 +297,6 @@ int hibernation_snapshot(int platform_mode)
>  Resume_devices:
>        device_resume(in_suspend ?
>                (error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
> -       __ftrace_enabled_restore(ftrace_save);
>        resume_console();
>  Close:
>        platform_end(platform_mode);
> @@ -370,11 +367,10 @@ static int resume_target_kernel(void)
>
>  int hibernation_restore(int platform_mode)
>  {
> -       int error, ftrace_save;
> +       int error;
>
>        pm_prepare_console();
>        suspend_console();
> -       ftrace_save = __ftrace_enabled_save();
>        error = device_suspend(PMSG_QUIESCE);
>        if (error)
>                goto Finish;
> @@ -389,7 +385,6 @@ int hibernation_restore(int platform_mode)
>        platform_restore_cleanup(platform_mode);
>        device_resume(PMSG_RECOVER);
>  Finish:
> -       __ftrace_enabled_restore(ftrace_save);
>        resume_console();
>        pm_restore_console();
>        return error;
> @@ -402,7 +397,7 @@ int hibernation_restore(int platform_mode)
>
>  int hibernation_platform_enter(void)
>  {
> -       int error, ftrace_save;
> +       int error;
>
>        if (!hibernation_ops)
>                return -ENOSYS;
> @@ -417,7 +412,6 @@ int hibernation_platform_enter(void)
>                goto Close;
>
>        suspend_console();
> -       ftrace_save = __ftrace_enabled_save();
>        error = device_suspend(PMSG_HIBERNATE);
>        if (error) {
>                if (hibernation_ops->recover)
> @@ -452,7 +446,6 @@ int hibernation_platform_enter(void)
>        hibernation_ops->finish();
>  Resume_devices:
>        device_resume(PMSG_RESTORE);
> -       __ftrace_enabled_restore(ftrace_save);
>        resume_console();
>  Close:
>        hibernation_ops->end();
> diff --git a/kernel/power/main.c b/kernel/power/main.c
> index eaa122b..142e005 100644
> --- a/kernel/power/main.c
> +++ b/kernel/power/main.c
> @@ -22,7 +22,6 @@
>  #include <linux/freezer.h>
>  #include <linux/vmstat.h>
>  #include <linux/syscalls.h>
> -#include <linux/ftrace.h>
>
>  #include "power.h"
>
> @@ -321,7 +320,7 @@ static int suspend_enter(suspend_state_t state)
>  */
>  int suspend_devices_and_enter(suspend_state_t state)
>  {
> -       int error, ftrace_save;
> +       int error;
>
>        if (!suspend_ops)
>                return -ENOSYS;
> @@ -332,7 +331,6 @@ int suspend_devices_and_enter(suspend_state_t state)
>                        goto Close;
>        }
>        suspend_console();
> -       ftrace_save = __ftrace_enabled_save();
>        suspend_test_start();
>        error = device_suspend(PMSG_SUSPEND);
>        if (error) {
> @@ -364,7 +362,6 @@ int suspend_devices_and_enter(suspend_state_t state)
>        suspend_test_start();
>        device_resume(PMSG_RESUME);
>        suspend_test_finish("resume devices");
> -       __ftrace_enabled_restore(ftrace_save);
>        resume_console();
>  Close:
>        if (suspend_ops->end)
>



-- 
Regards,
Peter Teoh

  reply	other threads:[~2008-11-23 15:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-22  8:47 Some FTRACE related question Peter Teoh
2008-11-22 12:59 ` Rafael J. Wysocki
2008-11-23  9:41   ` [PATCH] tracing: allow tracing of suspend/resume & hibernation code again Ingo Molnar
2008-11-23 15:37     ` Peter Teoh [this message]
2008-11-24 15:47       ` Peter Teoh
2008-12-10  3:09         ` Peter Teoh
2008-11-24 21:43     ` Steven Rostedt
2008-11-22 13:30 ` Some FTRACE related question 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=804dabb00811230737g4c958ca1p74b661faabfece0b@mail.gmail.com \
    --to=htmldeveloper@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rjw@sisk.pl \
    --cc=srostedt@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

all inboxes | Powered by JetHome®