From patchwork Tue May 15 14:07:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 135892 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1077384lji; Tue, 15 May 2018 07:16:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZob+MsOjze/Dcr2KvwWH7mCgqYlq/GnfoqwcZvs3eh63QYwGkvuR5P4fIuBRsa+YlpkdHON X-Received: by 2002:aed:2411:: with SMTP id r17-v6mr13594931qtc.273.1526393812934; Tue, 15 May 2018 07:16:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526393812; cv=none; d=google.com; s=arc-20160816; b=VE4tMuI/uCVXsF69v0FIlaGdWunCDz3eIzgzuKGBNmzqFZYWClIt+WMu35wcDqECKD FHOqfb/dXyC+WP40yxuEIL8yy6J7J7qc3rtM8xmMg1hABkHGvV88ykTAcyGEZCGM638I fpdUFJanWf+AvokziUhUyspLEF/EGprqeoGBDq6ppfI6uGhDEynm+TcP0zoShS5y5DCq KmIs56W2Anie1Abud2vnNTXvVZtNBUEVFO+hNLoZvf9eDySUffydhJoazCBFP15hj0mz tB11uuoh2uGYzI8Mx8yTvtSms+1RPif0+mlZOlwDaqKw7h751iH2TWpL7LOx0cjJb4id C/EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=RAppQW8Wjh3BsQHQcVmbUbatytiATvgWgjl2MbjsP1U=; b=WMshkkpbAU4xZ8p78Zmax/BTo7RzoZqOJjq4F/YDI0AUP9Ym6/blYrp2hxKPRtyQGy VLeCJnCR3TNJavIw9oWs17CcZAhqvOA4CSowrOwvkOE628KIPt+yWjy/XWT21m1gx7Ne 1nxELmRQzbKXrYTK0JVhbWmp2g1I2iEOLkPzEL+dEVseLXSMsvnHGo5BPV67NvQksFkB ZOkLIcLyXrIcZLgZFkYQj2oodq/1jAix1ZV2N/KTqDNvkhGMoc7M5Lah9/PyPSzNsY5c C966/1kOeWQ3bzp1MWaPli72zlOVRsVuvOyYIgKUQbuDtWHUoWfBFs0rHvtdgjzkXE8x UPJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e45-v6si155690qve.140.2018.05.15.07.16.52 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 15 May 2018 07:16:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIal2-0003Hq-8d for patch@linaro.org; Tue, 15 May 2018 10:16:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIabs-0003tB-TN for qemu-devel@nongnu.org; Tue, 15 May 2018 10:07:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIabo-0002zl-Rg for qemu-devel@nongnu.org; Tue, 15 May 2018 10:07:24 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:41690) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fIabo-0002wj-L2 for qemu-devel@nongnu.org; Tue, 15 May 2018 10:07:20 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fIabn-0001UC-Jy for qemu-devel@nongnu.org; Tue, 15 May 2018 15:07:19 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 15 May 2018 15:07:07 +0100 Message-Id: <20180515140707.15957-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180515140707.15957-1-peter.maydell@linaro.org> References: <20180515140707.15957-1-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 16/16] tcg: Optionally log FPU state in TCG -d cpu logging X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Usually the logging of the CPU state produced by -d cpu is sufficient to diagnose problems, but sometimes you want to see the state of the floating point registers as well. We don't want to enable that by default as it adds a lot of extra data to the log; instead, allow it to be optionally enabled via -d fpu. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20180510130024.31678-1-peter.maydell@linaro.org --- include/qemu/log.h | 1 + accel/tcg/cpu-exec.c | 9 ++++++--- util/log.c | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) -- 2.17.0 diff --git a/include/qemu/log.h b/include/qemu/log.h index ff92a8b86a..b097a6cae1 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -44,6 +44,7 @@ static inline bool qemu_log_separate(void) #define CPU_LOG_PAGE (1 << 14) /* LOG_TRACE (1 << 15) is defined in log-for-trace.h */ #define CPU_LOG_TB_OP_IND (1 << 16) +#define CPU_LOG_TB_FPU (1 << 17) /* Lock output for a series of related logs. Since this is not needed * for a single qemu_log / qemu_log_mask / qemu_log_mask_and_addr, we diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 81153e7a13..0b154cc678 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -156,11 +156,14 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) if (qemu_loglevel_mask(CPU_LOG_TB_CPU) && qemu_log_in_addr_range(itb->pc)) { qemu_log_lock(); + int flags = 0; + if (qemu_loglevel_mask(CPU_LOG_TB_FPU)) { + flags |= CPU_DUMP_FPU; + } #if defined(TARGET_I386) - log_cpu_state(cpu, CPU_DUMP_CCOP); -#else - log_cpu_state(cpu, 0); + flags |= CPU_DUMP_CCOP; #endif + log_cpu_state(cpu, flags); qemu_log_unlock(); } #endif /* DEBUG_DISAS */ diff --git a/util/log.c b/util/log.c index 96f30dd21a..c0dbbd4700 100644 --- a/util/log.c +++ b/util/log.c @@ -256,6 +256,8 @@ const QEMULogItem qemu_log_items[] = { "show trace before each executed TB (lots of logs)" }, { CPU_LOG_TB_CPU, "cpu", "show CPU registers before entering a TB (lots of logs)" }, + { CPU_LOG_TB_FPU, "fpu", + "include FPU registers in the 'cpu' logging" }, { CPU_LOG_MMU, "mmu", "log MMU-related activities" }, { CPU_LOG_PCALL, "pcall",