[RFC v2] Decode UFFDIO_* ioctls

Dr. David Alan Gilbert dgilbert at redhat.com
Wed May 4 17:42:52 UTC 2016


* Dmitry V. Levin (ldv at altlinux.org) wrote:
> On Wed, May 04, 2016 at 06:00:58PM +0100, Dr. David Alan Gilbert wrote:
> > * Dmitry V. Levin (ldv at altlinux.org) wrote:
> > > On Tue, May 03, 2016 at 08:23:43PM +0100, Dr. David Alan Gilbert wrote:
> > > [...]
> > > > > > --- /dev/null
> > > > > > +++ b/xlat/uffd_register_ioctl_flags.in
> > > > > > @@ -0,0 +1,5 @@
> > > > > > +#val_type uint64_t
> > > > > > +1<< _UFFDIO_WAKE
> > > > > > +1<< _UFFDIO_COPY
> > > > > > +1<< _UFFDIO_ZEROPAGE
> > > > > > +
> > > > > 
> > > > > gen.sh doesn't handle space characters after 1<< properly (yet).
> > > > > git am complains about empty line at EOF.
> > > > 
> > > > Fixed. Hmm, I've removed the spaces, but the output I'm getting is:
> > > > [pid  9644] ioctl(20, UFFDIO_REGISTER{range={start=0x7ff674200000, len=0x40000}, mode=UFFDIO_REGISTER_MODE_MISSING, ioctls=_UFFDIO_WAKE|_UFFDIO_COPY|_UFFDIO_ZEROPAGE}) = 0
> > > > 
> > > > shouldn't I be seeing 1ull<<_UFFDIO_WAKE | 1ull << _UFFDIO_COPY etc?
> > > 
> > > We have just a few users of this feature, and these users seem to be OK
> > > with the current behaviour, which means we probably need another syntax
> > > for this case.
> > 
> > Hmm this is confusing; I see icmp flags are one of the options;
> > so strace ping:
> > 
> > setsockopt(3, SOL_RAW, ICMP_FILTER, ~(ICMP_ECHOREPLY|ICMP_DEST_UNREACH|ICMP_SOURCE_QUENCH|ICMP_REDIRECT|ICMP_TIME_EXCEEDED|ICMP_PARAMETERPROB), 4) = 0
> > 
> > if we look at the source for ping:
> >         struct icmp_filter filt;
> >         filt.data = ~((1<<ICMP_SOURCE_QUENCH)|
> >                       (1<<ICMP_DEST_UNREACH)|
> >                       (1<<ICMP_TIME_EXCEEDED)|
> >                       (1<<ICMP_PARAMETERPROB)|
> >                       (1<<ICMP_REDIRECT)|
> >                       (1<<ICMP_ECHOREPLY));
> >         if (setsockopt(icmp_sock, SOL_RAW, ICMP_FILTER, (char*)&filt, sizeof(filt)) == -1)
> > 
> > so I reckon the current decode is wrong; however, it is more readable
> > and if we prefer readable I'm happy to stick with it.
> 
> I think the output should be both correct and readable
> so parser of ICMP_FILTER argument needs a fix.

Right, so I think if you just change the gen.sh, the ICMP code and the
capget code (that suffers in the same way) will both be fixed.

Dave
> 
> 
> -- 
> ldv



> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z

> _______________________________________________
> Strace-devel mailing list
> Strace-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel

--
Dr. David Alan Gilbert / dgilbert at redhat.com / Manchester, UK




More information about the Strace-devel mailing list