From patchwork Wed Sep 7 07:59:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9318477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A594601C0 for ; Wed, 7 Sep 2016 08:02:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72C272911D for ; Wed, 7 Sep 2016 08:02:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6748729122; Wed, 7 Sep 2016 08:02:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3C98A2911D for ; Wed, 7 Sep 2016 08:02:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhXm6-0006We-8X; Wed, 07 Sep 2016 08:00:02 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhXm5-00067J-EO for xen-devel@lists.xenproject.org; Wed, 07 Sep 2016 08:00:01 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id 95/30-03281-009CFC75; Wed, 07 Sep 2016 08:00:00 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRWlGSWpSXmKPExsXS6fjDS/f/ifP hBlN+K1p83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBl9d34yFaxexVix7NpypgbG6bVdjJwcQgJ5 Eo/mnWEDsXkF7CT+th1kBbElBAwlnr6/DhZnEVCVuNM1jRnEZhNQl2h7th2ohoNDRMBA4tzRp C5GLg5mgbVMEhdn3WUCqREWsJeYOrWPEaSGV0BQ4u8OYZAwM9D4ve9eMU1g5JqFkJmFJANha0 k8/HWLBcLWlli28DUzSDmzgLTE8n8cEGF7iVl9HYyoSkBsL4lZ5/axLGDkWMWoUZxaVJZapGt soJdUlJmeUZKbmJmja2hgrJebWlycmJ6ak5hUrJecn7uJERiA9QwMjDsYO0/4HWKU5GBSEuW1 OHY+XIgvKT+lMiOxOCO+qDQntfgQowwHh5IE797jQDnBotT01Iq0zBxgLMCkJTh4lER4n4Kke YsLEnOLM9MhUqcYFaXEebtAEgIgiYzSPLg2WPxdYpSVEuZlZGBgEOIpSC3KzSxBlX/FKM7BqC TM+xpkCk9mXgnc9FdAi5mAFq/bfRpkcUkiQkqqgTFC6s+nF7pX1KaUCk1QFFvxM9zvXAb72+B 8Z6u+O5EfUiN33Qtscm9a7fnrwuGpzxVfzduw98SEroeGndfZDjIe2Ko0d9PEDN11x8xeJmfx f/uzwGO5XYv0U7tn3zWdsv3cWvSKmrVqf3/4dF0g5E2p1MQ0Y6nKkOeBKkeZ/DjtNxXP7NJf5 6XEUpyRaKjFXFScCACm6uT7ugIAAA== X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1473235197!56146317!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18688 invoked from network); 7 Sep 2016 07:59:59 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 7 Sep 2016 07:59:59 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Wed, 07 Sep 2016 01:59:56 -0600 Message-Id: <57CFE51C020000780010C762@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.1 Date: Wed, 07 Sep 2016 01:59:56 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan Subject: [Xen-devel] [PATCH v2] libelf: drop pointless uses of __FUNCTION__ X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Non-debugging message text should be (and is in the cases here, albeit often only with the addition of an ELF: prefix) distinguishable without also logging function names. In the messages touched at once use %#x (or variants thereof) in favor of 0x%x. Acked-by: Ian Jackson Signed-off-by: Jan Beulich --- v2: Add a missing ELF: prefix. Further disambiguate note related messages. Also take care of one instance of __func__. libelf: drop pointless uses of __FUNCTION__ Non-debugging message text should be (and is in the cases here, albeit often only with the addition of an ELF: prefix) distinguishable without also logging function names. In the messages touched at once use %#x (or variants thereof) in favor of 0x%x. --- v2: Add a missing ELF: prefix. Further disambiguate note related messages. Also take care of one instance of __func__. --- a/xen/common/libelf/libelf-dominfo.c +++ b/xen/common/libelf/libelf-dominfo.c @@ -131,8 +131,7 @@ elf_errorstatus elf_xen_parse_note(struc if ( (type >= sizeof(note_desc) / sizeof(note_desc[0])) || (note_desc[type].name == NULL) ) { - elf_msg(elf, "%s: unknown xen elf note (0x%x)\n", - __FUNCTION__, type); + elf_msg(elf, "ELF: note: unknown (%#x)\n", type); return 0; } @@ -142,16 +141,14 @@ elf_errorstatus elf_xen_parse_note(struc if (str == NULL) /* elf_strval will mark elf broken if it fails so no need to log */ return 0; - elf_msg(elf, "%s: %s = \"%s\"\n", __FUNCTION__, - note_desc[type].name, str); + elf_msg(elf, "ELF: note: %s = \"%s\"\n", note_desc[type].name, str); parms->elf_notes[type].type = XEN_ENT_STR; parms->elf_notes[type].data.str = str; } else { val = elf_note_numeric(elf, note); - elf_msg(elf, "%s: %s = 0x%" PRIx64 "\n", __FUNCTION__, - note_desc[type].name, val); + elf_msg(elf, "ELF: note: %s = %#" PRIx64 "\n", note_desc[type].name, val); parms->elf_notes[type].type = XEN_ENT_LONG; parms->elf_notes[type].data.num = val; } @@ -310,7 +307,7 @@ elf_errorstatus elf_xen_parse_guest_info } name[len] = STAR(h); } - elf_msg(elf, "%s: %s=\"%s\"\n", __FUNCTION__, name, value); + elf_msg(elf, "ELF: %s=\"%s\"\n", name, value); /* strings */ if ( !strcmp(name, "LOADER") ) @@ -363,9 +360,8 @@ static elf_errorstatus elf_xen_note_chec unsigned machine = elf_uval(elf, elf->ehdr, e_machine); if ( (machine == EM_386) || (machine == EM_X86_64) ) { - elf_err(elf, "%s: ERROR: Not a Xen-ELF image: " - "No ELF notes or '__xen_guest' section found.\n", - __FUNCTION__); + elf_err(elf, "ERROR: Not a Xen-ELF image: " + "No ELF notes or '__xen_guest' section found\n"); return -1; } return 0; @@ -373,7 +369,7 @@ static elf_errorstatus elf_xen_note_chec if ( elf_uval(elf, elf->ehdr, e_machine) == EM_ARM ) { - elf_msg(elf, "%s: Not bothering with notes on ARM\n", __FUNCTION__); + elf_msg(elf, "ELF: Not bothering with notes on ARM\n"); return 0; } @@ -383,9 +379,10 @@ static elf_errorstatus elf_xen_note_chec ((strlen(parms->guest_os) == 0) || strncmp(parms->guest_os, "linux", 5)) ) { - elf_err(elf, "%s: ERROR: Will only load images built for the generic " - "loader or Linux images (Not '%.*s' and '%.*s')\n", - __FUNCTION__, (int)sizeof(parms->loader), parms->loader, + elf_err(elf, + "ERROR: Will only load images built for the generic loader or Linux images" + " (Not '%.*s' and '%.*s')\n", + (int)sizeof(parms->loader), parms->loader, (int)sizeof(parms->guest_os), parms->guest_os); return -1; } @@ -393,8 +390,8 @@ static elf_errorstatus elf_xen_note_chec if ( (strlen(parms->xen_ver) == 0) || strncmp(parms->xen_ver, "xen-3.0", 7) ) { - elf_err(elf, "%s: ERROR: Xen will only load images built " - "for Xen v3.0 (Not '%.*s')\n", __FUNCTION__, + elf_err(elf, "ERROR: Xen will only load images built for Xen v3.0 " + "(Not '%.*s')\n", (int)sizeof(parms->xen_ver), parms->xen_ver); return -1; } @@ -409,8 +406,7 @@ static elf_errorstatus elf_xen_addr_calc if ( (parms->elf_paddr_offset != UNSET_ADDR) && (parms->virt_base == UNSET_ADDR) ) { - elf_err(elf, "%s: ERROR: ELF_PADDR_OFFSET set, VIRT_BASE unset\n", - __FUNCTION__); + elf_err(elf, "ERROR: ELF_PADDR_OFFSET set, VIRT_BASE unset\n"); return -1; } @@ -418,8 +414,8 @@ static elf_errorstatus elf_xen_addr_calc if ( parms->virt_base == UNSET_ADDR ) { parms->virt_base = 0; - elf_msg(elf, "%s: VIRT_BASE unset, using 0x%" PRIx64 "\n", - __FUNCTION__, parms->virt_base); + elf_msg(elf, "ELF: VIRT_BASE unset, using %#" PRIx64 "\n", + parms->virt_base); } /* @@ -437,8 +433,8 @@ static elf_errorstatus elf_xen_addr_calc parms->elf_paddr_offset = 0; else parms->elf_paddr_offset = parms->virt_base; - elf_msg(elf, "%s: ELF_PADDR_OFFSET unset, using 0x%" PRIx64 "\n", - __FUNCTION__, parms->elf_paddr_offset); + elf_msg(elf, "ELF_PADDR_OFFSET unset, using %#" PRIx64 "\n", + parms->elf_paddr_offset); } virt_offset = parms->virt_base - parms->elf_paddr_offset; @@ -455,7 +451,7 @@ static elf_errorstatus elf_xen_addr_calc parms->virt_kend = elf->bsd_symtab_pend + virt_offset; } - elf_msg(elf, "%s: addresses:\n", __FUNCTION__); + elf_msg(elf, "ELF: addresses:\n"); elf_msg(elf, " virt_base = 0x%" PRIx64 "\n", parms->virt_base); elf_msg(elf, " elf_paddr_offset = 0x%" PRIx64 "\n", parms->elf_paddr_offset); elf_msg(elf, " virt_offset = 0x%" PRIx64 "\n", virt_offset); @@ -469,8 +465,7 @@ static elf_errorstatus elf_xen_addr_calc (parms->virt_entry > parms->virt_kend) || (parms->virt_base > parms->virt_kstart) ) { - elf_err(elf, "%s: ERROR: ELF start or entries are out of bounds.\n", - __FUNCTION__); + elf_err(elf, "ERROR: ELF start or entries are out of bounds\n"); return -1; } @@ -478,8 +473,7 @@ static elf_errorstatus elf_xen_addr_calc (parms->p2m_base >= parms->virt_kstart) && (parms->p2m_base < parms->virt_kend) ) { - elf_err(elf, "%s: ERROR: P->M table base is out of bounds.\n", - __FUNCTION__); + elf_err(elf, "ERROR: P->M table base is out of bounds\n"); return -1; } @@ -561,7 +555,7 @@ elf_errorstatus elf_xen_parse(struct elf return -1; if ( xen_elfnotes == 0 && more_notes > 0 ) - elf_msg(elf, "%s: using notes from SHT_NOTE section\n", __FUNCTION__); + elf_msg(elf, "ELF: using notes from SHT_NOTE section\n"); xen_elfnotes += more_notes; } @@ -579,7 +573,7 @@ elf_errorstatus elf_xen_parse(struct elf parms->guest_info = elf_section_start(elf, shdr); parms->elf_note_start = ELF_INVALID_PTRVAL; parms->elf_note_end = ELF_INVALID_PTRVAL; - elf_msg(elf, "%s: __xen_guest: \"%s\"\n", __FUNCTION__, + elf_msg(elf, "ELF: __xen_guest: \"%s\"\n", elf_strfmt(elf, parms->guest_info)); elf_xen_parse_guest_info(elf, parms); } --- a/xen/common/libelf/libelf-loader.c +++ b/xen/common/libelf/libelf-loader.c @@ -33,7 +33,7 @@ elf_errorstatus elf_init(struct elf_bina if ( !elf_is_elfbinary(image_input, size) ) { - elf_err(elf, "%s: not an ELF binary\n", __FUNCTION__); + elf_err(elf, "ELF: not an ELF binary\n"); return -1; } @@ -51,8 +51,8 @@ elf_errorstatus elf_init(struct elf_bina elf_uval(elf, elf->ehdr, e_phentsize) * elf_phdr_count(elf); if ( offset > elf->size ) { - elf_err(elf, "%s: phdr overflow (off %" PRIx64 " > size %lx)\n", - __FUNCTION__, offset, (unsigned long)elf->size); + elf_err(elf, "ELF: phdr overflow (off %" PRIx64 " > size %lx)\n", + offset, (unsigned long)elf->size); return -1; } @@ -61,8 +61,8 @@ elf_errorstatus elf_init(struct elf_bina elf_uval(elf, elf->ehdr, e_shentsize) * elf_shdr_count(elf); if ( offset > elf->size ) { - elf_err(elf, "%s: shdr overflow (off %" PRIx64 " > size %lx)\n", - __FUNCTION__, offset, (unsigned long)elf->size); + elf_err(elf, "ELF: shdr overflow (off %" PRIx64 " > size %lx)\n", + offset, (unsigned long)elf->size); return -1; } @@ -430,8 +430,8 @@ void elf_parse_binary(struct elf_binary continue; paddr = elf_uval(elf, phdr, p_paddr); memsz = elf_uval(elf, phdr, p_memsz); - elf_msg(elf, "%s: phdr: paddr=0x%" PRIx64 - " memsz=0x%" PRIx64 "\n", __FUNCTION__, paddr, memsz); + elf_msg(elf, "ELF: phdr: paddr=%#" PRIx64 " memsz=%#" PRIx64 "\n", + paddr, memsz); if ( low > paddr ) low = paddr; if ( high < paddr + memsz ) @@ -439,8 +439,8 @@ void elf_parse_binary(struct elf_binary } elf->pstart = low; elf->pend = high; - elf_msg(elf, "%s: memory: 0x%" PRIx64 " -> 0x%" PRIx64 "\n", - __FUNCTION__, elf->pstart, elf->pend); + elf_msg(elf, "ELF: memory: %#" PRIx64 " -> %#" PRIx64 "\n", + elf->pstart, elf->pend); } elf_errorstatus elf_load_binary(struct elf_binary *elf) @@ -483,8 +483,9 @@ elf_errorstatus elf_load_binary(struct e } remain_allow_copy -= memsz; - elf_msg(elf, "%s: phdr %" PRIu64 " at 0x%"ELF_PRPTRVAL" -> 0x%"ELF_PRPTRVAL"\n", - __func__, i, dest, (elf_ptrval)(dest + filesz)); + elf_msg(elf, + "ELF: phdr %" PRIu64 " at %#"ELF_PRPTRVAL" -> %#"ELF_PRPTRVAL"\n", + i, dest, (elf_ptrval)(dest + filesz)); if ( elf_load_image(elf, dest, ELF_IMAGE_BASE(elf) + offset, filesz, memsz) != 0 ) return -1; } --- a/xen/common/libelf/libelf-dominfo.c +++ b/xen/common/libelf/libelf-dominfo.c @@ -131,8 +131,7 @@ elf_errorstatus elf_xen_parse_note(struc if ( (type >= sizeof(note_desc) / sizeof(note_desc[0])) || (note_desc[type].name == NULL) ) { - elf_msg(elf, "%s: unknown xen elf note (0x%x)\n", - __FUNCTION__, type); + elf_msg(elf, "ELF: note: unknown (%#x)\n", type); return 0; } @@ -142,16 +141,14 @@ elf_errorstatus elf_xen_parse_note(struc if (str == NULL) /* elf_strval will mark elf broken if it fails so no need to log */ return 0; - elf_msg(elf, "%s: %s = \"%s\"\n", __FUNCTION__, - note_desc[type].name, str); + elf_msg(elf, "ELF: note: %s = \"%s\"\n", note_desc[type].name, str); parms->elf_notes[type].type = XEN_ENT_STR; parms->elf_notes[type].data.str = str; } else { val = elf_note_numeric(elf, note); - elf_msg(elf, "%s: %s = 0x%" PRIx64 "\n", __FUNCTION__, - note_desc[type].name, val); + elf_msg(elf, "ELF: note: %s = %#" PRIx64 "\n", note_desc[type].name, val); parms->elf_notes[type].type = XEN_ENT_LONG; parms->elf_notes[type].data.num = val; } @@ -310,7 +307,7 @@ elf_errorstatus elf_xen_parse_guest_info } name[len] = STAR(h); } - elf_msg(elf, "%s: %s=\"%s\"\n", __FUNCTION__, name, value); + elf_msg(elf, "ELF: %s=\"%s\"\n", name, value); /* strings */ if ( !strcmp(name, "LOADER") ) @@ -363,9 +360,8 @@ static elf_errorstatus elf_xen_note_chec unsigned machine = elf_uval(elf, elf->ehdr, e_machine); if ( (machine == EM_386) || (machine == EM_X86_64) ) { - elf_err(elf, "%s: ERROR: Not a Xen-ELF image: " - "No ELF notes or '__xen_guest' section found.\n", - __FUNCTION__); + elf_err(elf, "ERROR: Not a Xen-ELF image: " + "No ELF notes or '__xen_guest' section found\n"); return -1; } return 0; @@ -373,7 +369,7 @@ static elf_errorstatus elf_xen_note_chec if ( elf_uval(elf, elf->ehdr, e_machine) == EM_ARM ) { - elf_msg(elf, "%s: Not bothering with notes on ARM\n", __FUNCTION__); + elf_msg(elf, "ELF: Not bothering with notes on ARM\n"); return 0; } @@ -383,9 +379,10 @@ static elf_errorstatus elf_xen_note_chec ((strlen(parms->guest_os) == 0) || strncmp(parms->guest_os, "linux", 5)) ) { - elf_err(elf, "%s: ERROR: Will only load images built for the generic " - "loader or Linux images (Not '%.*s' and '%.*s')\n", - __FUNCTION__, (int)sizeof(parms->loader), parms->loader, + elf_err(elf, + "ERROR: Will only load images built for the generic loader or Linux images" + " (Not '%.*s' and '%.*s')\n", + (int)sizeof(parms->loader), parms->loader, (int)sizeof(parms->guest_os), parms->guest_os); return -1; } @@ -393,8 +390,8 @@ static elf_errorstatus elf_xen_note_chec if ( (strlen(parms->xen_ver) == 0) || strncmp(parms->xen_ver, "xen-3.0", 7) ) { - elf_err(elf, "%s: ERROR: Xen will only load images built " - "for Xen v3.0 (Not '%.*s')\n", __FUNCTION__, + elf_err(elf, "ERROR: Xen will only load images built for Xen v3.0 " + "(Not '%.*s')\n", (int)sizeof(parms->xen_ver), parms->xen_ver); return -1; } @@ -409,8 +406,7 @@ static elf_errorstatus elf_xen_addr_calc if ( (parms->elf_paddr_offset != UNSET_ADDR) && (parms->virt_base == UNSET_ADDR) ) { - elf_err(elf, "%s: ERROR: ELF_PADDR_OFFSET set, VIRT_BASE unset\n", - __FUNCTION__); + elf_err(elf, "ERROR: ELF_PADDR_OFFSET set, VIRT_BASE unset\n"); return -1; } @@ -418,8 +414,8 @@ static elf_errorstatus elf_xen_addr_calc if ( parms->virt_base == UNSET_ADDR ) { parms->virt_base = 0; - elf_msg(elf, "%s: VIRT_BASE unset, using 0x%" PRIx64 "\n", - __FUNCTION__, parms->virt_base); + elf_msg(elf, "ELF: VIRT_BASE unset, using %#" PRIx64 "\n", + parms->virt_base); } /* @@ -437,8 +433,8 @@ static elf_errorstatus elf_xen_addr_calc parms->elf_paddr_offset = 0; else parms->elf_paddr_offset = parms->virt_base; - elf_msg(elf, "%s: ELF_PADDR_OFFSET unset, using 0x%" PRIx64 "\n", - __FUNCTION__, parms->elf_paddr_offset); + elf_msg(elf, "ELF_PADDR_OFFSET unset, using %#" PRIx64 "\n", + parms->elf_paddr_offset); } virt_offset = parms->virt_base - parms->elf_paddr_offset; @@ -455,7 +451,7 @@ static elf_errorstatus elf_xen_addr_calc parms->virt_kend = elf->bsd_symtab_pend + virt_offset; } - elf_msg(elf, "%s: addresses:\n", __FUNCTION__); + elf_msg(elf, "ELF: addresses:\n"); elf_msg(elf, " virt_base = 0x%" PRIx64 "\n", parms->virt_base); elf_msg(elf, " elf_paddr_offset = 0x%" PRIx64 "\n", parms->elf_paddr_offset); elf_msg(elf, " virt_offset = 0x%" PRIx64 "\n", virt_offset); @@ -469,8 +465,7 @@ static elf_errorstatus elf_xen_addr_calc (parms->virt_entry > parms->virt_kend) || (parms->virt_base > parms->virt_kstart) ) { - elf_err(elf, "%s: ERROR: ELF start or entries are out of bounds.\n", - __FUNCTION__); + elf_err(elf, "ERROR: ELF start or entries are out of bounds\n"); return -1; } @@ -478,8 +473,7 @@ static elf_errorstatus elf_xen_addr_calc (parms->p2m_base >= parms->virt_kstart) && (parms->p2m_base < parms->virt_kend) ) { - elf_err(elf, "%s: ERROR: P->M table base is out of bounds.\n", - __FUNCTION__); + elf_err(elf, "ERROR: P->M table base is out of bounds\n"); return -1; } @@ -561,7 +555,7 @@ elf_errorstatus elf_xen_parse(struct elf return -1; if ( xen_elfnotes == 0 && more_notes > 0 ) - elf_msg(elf, "%s: using notes from SHT_NOTE section\n", __FUNCTION__); + elf_msg(elf, "ELF: using notes from SHT_NOTE section\n"); xen_elfnotes += more_notes; } @@ -579,7 +573,7 @@ elf_errorstatus elf_xen_parse(struct elf parms->guest_info = elf_section_start(elf, shdr); parms->elf_note_start = ELF_INVALID_PTRVAL; parms->elf_note_end = ELF_INVALID_PTRVAL; - elf_msg(elf, "%s: __xen_guest: \"%s\"\n", __FUNCTION__, + elf_msg(elf, "ELF: __xen_guest: \"%s\"\n", elf_strfmt(elf, parms->guest_info)); elf_xen_parse_guest_info(elf, parms); } --- a/xen/common/libelf/libelf-loader.c +++ b/xen/common/libelf/libelf-loader.c @@ -33,7 +33,7 @@ elf_errorstatus elf_init(struct elf_bina if ( !elf_is_elfbinary(image_input, size) ) { - elf_err(elf, "%s: not an ELF binary\n", __FUNCTION__); + elf_err(elf, "ELF: not an ELF binary\n"); return -1; } @@ -51,8 +51,8 @@ elf_errorstatus elf_init(struct elf_bina elf_uval(elf, elf->ehdr, e_phentsize) * elf_phdr_count(elf); if ( offset > elf->size ) { - elf_err(elf, "%s: phdr overflow (off %" PRIx64 " > size %lx)\n", - __FUNCTION__, offset, (unsigned long)elf->size); + elf_err(elf, "ELF: phdr overflow (off %" PRIx64 " > size %lx)\n", + offset, (unsigned long)elf->size); return -1; } @@ -61,8 +61,8 @@ elf_errorstatus elf_init(struct elf_bina elf_uval(elf, elf->ehdr, e_shentsize) * elf_shdr_count(elf); if ( offset > elf->size ) { - elf_err(elf, "%s: shdr overflow (off %" PRIx64 " > size %lx)\n", - __FUNCTION__, offset, (unsigned long)elf->size); + elf_err(elf, "ELF: shdr overflow (off %" PRIx64 " > size %lx)\n", + offset, (unsigned long)elf->size); return -1; } @@ -430,8 +430,8 @@ void elf_parse_binary(struct elf_binary continue; paddr = elf_uval(elf, phdr, p_paddr); memsz = elf_uval(elf, phdr, p_memsz); - elf_msg(elf, "%s: phdr: paddr=0x%" PRIx64 - " memsz=0x%" PRIx64 "\n", __FUNCTION__, paddr, memsz); + elf_msg(elf, "ELF: phdr: paddr=%#" PRIx64 " memsz=%#" PRIx64 "\n", + paddr, memsz); if ( low > paddr ) low = paddr; if ( high < paddr + memsz ) @@ -439,8 +439,8 @@ void elf_parse_binary(struct elf_binary } elf->pstart = low; elf->pend = high; - elf_msg(elf, "%s: memory: 0x%" PRIx64 " -> 0x%" PRIx64 "\n", - __FUNCTION__, elf->pstart, elf->pend); + elf_msg(elf, "ELF: memory: %#" PRIx64 " -> %#" PRIx64 "\n", + elf->pstart, elf->pend); } elf_errorstatus elf_load_binary(struct elf_binary *elf) @@ -483,8 +483,9 @@ elf_errorstatus elf_load_binary(struct e } remain_allow_copy -= memsz; - elf_msg(elf, "%s: phdr %" PRIu64 " at 0x%"ELF_PRPTRVAL" -> 0x%"ELF_PRPTRVAL"\n", - __func__, i, dest, (elf_ptrval)(dest + filesz)); + elf_msg(elf, + "ELF: phdr %" PRIu64 " at %#"ELF_PRPTRVAL" -> %#"ELF_PRPTRVAL"\n", + i, dest, (elf_ptrval)(dest + filesz)); if ( elf_load_image(elf, dest, ELF_IMAGE_BASE(elf) + offset, filesz, memsz) != 0 ) return -1; }