public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, "Ted Ts'o" <tytso@mit.edu>,
	LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Arjan van de Ven <arjan@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Li Zefan <lizf@cn.fujitsu.com>, Jason Baron <jbaron@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Christoph Hellwig <hch@lst.de>, Pekka Enberg <penberg@kernel.org>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [ANNOUNCE] New utility: 'trace'
Date: Wed, 17 Nov 2010 18:20:25 +0200	[thread overview]
Message-ID: <4CE400C9.8080707@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1011171657400.2900@localhost6.localdomain6>

On 11/17/2010 05:58 PM, Thomas Gleixner wrote:
> >
> >  Filtering is also useful for fine-grained perf events; this cannot be done in
> >  userspace.
>
> Could you explain that a bit more detailed please ?

I have a tracepoint kvm:kvm_exit which is called every time a guest 
exits to the host (for whatever reason).  The first step in profiling 
kvm is checking the rate at which this tracepoint is triggered.

(I have a small tool kvm_stat which shows a 'perf top' like display, 
except that instead of showing functions, it shows kvm tracepoints 
sorted by triggering rate)

If you see a high exit rate, you may also be interested in what exit 
reasons triggered those exits.  So kvm_stat creates additional events, 
one per possible exit_reason (which is a field in the kvm_exit 
tracepoint), with a filter matching exit_reason to the enum describing 
the possible exit reasons.  We add that to the display and get a sort of 
histogram showing which exit_reason is responsible for how many exits.

A screenshot:

kvm statistics

  kvm_exit                                     40075   10293
  kvm_entry                                    40075   10293
  kvm_exit(EXCEPTION_NMI)                      29824    7712
  kvm_page_fault                               29642    7672
  kvm_emulate_insn                              9117    2205
  kvm_inj_exception                             8052    2134
  kvm_mmio                                      6160    1514
  kvm_apic                                      6143    1509
  kvm_exit(CR_ACCESS)                           2307     635
  kvm_cr                                        2307     635
  kvm_exit(INVLPG)                              1998     599
  kvm_userspace_exit                            2956     582
  kvm_exit(IO_INSTRUCTION)                      2954     582
  kvm_pio                                       2954     582
  kvm_inj_virq                                  2194     551
  kvm_apic_accept_irq                           2181     547
  kvm_exit(HLT)                                 1523     372
  kvm_exit(EXTERNAL_INTERRUPT)                  1131     304
  kvm_fpu                                        706     176
  kvm_set_irq                                    802     156
  kvm_pic_set_irq                                802     156
  kvm_ioapic_set_irq                             802     156
  kvm_apic_ipi                                   454     132
  kvm_exit(PENDING_INTERRUPT)                    175      44
  kvm_cpuid                                      163      42
  kvm_exit(CPUID)                                163      42
  kvm_ack_irq                                    152      29


So there are 10K exits/sec, of which 7.7K are EXCEPTION_NMI and 635 are 
CR_ACCESS.

