From patchwork Thu Sep 6 15:00:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 182214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 562B32C00A5 for ; Fri, 7 Sep 2012 01:01:33 +1000 (EST) Received: from localhost ([::1]:39315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9daF-000572-DX for incoming@patchwork.ozlabs.org; Thu, 06 Sep 2012 11:01:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9dZy-0004xZ-F8 for qemu-devel@nongnu.org; Thu, 06 Sep 2012 11:01:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9dZx-0007Q0-Eu for qemu-devel@nongnu.org; Thu, 06 Sep 2012 11:01:14 -0400 Received: from hall.aurel32.net ([88.191.126.93]:44018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9dZx-0007Nx-1T for qemu-devel@nongnu.org; Thu, 06 Sep 2012 11:01:13 -0400 Received: from 191.red-80-33-14.staticip.rima-tde.net ([80.33.14.191] helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1T9dZv-0006sG-Q7; Thu, 06 Sep 2012 17:01:11 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1T9dZo-000595-4t; Thu, 06 Sep 2012 17:01:04 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Thu, 6 Sep 2012 17:00:50 +0200 Message-Id: <1346943657-17256-2-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1346943657-17256-1-git-send-email-aurelien@aurel32.net> References: <1346943657-17256-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 88.191.126.93 Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH 1/8] tcg: improve profiler 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Now that there are two passes of optimization (optimize.c, liveness) there is no point of outputing the statistics of the liveness part only. Update the code to take into account both optimizations. Signed-off-by: Aurelien Jarno --- tcg/tcg.c | 18 ++++++++++-------- tcg/tcg.h | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 8386b70..8907b9f 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2059,22 +2059,23 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf, } #endif +#ifdef CONFIG_PROFILER + s->opt_time -= profile_getclock(); +#endif + #ifdef USE_TCG_OPTIMIZATIONS gen_opparam_ptr = tcg_optimize(s, gen_opc_ptr, gen_opparam_buf, tcg_op_defs); #endif - -#ifdef CONFIG_PROFILER - s->la_time -= profile_getclock(); -#endif tcg_liveness_analysis(s); + #ifdef CONFIG_PROFILER - s->la_time += profile_getclock(); + s->opt_time += profile_getclock(); #endif #ifdef DEBUG_DISAS if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP_OPT))) { - qemu_log("OP after liveness analysis:\n"); + qemu_log("OP after optimization:\n"); tcg_dump_ops(s); qemu_log("\n"); } @@ -2241,8 +2242,9 @@ void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf) (double)s->interm_time / tot * 100.0); cpu_fprintf(f, " gen_code time %0.1f%%\n", (double)s->code_time / tot * 100.0); - cpu_fprintf(f, "liveness/code time %0.1f%%\n", - (double)s->la_time / (s->code_time ? s->code_time : 1) * 100.0); + cpu_fprintf(f, "optim./code time %0.1f%%\n", + (double)s->opt_time / (s->code_time ? s->code_time : 1) + * 100.0); cpu_fprintf(f, "cpu_restore count %" PRId64 "\n", s->restore_count); cpu_fprintf(f, " avg cycles %0.1f\n", diff --git a/tcg/tcg.h b/tcg/tcg.h index d710694..7d63db5 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -381,7 +381,7 @@ struct TCGContext { int64_t code_out_len; int64_t interm_time; int64_t code_time; - int64_t la_time; + int64_t opt_time; int64_t restore_count; int64_t restore_time; #endif