From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Wiki docs on counting and tracing KVM perf events Date: Thu, 20 May 2010 11:19:11 +0300 Message-ID: <4BF4F07F.4020007@redhat.com> References: <4BEC1345.7040408@redhat.com> <4BF4EF97.5060705@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Stefan Hajnoczi , kvm To: Jes Sorensen Return-path: Received: from mx1.redhat.com ([209.132.183.28]:26789 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754635Ab0ETITS (ORCPT ); Thu, 20 May 2010 04:19:18 -0400 In-Reply-To: <4BF4EF97.5060705@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/20/2010 11:15 AM, Jes Sorensen wrote: > On 05/13/10 16:57, Avi Kivity wrote: > >> On 05/13/2010 05:35 PM, Stefan Hajnoczi wrote: >> >>> How to count and trace KVM perf events: >>> >>> http://www.linux-kvm.org/page/Perf_events >>> >>> I want to draw attention to this because traditional kvm_stat and >>> kvm_trace use has been moving over to the debugfs based tracing >>> mechanisms. Perhaps we can flesh out documentation and examples of >>> common perf event usage. >>> >>> >>> >> Two things are missing to make this really useful: >> >> - a continuously updating difference mode like kvm_stat >> - subevents; for example kvm:kvm_exit is an aggregate of all exit types >> that can be split using filters to show individual exit reason statistics >> > Third missing item, which I find really useful: > - run once spit out raw counters > > For some operations, like file system benchmarking, it is useful to > sample the counters before and after and then divide the raw number of > events by the number of IOPS performed by the benchmark. If perf spits > out events/sec it's kinda hard to get this. > That's 'perf stat -a sleep 2' -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.