[PATCH 1/5] Add parsing support for named ioctls APIs

Dmitry V. Levin ldv at altlinux.org
Thu Jan 22 01:55:37 UTC 2015


On Fri, Jan 16, 2015 at 11:31:42PM +0300, Dmitry V. Levin wrote:
> On Fri, Jan 16, 2015 at 09:05:56PM +0100, Gabriel Laskar wrote:
> > On Fri, Jan 16, 2015 at 8:31 PM, Dmitry V. Levin wrote:
> > > On Thu, Jan 15, 2015 at 08:32:26PM +0100, Gabriel Laskar wrote:
> > > [...]
> > >> --- a/linux/ioctlent.sh
> > >> +++ b/linux/ioctlent.sh
> > >> @@ -94,6 +94,21 @@ regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\
> > >>       -e 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*_S\?I.*(\([^[,]*\)[[:space:]]*,[[:space:]]*\([^,)]*\).*/     { "\1", "\2",   _IOC(_IOC_NONE,\3,\4,0) },/p' \
> > >>       >> ioctls.h
> > >>
> > >> +lookup_named_ioctls() {
> > >> +     api_name=$1
> > >> +
> > >> +     regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*\(([a-z,]*)\)\?[[:space:]]\+'$api_name'_\(IOR\|IOW\|IO\|IOWR\)[[:space:]]*'
> > >> +     (cd $dir && grep $regexp $files 2>/dev/null) | \
> > >> +             sed -n \
> > >> +             -e "s,$asm/,asm/,g" \
> > >> +             -e 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*'$api_name'_IO.*(\([^[,]*\)[[:space:]]*,.*/  { "\1", "\2",   _IOC(_IOC_NONE,DRM_IOCTL_BASE,\3,0)     },/p' \
> > >> +             >> ioctls.h
> > >> +}
> > >> +
> > >> +lookup_named_ioctls DRM
> > >> +lookup_named_ioctls OMAP
> > >> +lookup_named_ioctls HSC
> > >
> > > Why DRM_IOCTL_BASE ('d') is applied not only to DRM but also to HSC
> > > (where its analog is 'k') and OMAP (where its analog is 'O')?
> > 
> > My bad. I have only tested with DRM ioctls, I will do a new version
> > with the correct output for every one.
> 
> Please rebase to current HEAD, I've just pushed there two ioctlent.sh
> cleanup commits.

Sorry, I've already implemented 32-bit ioctl command decoding, so these
regexp enhancements are probably no longer relevant.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20150122/9f3ad623/attachment.bin>


More information about the Strace-devel mailing list