From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9ceT-0001mU-F4 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:47:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9ceQ-0006wv-Fn for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:47:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57201) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9ceQ-0006wr-85 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:47:38 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D5BC88F4F4 for ; Thu, 17 Dec 2015 17:47:37 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-23.ams2.redhat.com [10.36.112.23]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBHHkfcV014618 for ; Thu, 17 Dec 2015 12:47:37 -0500 From: Paolo Bonzini Date: Thu, 17 Dec 2015 18:46:25 +0100 Message-Id: <1450374401-31352-30-git-send-email-pbonzini@redhat.com> In-Reply-To: <1450374401-31352-1-git-send-email-pbonzini@redhat.com> References: <1450374401-31352-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 29/45] user: introduce "-d page" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Paolo Bonzini --- 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