From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCHv2] trace "exit to userspace" event
Date: Sun, 24 Oct 2010 19:37:11 +0200 [thread overview]
Message-ID: <20101024173711.GB27391@redhat.com> (raw)
In-Reply-To: <4CC46C79.3070701@redhat.com>
On Sun, Oct 24, 2010 at 07:27:21PM +0200, Avi Kivity wrote:
> On 10/24/2010 07:24 PM, Gleb Natapov wrote:
> >On Sun, Oct 24, 2010 at 07:01:30PM +0200, Avi Kivity wrote:
> >> On 10/24/2010 04:49 PM, Gleb Natapov wrote:
> >> >Add tracepoint for userspace exit.
> >> >
> >> >
> >> >+
> >> >+TRACE_EVENT(kvm_userspace_exit,
> >> >+ TP_PROTO(__u32 reason, int errno),
> >> >+ TP_ARGS(reason, errno),
> >> >+
> >> >+ TP_STRUCT__entry(
> >> >+ __field( __u32, reason )
> >> >+ __field( int, errno )
> >> >+ ),
> >> >+
> >> >+ TP_fast_assign(
> >> >+ __entry->reason = reason;
> >> >+ __entry->errno = errno;
> >>
> >> Shouldn't this be -errno?
> >>
> >I check for __entry->errno< 0 below to see if exit was due to an error.
> >
>
> Then check for > 0. If a variable is named errno, it should work as
Is it documented that kvm_arch_vcpu_ioctl_run() never returns positive
value?
> an input to strerror() (or a __print_symbolic for errno).
>
__print_symbolic for all errno will be rather long. Anyway I think
ftrace is not proper place to check for syscall errors. The only error
value that is interesting here is EINTR, all others will cause userspace
to halt. The only things that errno accomplish here is that TP_printk
string become less readable.
--
Gleb.
next prev parent reply other threads:[~2010-10-24 17:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-24 14:49 [PATCHv2] trace "exit to userspace" event Gleb Natapov
2010-10-24 17:01 ` Avi Kivity
2010-10-24 17:24 ` Gleb Natapov
2010-10-24 17:27 ` Avi Kivity
2010-10-24 17:37 ` Gleb Natapov [this message]
2010-11-01 16:06 ` Marcelo Tosatti
2010-11-01 19:33 ` Avi Kivity
2010-11-01 19:43 ` Marcelo Tosatti
2010-11-01 21:19 ` 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=20101024173711.GB27391@redhat.com \
--to=gleb@redhat.com \
--cc=avi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox