diff options
author | Vivek Goyal <vgoyal@in.ibm.com> | 2006-09-20 12:50:19 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2006-10-06 12:44:15 +0900 |
commit | 6256940a039cde5641e469d2e129c95d5196b7d3 (patch) | |
tree | 464fd4a5246fb840398e67357a822ebcfd62e138 | |
parent | c1349002068bda5deab1d485b22eecfb8a41d2c1 (diff) |
kexec-tools: x86_64 move debugging code under #ifdef DEBUG
o Put the debug code under #ifdef DEBUG instead of #if 0.
o This patch only takes care of x86_64 code. Rest of the arches can slowly
do similar modification.
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/arch/x86_64/crashdump-x86_64.c | 14 | ||||
-rw-r--r-- | kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 2 | ||||
-rw-r--r-- | kexec/arch/x86_64/kexec-x86_64.c | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/kexec/arch/x86_64/crashdump-x86_64.c b/kexec/arch/x86_64/crashdump-x86_64.c index d49fd88..e496485 100644 --- a/kexec/arch/x86_64/crashdump-x86_64.c +++ b/kexec/arch/x86_64/crashdump-x86_64.c @@ -88,7 +88,7 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges) if (count != 2) continue; str = line + consumed; -#if 0 +#ifdef DEBUG printf("%016Lx-%016Lx : %s", start, end, str); #endif @@ -142,7 +142,7 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges) return -1; *range = crash_memory_range; *ranges = memory_ranges; -#if 0 +#ifdef DEBUG int i; printf("CRASH MEMORY RANGES\n"); for(i = 0; i < memory_ranges; i++) { @@ -243,7 +243,7 @@ static int add_memmap(struct memory_range *memmap_p, unsigned long long addr, memmap_p[j+1] = memmap_p[j]; memmap_p[tidx].start = addr; memmap_p[tidx].end = addr + size - 1; -#if 0 +#ifdef DEBUG printf("Memmap after adding segment\n"); for (i = 0; i < CRASH_MAX_MEMMAP_NR; i++) { mstart = memmap_p[i].start; @@ -328,7 +328,7 @@ static int delete_memmap(struct memory_range *memmap_p, unsigned long long addr, memmap_p[j-1] = memmap_p[j]; memmap_p[j-1].start = memmap_p[j-1].end = 0; } -#if 0 +#ifdef DEBUG printf("Memmap after deleting segment\n"); for (i = 0; i < CRASH_MAX_MEMMAP_NR; i++) { mstart = memmap_p[i].start; @@ -402,7 +402,7 @@ static int cmdline_add_memmap(char *cmdline, struct memory_range *memmap_p) die("Command line overflow\n"); strcat(cmdline, str_mmap); } -#if 0 +#ifdef DEBUG printf("Command line after adding memmap\n"); printf("%s\n", cmdline); #endif @@ -430,7 +430,7 @@ static int cmdline_add_elfcorehdr(char *cmdline, unsigned long addr) if (cmdlen > (COMMAND_LINE_SIZE - 1)) die("Command line overflow\n"); strcat(cmdline, str); -#if 0 +#ifdef DEBUG printf("Command line after adding elfcorehdr\n"); printf("%s\n", cmdline); #endif @@ -463,7 +463,7 @@ static int cmdline_add_memmap_acpi(char *cmdline, unsigned long start, die("Command line overflow\n"); strcat(cmdline, str_mmap); -#if 0 +#ifdef DEBUG printf("Command line after adding acpi memmap\n"); printf("%s\n", cmdline); #endif diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c index afcb171..16b32a2 100644 --- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c +++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c @@ -60,7 +60,7 @@ static const char *reloc_name(unsigned long r_type) void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type, void *location, unsigned long address, unsigned long value) { -#if 0 +#ifdef DEBUG fprintf(stderr, "%s\n", reloc_name(r_type)); #endif switch(r_type) { diff --git a/kexec/arch/x86_64/kexec-x86_64.c b/kexec/arch/x86_64/kexec-x86_64.c index fbef9e7..528cd8a 100644 --- a/kexec/arch/x86_64/kexec-x86_64.c +++ b/kexec/arch/x86_64/kexec-x86_64.c @@ -64,7 +64,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges, continue; str = line + consumed; end = end + 1; -#if 0 +#ifdef DEBUG printf("%016Lx-%016Lx : %s", start, end, str); #endif @@ -104,7 +104,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges, memory_range[memory_ranges].start = start; memory_range[memory_ranges].end = end; memory_range[memory_ranges].type = type; -#if 0 +#ifdef DEBUG printf("%016Lx-%016Lx : %x\n", start, end, type); #endif |