Re: [PATCH v2] PM-Trace: add pm-trace support for suspending phase

From: Rafael J. Wysocki
Date: Wed Feb 18 2015 - 01:51:07 EST


On Sunday, February 15, 2015 10:24:07 AM Fu, Zhonghui wrote:
> Occasionally, the system can't come back up after suspend/resume
> due to problems of device suspending phase. This patch make
> PM_TRACE infrastructure cover device suspending phase of
> suspend/resume process, and the information in RTC can tell
> developers which device suspending function make system hang.
>
> Signed-off-by: Zhonghui Fu <zhonghui.fu@xxxxxxxxxxxxxxx>
> ---
> Changes in v2:
> - Add -M option so that the rename and changes can be reviewed much easier.
>
> arch/x86/include/asm/pm-trace.h | 36 ++++++++++++++++++++++++++
> arch/x86/include/asm/resume-trace.h | 21 ---------------
> drivers/base/power/main.c | 20 +++++++++++---
> drivers/base/power/trace.c | 6 ++--
> include/linux/{resume-trace.h => pm-trace.h} | 9 +++---
> kernel/power/main.c | 2 +-
> 6 files changed, 61 insertions(+), 33 deletions(-)
> create mode 100644 arch/x86/include/asm/pm-trace.h
> delete mode 100644 arch/x86/include/asm/resume-trace.h
> rename include/linux/{resume-trace.h => pm-trace.h} (75%)
>
> diff --git a/arch/x86/include/asm/pm-trace.h b/arch/x86/include/asm/pm-trace.h
> new file mode 100644
> index 0000000..09bd918
> --- /dev/null
> +++ b/arch/x86/include/asm/pm-trace.h
> @@ -0,0 +1,36 @@
> +#ifndef _ASM_X86_PM_TRACE_H
> +#define _ASM_X86_PM_TRACE_H
> +
> +#include <asm/asm.h>
> +
> +#define TRACE_RESUME(user) \
> +do { \
> + if (pm_trace_enabled) { \
> + const void *tracedata; \
> + asm volatile(_ASM_MOV " $1f,%0\n" \
> + ".section .tracedata,\"a\"\n" \
> + "1:\t.word %c1\n\t" \
> + _ASM_PTR " %c2\n" \
> + ".previous" \
> + :"=r" (tracedata) \
> + : "i" (__LINE__), "i" (__FILE__)); \
> + generate_pm_trace(tracedata, user); \
> + } \
> +} while (0)
> +
> +#define TRACE_SUSPEND(user) \
> +do { \
> + if (pm_trace_enabled) { \
> + const void *tracedata; \
> + asm volatile(_ASM_MOV " $1f,%0\n" \
> + ".section .tracedata,\"a\"\n" \
> + "1:\t.word %c1\n\t" \
> + _ASM_PTR " %c2\n" \
> + ".previous" \
> + :"=r" (tracedata) \
> + : "i" (__LINE__), "i" (__FILE__)); \
> + generate_pm_trace(tracedata, user); \
> + } \
> +} while (0)

Are those macros identical or am I missing anything?

If they are identical, why do we need two identical macros?


--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/