From patchwork Fri Mar 28 16:43:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 27360 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 73F1520545 for ; Fri, 28 Mar 2014 16:46:31 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rl12sf18507096iec.10 for ; Fri, 28 Mar 2014 09:46:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=budFQn8IJ0/cdCWR0HdaSh9bhFWPjYPgQSGB13Bu12k=; b=YoGCVgTP6VdlUlnamnxM3HV5kx4XQyQgswIG0fji3OdmaQyeIZBar7OFFbDole6lmJ UM0V5uLFXdWROdzMOTRgX0rlmz29HlS3dZTjLyAM2ATP/OPYfZPzW//17nBO0YTlv3UR mCOPbmp5hMRxpUXbxBPnch6PMQapyJB+5NaER4dPKG47nANRagzF27wey2rVAlSE1npz RwuquiNSC7bINFOYF6W627DaSgf/QeXXqf+z/yE7SSU8wTjOfeL8x5z1e47/fytx2HcM lMtDpbEkjM8mdmzQALdW4X2fxTq+cdqFxCw2w/NyLFd71dWf5Zp2dlN+4gy8iMoEWSOs aUCQ== X-Gm-Message-State: ALoCoQnvCAh7aqPv+fM4ABG/C7mfv1XNoFD0wo8AK+UZ3XhSCR1GaayRs5JfHVtjtW9A5WIeCP1Q X-Received: by 10.50.254.1 with SMTP id ae1mr9933182igd.6.1396025190812; Fri, 28 Mar 2014 09:46:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.169 with SMTP id z38ls1561638qgz.36.gmail; Fri, 28 Mar 2014 09:46:30 -0700 (PDT) X-Received: by 10.52.34.137 with SMTP id z9mr6568193vdi.12.1396025190642; Fri, 28 Mar 2014 09:46:30 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id tm8si1330549vdc.170.2014.03.28.09.46.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 09:46:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so5916474veb.40 for ; Fri, 28 Mar 2014 09:46:30 -0700 (PDT) X-Received: by 10.52.6.162 with SMTP id c2mr6730153vda.6.1396025190575; Fri, 28 Mar 2014 09:46:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp23282vcv; Fri, 28 Mar 2014 09:46:29 -0700 (PDT) X-Received: by 10.224.36.83 with SMTP id s19mr10681896qad.50.1396025189637; Fri, 28 Mar 2014 09:46:29 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l17si2818418qga.36.2014.03.28.09.46.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 09:46:29 -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; Received: from localhost ([::1]:34968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTZvJ-0001V8-7k for patch@linaro.org; Fri, 28 Mar 2014 12:46:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTZsV-00077I-J8 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 12:43:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTZsQ-0002kC-AW for qemu-devel@nongnu.org; Fri, 28 Mar 2014 12:43:35 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:56339 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTZsP-0002jo-V9 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 12:43:30 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaro.local) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1WTZso-0004ll-W2; Fri, 28 Mar 2014 17:43:55 +0100 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 28 Mar 2014 16:43:27 +0000 Message-Id: <1396025007-27592-8-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1396025007-27592-1-git-send-email-alex.bennee@linaro.org> References: <1396025007-27592-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: alex.bennee@linaro.org X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 88.198.71.155 Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [Qemu-devel] [PATCH v2 7/7] qemu-log: add nochain option to disable TB chaining X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 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-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.bennee@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The current exec and cpu flags only show information when we enter a TranslationBlock. The blocks will then chain together until there is a reason to exit which can make things harder to follow. This new option disables the chaining for debugging purposes. Signed-off-by: Alex Bennée diff --git a/cpu-exec.c b/cpu-exec.c index abe02b7..c20349c 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -620,8 +620,10 @@ int cpu_exec(CPUArchState *env) } /* see if we can patch the calling TB. When the TB spans two pages, we cannot safely do a direct - jump. */ - if (next_tb != 0 && tb->page_addr[1] == -1) { + jump. It can also complicate tracing so disable if + asked (but be aware this can change behaviour). */ + if (next_tb != 0 && tb->page_addr[1] == -1 && + !qemu_loglevel_mask (CPU_LOG_TB_NOCHAIN)) { tb_add_jump((TranslationBlock *)(next_tb & ~TB_EXIT_MASK), next_tb & TB_EXIT_MASK, tb); } diff --git a/include/qemu/log.h b/include/qemu/log.h index f6cef9e..82902b0 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -40,6 +40,7 @@ static inline bool qemu_log_enabled(void) #define CPU_LOG_RESET (1 << 9) #define LOG_UNIMP (1 << 10) #define LOG_GUEST_ERROR (1 << 11) +#define CPU_LOG_TB_NOCHAIN (1 << 12) /* Returns true if a bit is set in the current loglevel mask */ diff --git a/qemu-log.c b/qemu-log.c index a54b332..dc78a93 100644 --- a/qemu-log.c +++ b/qemu-log.c @@ -175,6 +175,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_TB_NOCHAIN, "nochain", + "disable chaining of translation blocks (better tracing, but slower)" }, { 0, NULL, NULL }, };