From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] trace "exit to userspace" event
Date: Sun, 10 Oct 2010 10:45:45 +0200 [thread overview]
Message-ID: <4CB17D39.7020007@redhat.com> (raw)
In-Reply-To: <20101008164447.GC393@redhat.com>
On 10/08/2010 06:44 PM, Gleb Natapov wrote:
> On Thu, Oct 07, 2010 at 09:49:17PM -0300, Marcelo Tosatti wrote:
> > On Thu, Oct 07, 2010 at 07:56:55PM +0200, Gleb Natapov wrote:
> > > > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > > > > index b8499f5..8800713 100644
> > > > > --- a/virt/kvm/kvm_main.c
> > > > > +++ b/virt/kvm/kvm_main.c
> > > > > @@ -1458,6 +1458,8 @@ static long kvm_vcpu_ioctl(struct file *filp,
> > > > > if (arg)
> > > > > goto out;
> > > > > r = kvm_arch_vcpu_ioctl_run(vcpu, vcpu->run);
> > > > > + if (r>= 0)
> > > > > + trace_kvm_userspace_exit(vcpu->run->exit_reason);
> > > > > break;
> > > > > case KVM_GET_REGS: {
> > > > > struct kvm_regs *kvm_regs;
> > > > > --
> > > > > Gleb.
> > > >
> > > > Exit codes are also valid for r == -EINTR and -EAGAIN cases, eg
> > > > EXIT_INTR. Better print it out for all cases, and let the reader
> > > > decide whether exit_reason is valid.
> > > Are they? I see that userspace does not look into run->exit_reason in
> > > case of -EINTR and -EAGAIN.
> >
> > Not userspace, but for a human reader. Otherwise the trace information
> > is incomplete and confusing.
> But if we will always call trace_kvm_userspace_exit() here trace
> information will show erroneous info since on any error but -EINTR
> exit_reason contains stale info. What about changing r>= 0 to r>= 0 ||
> r == -EINTR.
We should log both errno and exit_reason. If we want to be clever, we
can display strerror(errno) if it's nonzero, and exit_reason otherwise
(easy to do in a trace-cmd plugin).
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-10-10 8:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 13:14 [PATCH] trace "exit to userspace" event Gleb Natapov
2010-10-07 16:18 ` Marcelo Tosatti
2010-10-07 17:56 ` Gleb Natapov
2010-10-08 0:49 ` Marcelo Tosatti
2010-10-08 16:44 ` Gleb Natapov
2010-10-10 8:45 ` Avi Kivity [this message]
2010-10-10 15:46 ` Gleb Natapov
2010-10-14 10:27 ` Avi Kivity
2010-10-14 10:29 ` Gleb Natapov
2010-10-14 11:11 ` Avi Kivity
2010-10-14 11:28 ` Gleb Natapov
2010-10-14 11:32 ` Avi Kivity
2010-10-14 11:41 ` Gleb Natapov
2010-10-14 11:43 ` Avi Kivity
2010-10-14 11:47 ` Gleb Natapov
2010-10-14 12:09 ` Avi Kivity
2010-10-14 12:10 ` Avi Kivity
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=4CB17D39.7020007@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.