qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH 09/11] user: introduce "-d page"
Date: Sat, 12 Dec 2015 11:36:25 +0100	[thread overview]
Message-ID: <1449916587-18312-10-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1449916587-18312-1-git-send-email-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 bsd-user/main.c      | 4 ++--
 include/qemu/log.h   | 1 +
 linux-user/elfload.c | 8 ++++----
 linux-user/main.c    | 4 ++--
 qemu-log.c           | 2 ++
 5 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/bsd-user/main.c b/bsd-user/main.c
index adf2de0..1ecaeb5 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -938,7 +938,7 @@ int main(int argc, char **argv)
             unsigned long tmp;
             if (fscanf(fp, "%lu", &tmp) == 1) {
                 mmap_min_addr = tmp;
-                qemu_log("host mmap_min_addr=0x%lx\n", mmap_min_addr);
+                qemu_log_mask(CPU_LOG_PAGE, "host mmap_min_addr=0x%lx\n", mmap_min_addr);
             }
             fclose(fp);
         }
@@ -955,7 +955,7 @@ int main(int argc, char **argv)
 
     free(target_environ);
 
-    if (qemu_log_enabled()) {
+    if (qemu_loglevel_mask(CPU_LOG_PAGE)) {
         qemu_log("guest_base  0x%lx\n", guest_base);
         log_page_dump();
 
diff --git a/include/qemu/log.h b/include/qemu/log.h
index 964ab9d..d837d90 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -48,6 +48,7 @@ static inline bool qemu_log_separate(void)
 #define LOG_GUEST_ERROR    (1 << 11)
 #define CPU_LOG_MMU        (1 << 12)
 #define CPU_LOG_TB_NOCHAIN (1 << 13)
+#define CPU_LOG_PAGE       (1 << 14)
 
 /* Returns true if a bit is set in the current loglevel mask
  */
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 8b17c0e..b90be12 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1743,7 +1743,7 @@ unsigned long init_guest_space(unsigned long host_start,
         }
     }
 
-    qemu_log("Reserved 0x%lx bytes of guest address space\n", host_size);
+    qemu_log_mask(CPU_LOG_PAGE, "Reserved 0x%lx bytes of guest address space\n", host_size);
 
     return real_start;
 }
@@ -1784,9 +1784,9 @@ static void probe_guest_base(const char *image_name,
         }
         guest_base = real_start - loaddr;
 
-        qemu_log("Relocating guest address space from 0x"
-                 TARGET_ABI_FMT_lx " to 0x%lx\n",
-                 loaddr, real_start);
+        qemu_log_mask(CPU_LOG_PAGE, "Relocating guest address space from 0x"
+                      TARGET_ABI_FMT_lx " to 0x%lx\n",
+                      loaddr, real_start);
     }
     return;
 
diff --git a/linux-user/main.c b/linux-user/main.c
index a04e91e..6783722 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -4241,7 +4241,7 @@ int main(int argc, char **argv, char **envp)
             unsigned long tmp;
             if (fscanf(fp, "%lu", &tmp) == 1) {
                 mmap_min_addr = tmp;
-                qemu_log("host mmap_min_addr=0x%lx\n", mmap_min_addr);
+                qemu_log_mask(CPU_LOG_PAGE, "host mmap_min_addr=0x%lx\n", mmap_min_addr);
             }
             fclose(fp);
         }
@@ -4300,7 +4300,7 @@ int main(int argc, char **argv, char **envp)
 
     free(target_environ);
 
-    if (qemu_log_enabled()) {
+    if (qemu_loglevel_mask(CPU_LOG_PAGE)) {
         qemu_log("guest_base  0x%lx\n", guest_base);
         log_page_dump();
 
diff --git a/qemu-log.c b/qemu-log.c
index 7cb01a8..901b930 100644
--- a/qemu-log.c
+++ b/qemu-log.c
@@ -117,6 +117,8 @@ const QEMULogItem qemu_log_items[] = {
     { LOG_GUEST_ERROR, "guest_errors",
       "log when the guest OS does something invalid (eg accessing a\n"
       "non-existent register)" },
+    { CPU_LOG_PAGE, "page",
+      "dump pages at beginning of user mode emulation" },
     { CPU_LOG_TB_NOCHAIN, "nochain",
       "do not chain compiled TBs so that \"exec\" and \"cpu\" show\n"
       "complete traces" },
-- 
2.5.0

  parent reply	other threads:[~2015-12-12 10:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-12 10:36 [Qemu-devel] [PATCH 00/11] Avoid always-active qemu_log calls Paolo Bonzini
2015-12-12 10:36 ` [Qemu-devel] [PATCH 01/11] qemu-log: introduce qemu_log_separate Paolo Bonzini
2015-12-12 10:36 ` [Qemu-devel] [PATCH 02/11] alpha: convert "naked" qemu_log to tracepoint Paolo Bonzini
2015-12-16 16:59   ` Richard Henderson
2015-12-12 10:36 ` [Qemu-devel] [PATCH 03/11] cris: avoid "naked" qemu_log Paolo Bonzini
2015-12-17 13:32   ` Edgar E. Iglesias
2015-12-12 10:36 ` [Qemu-devel] [PATCH 04/11] microblaze: " Paolo Bonzini
2015-12-17 13:34   ` Edgar E. Iglesias
2015-12-12 10:36 ` [Qemu-devel] [PATCH 05/11] s390x: " Paolo Bonzini
2015-12-12 10:36 ` [Qemu-devel] [PATCH 06/11] ppc: cleanup logging Paolo Bonzini
2015-12-14  0:24   ` David Gibson
2015-12-12 10:36 ` [Qemu-devel] [PATCH 07/11] tricore: avoid "naked" qemu_log Paolo Bonzini
2015-12-12 19:47   ` Bastian Koppelmann
2015-12-12 20:15     ` Peter Maydell
2015-12-12 10:36 ` [Qemu-devel] [PATCH 08/11] xtensa: " Paolo Bonzini
2015-12-12 10:36 ` Paolo Bonzini [this message]
2015-12-12 10:36 ` [Qemu-devel] [PATCH 10/11] linux-user: " Paolo Bonzini
2015-12-12 15:04   ` Laurent Vivier
2015-12-12 10:39 ` [Qemu-devel] [PATCH 11/11] linux-user: convert DEBUG_SIGNAL logging to tracepoints Paolo Bonzini
2015-12-12 15:08   ` Laurent Vivier
2015-12-15  6:59   ` Thomas Huth
2015-12-15 13:19     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449916587-18312-10-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).