Tool source http://tinyurl.com/2ue5tev; one day I'll make it a 
tools/perf script.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-11-17 16:22 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 21:04 [ANNOUNCE] New utility: 'trace' Thomas Gleixner
2010-11-16 21:27 ` Darren Hart
2010-11-16 21:59   ` Ingo Molnar
2010-11-16 22:03     ` Peter Zijlstra
2010-11-16 22:08       ` Ingo Molnar
2010-11-16 22:09       ` Darren Hart
2010-11-16 22:48         ` Darren Hart
2010-11-16 22:07     ` Darren Hart
2010-11-16 22:17   ` Frederic Weisbecker
2010-11-17  8:30     ` Ingo Molnar
2010-11-17 11:35       ` Peter Zijlstra
2010-11-17 12:53         ` Frederic Weisbecker
2010-11-17 13:02           ` Peter Zijlstra
2010-11-17 13:10             ` Ingo Molnar
2010-11-17 13:36               ` Peter Zijlstra
2010-11-17 13:43                 ` Frederic Weisbecker
2010-11-17 13:53                   ` Peter Zijlstra
2010-11-17 14:10                     ` Frederic Weisbecker
2010-11-17 15:02                       ` Steven Rostedt
2010-11-17 18:13                       ` Ted Ts'o
2010-11-17 18:29                         ` Frederic Weisbecker
2010-11-17 18:30                           ` Darren Hart
2010-11-17 16:49             ` Darren Hart
2010-11-18 23:23       ` Joe Perches
2010-11-16 21:35 ` Ingo Molnar
2010-11-17  1:37 ` Ted Ts'o
2010-11-17  1:47   ` Steven Rostedt
2010-11-17  3:16     ` Ted Ts'o
2010-11-17  3:34       ` Steven Rostedt
2010-11-17 19:00         ` Bob Copeland
2010-11-17 13:24   ` Ingo Molnar
2010-11-17 13:38     ` Peter Zijlstra
2010-11-17 14:00       ` Ingo Molnar
2010-11-17 14:11         ` Peter Zijlstra
2010-11-17 14:18           ` Peter Zijlstra
2010-11-17 14:37             ` Thomas Gleixner
2010-11-17 14:41               ` Peter Zijlstra
2010-11-17 15:41               ` Tom Zanussi
2010-11-17 15:55                 ` Avi Kivity
2010-11-17 15:58                   ` Thomas Gleixner
2010-11-17 16:20                     ` Avi Kivity [this message]
2010-11-17 15:59                   ` Peter Zijlstra
2010-11-17 16:08                     ` Avi Kivity
2010-11-17 15:10           ` Steven Rostedt
2010-11-17 15:43             ` Peter Zijlstra
2010-11-17 16:04               ` Steven Rostedt
2010-11-17 16:15               ` Steven Rostedt
2010-11-17 19:40                 ` Darren Hart
2010-11-17 18:23               ` Mathieu Desnoyers
2010-11-18  5:58                 ` Masami Hiramatsu
2010-11-18  6:00               ` Masami Hiramatsu
2010-11-17 15:33           ` Tom Zanussi
2010-11-17 18:36             ` Mathieu Desnoyers
2010-11-17 18:53               ` Tom Zanussi
2010-11-17 19:02                 ` Mathieu Desnoyers
2010-11-17 19:25                   ` Tom Zanussi
2010-11-17 19:25               ` Steven Rostedt
2010-11-17  9:49 ` Philipp Marek
     [not found] ` <4CE38C53.8090606@kernel.org>
2010-11-17 12:07   ` [patch] trace: Add user-space event tracing/injection Ingo Molnar
2010-11-17 12:17     ` Pekka Enberg
2010-11-17 12:30       ` Ingo Molnar
2010-11-17 12:33         ` Pekka Enberg
2010-11-17 12:42           ` Peter Zijlstra
2010-11-17 12:58             ` Ingo Molnar
2010-11-17 13:09               ` Peter Zijlstra
2010-11-17 13:36                 ` Ingo Molnar
2010-11-17 12:24     ` Ingo Molnar
2010-11-17 12:30       ` Pekka Enberg
2010-11-17 12:29     ` Peter Zijlstra
2010-11-17 12:37       ` Peter Zijlstra
2010-11-17 13:10       ` Frederic Weisbecker
2010-11-17 13:31         ` Peter Zijlstra
2010-11-17 13:33           ` Frederic Weisbecker
2010-11-18  1:18     ` Darren Hart
2010-11-18  8:55       ` Ingo Molnar
2010-11-18 16:25         ` hp
2010-11-18 18:56           ` Ingo Molnar
2010-11-18 19:13             ` AW: " Reichert, Hans-Peter
2010-11-18 17:06         ` Darren Hart
2010-11-17 12:47 ` [ANNOUNCE] New utility: 'trace' Török Edwin
2010-11-17 12:51   ` Peter Zijlstra
2010-11-17 13:05     ` Török Edwin
2010-11-17 13:10       ` Peter Zijlstra
2010-11-17 13:32   ` Frederic Weisbecker
2010-11-18  0:47 ` Ian Munsie
     [not found]   ` <20101118151141.GA3368@redhat.com>
2010-11-19  2:32     ` Ian Munsie
2010-11-19 15:23       ` Jason Baron
     [not found]       ` <4CECACF9.3080907@linux.vnet.ibm.com>
     [not found]         ` <4CFD7182.4060206@linux.vnet.ibm.com>
2010-12-07  4:03           ` PowerPC, ftrace: Add PPC raw syscall tracepoints & ftrace fixes Ian Munsie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CE400C9.8080707@redhat.com \
    --to=avi@redhat.com \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=hch@lst.de \
    --cc=jbaron@redhat.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=tzanussi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox