Skip to contentSkip to conversation

tools/libxc: Issue individual DPRINTF()s rather than multiline ones.

PATCH In review Andrew Cooper 3 participants 5 messages May 9, 2014 – May 12, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/libxc: Issue individual DPRINTF()s rather than multiline ones.

For libxc users who log to syslog, this results in legible logging, rather than long lines with #012's replacing newlines.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
---
 tools/libxc/xc_hvm_build_x86.c |   23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)
tools/libxc/xc_hvm_build_x86.c +9 -14
index dd3b522..43103b9 100644
@@ -283,15 +283,11 @@ static int setup_guest(xc_interface *xch,
         goto error_out;
     }
 
-    DPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n"
-            "  Loader:        %016"PRIx64"->%016"PRIx64"\n"
-            "  Modules:       %016"PRIx64"->%016"PRIx64"\n"
-            "  TOTAL:         %016"PRIx64"->%016"PRIx64"\n"
-            "  ENTRY ADDRESS: %016"PRIx64"\n",
-            elf.pstart, elf.pend,
-            m_start, m_end,
-            v_start, v_end,
-            elf_uval(&elf, elf.ehdr, e_entry));
+    DPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n");
+    DPRINTF("  Loader:   %016"PRIx64"->%016"PRIx64"\n", elf.pstart, elf.pend);
+    DPRINTF("  Modules:  %016"PRIx64"->%016"PRIx64"\n", m_start, m_end);
+    DPRINTF("  TOTAL:    %016"PRIx64"->%016"PRIx64"\n", v_start, v_end);
+    DPRINTF("  ENTRY:    %016"PRIx64"\n", elf_uval(&elf, elf.ehdr, e_entry));
 
     if ( (page_array = malloc(nr_pages * sizeof(xen_pfn_t))) == NULL )
     {
@@ -453,11 +449,10 @@ static int setup_guest(xc_interface *xch,
         goto error_out;
     }
 
-    DPRINTF("PHYSICAL MEMORY ALLOCATION:\n"
-            "  4KB PAGES: 0x%016lx\n"
-            "  2MB PAGES: 0x%016lx\n"
-            "  1GB PAGES: 0x%016lx\n",
-            stat_normal_pages, stat_2mb_pages, stat_1gb_pages);
+    DPRINTF("PHYSICAL MEMORY ALLOCATION:\n");
+    DPRINTF("  4KB PAGES: 0x%016lx\n", stat_normal_pages);
+    DPRINTF("  2MB PAGES: 0x%016lx\n", stat_2mb_pages);
+    DPRINTF("  1GB PAGES: 0x%016lx\n", stat_1gb_pages);
     
     if ( loadelfimage(xch, &elf, dom, page_array) != 0 )
         goto error_out;
Signature · 1 line
1.7.10.4
#2 lore raw
In reply to Andrew Cooper

Andrew Cooper writes ("[PATCH] tools/libxc: Issue individual DPRINTF()s rather than multiline ones."):

Quoted 2 lines

For libxc users who log to syslog, this results in legible logging, rather than long lines with #012's replacing newlines.

Thanks.

While you were there you should have removed the \n's. They are redundant since xc_reportv was made to use xtl. Search for "fmt_nonewline" in xc_private.c for the hideous hack...

Ian.

#3 lore raw
Quoted 7 lines · Ian Jackson

Andrew Cooper writes ("[PATCH] tools/libxc: Issue individual DPRINTF()s rather than multiline ones."):

Quoted 2 lines

For libxc users who log to syslog, this results in legible logging, rather than long lines with #012's replacing newlines.

Thanks.

While you were there you should have

FYI I applied this one this morning.

Ian.

#4 lore raw

Ian Campbell writes ("Re: [PATCH] tools/libxc: Issue individual DPRINTF()s rather than multiline ones."):

Quoted 10 lines · Ian Jackson
Quoted 7 lines

Andrew Cooper writes ("[PATCH] tools/libxc: Issue individual DPRINTF()s rather than multiline ones."):

Quoted 2 lines

For libxc users who log to syslog, this results in legible logging, rather than long lines with #012's replacing newlines.

Thanks.

While you were there you should have

FYI I applied this one this morning.

Indeed. No harm has been done, but the next time we tackle something like this removing the extraneous newlines would be good.

Thanks,
Ian.