From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] trace "exit to userspace" event Date: Thu, 14 Oct 2010 13:47:28 +0200 Message-ID: <20101014114728.GM19207@redhat.com> References: <20101008164447.GC393@redhat.com> <4CB17D39.7020007@redhat.com> <20101010154625.GR2397@redhat.com> <4CB6DB03.8060408@redhat.com> <20101014102904.GG19207@redhat.com> <4CB6E558.6010009@redhat.com> <20101014112843.GJ19207@redhat.com> <4CB6EA3E.7070802@redhat.com> <20101014114150.GL19207@redhat.com> <4CB6ECF8.3080709@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:15175 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753799Ab0JNLr3 (ORCPT ); Thu, 14 Oct 2010 07:47:29 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9EBlTdi004794 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Oct 2010 07:47:29 -0400 Content-Disposition: inline In-Reply-To: <4CB6ECF8.3080709@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 14, 2010 at 01:43:52PM +0200, Avi Kivity wrote: > On 10/14/2010 01:41 PM, Gleb Natapov wrote: > >> >> >So what do you propose? I see no issue with my original patch. > >> >> > >> >> Record both errno and exit_reason. While they're never both valid > >> >> at the same time, they're both necessary. > >> >> > >> >If they can't be valid at the same time, why not record one of them? > >> > >> If you record just one, you don't know if the other one happened. > >> > >I mean to record type/value. So it can be (type error/value -EINVAL) or > >(type exit/value HALT). The goal is to not print non-relevant info in > >ftrace, but we can do the same with recording errno and exit_reason and > >show only exit_reason is errno>=0 or errno otherwise. > > That's fine. As long as you don't drop information. > > >> >The > >> >one that happened? Also any error other then -EINTR will cause qemu to > >> >stop, so it is not very interesting. And ioctl return value can be > >> >traced by strace anyway. > >> > >> You can't correlate it with ftrace. > >> > >True. But given that the only interesting error code in -EINTR I do not > >know if this is useful, but potentially may generate a lot of events in > >ftrace. Sometimes too much info is almost as bad as not enough and if we > >will use the same event for both exit_reason and errno it will be > >impossible to enable one without the other. > > You can always filter excess information away. If you're looking > for exits to userspace (a major performance issue) then you want to > see both normal exits and signal exits. > How do I do it via /debug file system? Now I just echo name of the event I am interested in set_event, how do I add filter to that? -- Gleb.