diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2012-03-08 14:39:38 +0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2012-03-15 15:09:41 +0900 |
commit | 28d4ab53280853d2aeefdfb7c369331e89ab9ac2 (patch) | |
tree | c4dcab7622680c57bfc499c36b9271335ffea45e /kexec/crashdump.c | |
parent | f1facd4b11aa141ffd9bbacb2631ad18dc33669c (diff) |
Add generic debug option
Currently the debugging code is under #ifdef DEBUG, which
means when we want to debug, we have to re-compile the source
code with -DDEBUG. This is not convenient, we want to have
a generic --debug option so that we can enable debugging code
without re-compiling.
This patch moves the arch-specific --debug to generic place
and moves code under #ifdef DEBUG to --debug on x86.
BTW, the size of kexec binary increases very little after this patch.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/crashdump.c')
-rw-r--r-- | kexec/crashdump.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kexec/crashdump.c b/kexec/crashdump.c index 847d080..cdd3ef6 100644 --- a/kexec/crashdump.c +++ b/kexec/crashdump.c @@ -102,9 +102,8 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len) die("Cannot parse %s: %s\n", crash_notes, strerror(errno)); *addr = (uint64_t) temp; *len = MAX_NOTE_BYTES; /* we should get this from the kernel instead */ -#ifdef DEBUG - printf("%s: crash_notes addr = %Lx\n", __FUNCTION__, *addr); -#endif + + dbgprintf("%s: crash_notes addr = %Lx\n", __FUNCTION__, *addr); fclose(fp); return 0; |