From 53cf78343dceb13838c362558d5c05f699f7de68 Mon Sep 17 00:00:00 2001
From: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Date: Fri, 16 Nov 2018 16:03:04 -0500
Subject: [PATCH] [PATCH] x86_64: fix an unnecessary message with --mem-usage
option
commit bc8b3bbf ("arm64: restore info->page_offset and implement
paddr_to_vaddr_arm64()") added get_phys_base() to show_mem_usage(),
but at this time there is no vmcoreinfo yet, so get_phys_base_x86_64()
executes SYMBOL_INIT() and prints the following message.
# makedumpfile --mem-usage /proc/kcore
init_dwarf_info: Can't find absolute path to debuginfo file.
...
This patch adds the check if vmlinux is specified, and suppress the
message.
Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
---
arch/x86_64.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/makedumpfile-1.6.4/arch/x86_64.c b/makedumpfile-1.6.4/arch/x86_64.c
index 2b3c0bb356a1..a0d45b279cd9 100644
--- a/makedumpfile-1.6.4/arch/x86_64.c
+++ b/makedumpfile-1.6.4/arch/x86_64.c
@@ -87,7 +87,7 @@ get_page_offset_x86_64(void)
unsigned long long virt_start;
unsigned long page_offset_base;
- if (info->kaslr_offset && (info->fd_vmlinux != -1)) {
+ if (info->kaslr_offset && info->name_vmlinux) {
page_offset_base = get_symbol_addr("page_offset_base");
page_offset_base += info->kaslr_offset;
if (!readmem(VADDR, page_offset_base, &info->page_offset,
@@ -139,7 +139,7 @@ get_phys_base_x86_64(void)
}
/* linux-2.6.21 or older don't have phys_base, should be set to 0. */
- if (!has_vmcoreinfo()) {
+ if (!has_vmcoreinfo() && info->name_vmlinux) {
SYMBOL_INIT(phys_base, "phys_base");
if (SYMBOL(phys_base) == NOT_FOUND_SYMBOL) {
return TRUE;
--
2.7.4