From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTGui-0008Kw-V9 for qemu-devel@nongnu.org; Wed, 23 Nov 2011 12:47:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTGui-0004VZ-1K for qemu-devel@nongnu.org; Wed, 23 Nov 2011 12:47:16 -0500 Received: from mail-bw0-f45.google.com ([209.85.214.45]:50185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTGuh-0004VO-PE for qemu-devel@nongnu.org; Wed, 23 Nov 2011 12:47:16 -0500 Received: by bkbzu5 with SMTP id zu5so2076437bkb.4 for ; Wed, 23 Nov 2011 09:47:14 -0800 (PST) From: Max Filippov Date: Wed, 23 Nov 2011 21:47:10 +0400 References: <20111123081030.GA8674@cs.nctu.edu.tw> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="big5" Content-Transfer-Encoding: 7bit Message-Id: <201111232147.10602.jcmvbkbc@gmail.com> Subject: Re: [Qemu-devel] oprofile on qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?big5?q?=B3=AF=AD=B3=A5=F4?= , Xin Tong > I oprofiled QEMU with some workloads, i.e. SPECjbb on Ubuntu Linux, i > see QEMU spent about 60 - 70% of the time in the code cache ( code > cache size is 256MB ). but I want to know which TB takes the most > amount of time. I doubt that it's possible to profile TB code by external tools without QEMU assistance. Probably it's easier to account individual TB timing from within QEMU, like it is now done for translation, see places marked with #ifdef CONFIG_PROFILER. With TB chaining disabled, TB execution starts with tcg_qemu_tb_exec, there's one call to it in cpu_exec(). TB may exit normally, or via longjmp, so there are two places in cpu_exec() where it must be caught. Virtual/physical mapping must also be taken care of, but it depends on your application. Thanks. -- Max