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. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html