From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZE1M9-0005DW-28 for qemu-devel@nongnu.org; Sat, 11 Jul 2015 16:26:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZE1M4-00072j-C2 for qemu-devel@nongnu.org; Sat, 11 Jul 2015 16:26:40 -0400 Received: from mail-yk0-f178.google.com ([209.85.160.178]:33214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZE1M4-00072d-7s for qemu-devel@nongnu.org; Sat, 11 Jul 2015 16:26:36 -0400 Received: by ykeo3 with SMTP id o3so167290856yke.0 for ; Sat, 11 Jul 2015 13:26:35 -0700 (PDT) MIME-Version: 1.0 Sender: peter.crosthwaite@petalogix.com In-Reply-To: <556C11D1.4080301@redhat.com> References: <556C11D1.4080301@redhat.com> Date: Sat, 11 Jul 2015 13:26:35 -0700 Message-ID: From: Peter Crosthwaite Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [RFC v2 15/34] HACK: monitor: Comment out TCG profile ops List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Markus Armbruster Cc: Peter Maydell , Peter Crosthwaite , "qemu-devel@nongnu.org Developers" , Peter Crosthwaite , "Edgar E. Iglesias" , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Richard Henderson On Mon, Jun 1, 2015 at 1:03 AM, Paolo Bonzini wrote: > > > On 31/05/2015 08:11, Peter Crosthwaite wrote: >> Not dealing with this problem as of this RFC, but comments on how >> to solve it welcome. The approach adopted by this series is to >> implement multi-arch as multiple translators, so a single global >> TCG profiler is now ill-defined. > > Probably some kind of tcg-common.c? The counts can be added together > for all CPUs, and hence moved out of tcg_ctx. > > Also for example tcg/tcg-opc.h should only depend on > TCG_TARGET_REG_BITS, i.e. not on the arch. Hence tcg_op_defs should > also be arch-independent. > it is. Due to disas/tci.c's usages of tcg_op_defs this has been pulled to tcg-common.c. tcg_table_op_count and tcg_dump_op_count could go with it, but we are left with a harder problem with dump_exec_info which reaches into the tcg_ctx. So dump_exec_info is converted to a CPU_HOOK using the monitor CPU as context. This means you will get the TCG stats for tcg_ctx for the current CPU only. To keep the semantics consistent, I have done the same for dump_opcount_info. So both are CPU hooks: --- a/monitor.c +++ b/monitor.c @@ -962,13 +962,13 @@ static void hmp_info_registers(Monitor *mon, const QDict *qdict) static void hmp_info_jit(Monitor *mon, const QDict *qdict) { - dump_exec_info((FILE *)mon, monitor_fprintf); + CPU_HOOK(mon_get_cpu(), dump_exec_info)((FILE *)mon, monitor_fprintf); dump_drift_info((FILE *)mon, monitor_fprintf); } static void hmp_info_opcount(Monitor *mon, const QDict *qdict) { - dump_opcount_info((FILE *)mon, monitor_fprintf); + CPU_HOOK(mon_get_cpu(), dump_opcount_info)((FILE *)mon, monitor_fprintf); } static void hmp_info_history(Monitor *mon, const QDict *qdict) Regards, Peter P.S. Your macro CPU_HOOK suggestion has allowed me to remove all the stub implementations of hook functions, making it scarily easy to add new hooks. > Paolo > >> Signed-off-by: Peter Crosthwaite >> --- >> monitor.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/monitor.c b/monitor.c >> index 1a17cf3..f3ee785 100644 >> --- a/monitor.c >> +++ b/monitor.c >> @@ -1036,13 +1036,17 @@ static void hmp_info_registers(Monitor *mon, const QDict *qdict) >> >> static void hmp_info_jit(Monitor *mon, const QDict *qdict) >> { >> +#if 0 >> dump_exec_info((FILE *)mon, monitor_fprintf); >> +#endif >> dump_drift_info((FILE *)mon, monitor_fprintf); >> } >> >> static void hmp_info_opcount(Monitor *mon, const QDict *qdict) >> { >> +#if 0 >> dump_opcount_info((FILE *)mon, monitor_fprintf); >> +#endif >> } >> >> static void hmp_info_history(Monitor *mon, const QDict *qdict) >> >