Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Morse <james.morse@arm.com>
To: Geoff Levand <geoff@infradead.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	marc.zyngier@arm.com, Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v14 14/20] arm64/kexec: Add pr_debug output
Date: Fri, 11 Mar 2016 11:39:51 +0000	[thread overview]
Message-ID: <56E2AE87.4060209@arm.com> (raw)
In-Reply-To: <b11ec7d6be4debe94cd91c20d218f4015980d057.1457135058.git.geoff@infradead.org>

Hi Geoff,

On 04/03/16 23:51, Geoff Levand wrote:
> To aid in debugging kexec problems or when adding new functionality to kexec add
> a new routine kexec_image_info() and several inline pr_debug statements.
> 
> Signed-off-by: Geoff Levand <geoff@infradead.org>

[ ... snip ...]

> +/**
> + * kexec_image_info - For debugging output.
> + */
> +#define kexec_image_info(_i) _kexec_image_info(__func__, __LINE__, _i)
> +static void _kexec_image_info(const char *func, int line,
> +	const struct kimage *kimage)
> +{
> +	unsigned long i;
> +

> +#ifndef DEBUG
> +	return;
> +#endif

From include/linux/printk.h on pr_foo():
> * All of these will print unconditionally, although note that pr_debug()
> * and other debug macros are compiled out unless either DEBUG is defined

So you can remove the #ifdef ... return, as all the pr_debug() calls will be
removed by the compiler in this case. (which also explains why it doesn't
complain about unreachable code!)


> +	pr_debug("%s:%d:\n", func, line);
> +	pr_debug("  kexec kimage info:\n");
> +	pr_debug("    type:        %d\n", kimage->type);
> +	pr_debug("    start:       %lx\n", kimage->start);
> +	pr_debug("    head:        %lx\n", kimage->head);
> +	pr_debug("    nr_segments: %lu\n", kimage->nr_segments);
> +
> +	for (i = 0; i < kimage->nr_segments; i++) {
> +		pr_debug("      segment[%lu]: %016lx - %016lx, 0x%lx bytes, %lu pages%s\n",
> +			i,
> +			kimage->segment[i].mem,
> +			kimage->segment[i].mem + kimage->segment[i].memsz,
> +			kimage->segment[i].memsz,
> +			kimage->segment[i].memsz /  PAGE_SIZE,
> +			(kexec_is_dtb(kimage->segment[i].buf) ?
> +				", dtb segment" : ""));
> +	}
> +}
> +
>  void machine_kexec_cleanup(struct kimage *kimage)
>  {
>  	/* Empty routine needed to avoid build errors. */


Thanks,

James



_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2016-03-11 11:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04 23:51 [PATCH v14 00/20] arm64 kexec kernel patches v14 Geoff Levand
2016-03-04 23:51 ` [PATCH v14 03/20] arm64: Convert hcalls to use HVC immediate value Geoff Levand
2016-03-04 23:51 ` [PATCH v14 07/20] arm64: Promote KERNEL_START/KERNEL_END definitions to a header file Geoff Levand
2016-03-04 23:51 ` [PATCH v14 04/20] arm64: Add new hcall HVC_CALL_FUNC Geoff Levand
2016-03-04 23:51 ` [PATCH v14 08/20] arm64: Add new asm macro copy_page Geoff Levand
2016-03-04 23:51 ` [PATCH v14 12/20] arm64/kexec: Add core kexec support Geoff Levand
2016-03-11 11:37   ` James Morse
2016-03-04 23:51 ` [PATCH v14 06/20] arm64: kernel: Include _AC definition in page.h Geoff Levand
2016-03-04 23:51 ` [PATCH v14 11/20] Revert "arm64: remove dead code" Geoff Levand
2016-03-04 23:51 ` [PATCH v14 02/20] arm64: Cleanup SCTLR flags Geoff Levand
2016-03-04 23:51 ` [PATCH v14 09/20] arm64: Add back cpu_reset routines Geoff Levand
2016-03-04 23:51 ` [PATCH v14 05/20] arm64: kvm: allows kvm cpu hotplug Geoff Levand
2016-03-04 23:51 ` [PATCH v14 01/20] arm64: Fold proc-macros.S into assembler.h Geoff Levand
2016-03-04 23:51 ` [PATCH v14 10/20] Revert "arm64: mm: remove unused cpu_set_idmap_tcr_t0sz function" Geoff Levand
2016-03-04 23:51 ` [PATCH v14 15/20] arm64: kdump: reserve memory for crash dump kernel Geoff Levand
2016-03-04 23:51 ` [PATCH v14 14/20] arm64/kexec: Add pr_debug output Geoff Levand
2016-03-11 11:39   ` James Morse [this message]
2016-03-04 23:51 ` [PATCH v14 19/20] arm64: kdump: enable kdump in the arm64 defconfig Geoff Levand
2016-03-04 23:51 ` [PATCH v14 17/20] arm64: kdump: implement machine_crash_shutdown() Geoff Levand
2016-03-04 23:51 ` [PATCH v14 13/20] arm64/kexec: Enable kexec in the arm64 defconfig Geoff Levand
2016-03-04 23:51 ` [PATCH v14 18/20] arm64: kdump: add kdump support Geoff Levand
2016-03-04 23:51 ` [PATCH v14 20/20] arm64: kdump: update a kernel doc Geoff Levand
2016-03-04 23:51 ` [PATCH v14 16/20] arm64: limit memory regions based on DT property, usable-memory Geoff Levand
2016-03-07 22:25 ` [PATCH v14 00/20] arm64 kexec kernel patches v14 Azriel Samson
2016-03-07 23:35   ` Geoff Levand
2016-03-08  0:23     ` AKASHI Takahiro

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=56E2AE87.4060209@arm.com \
    --to=james.morse@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=geoff@infradead.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=takahiro.akashi@linaro.org \
    --cc=will.deacon@arm.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