Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2018 19:16:05 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: style change for syscalls.master
Message-ID:  <20181030191605.GA37638@spindle.one-eyed-alien.net>
In-Reply-To: <20181009221826.GA75401@spindle.one-eyed-alien.net>
References:  <20181009221826.GA75401@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--/9DWx/yDrRhgMJTb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I've posted a review and plan to commit tomorrow as this is blocking
further cleanups.

https://reviews.freebsd.org/D17706

-- Brooks

On Tue, Oct 09, 2018 at 10:18:26PM +0000, Brooks Davis wrote:
> I have a patch (https://reviews.freebsd.org/D17488) that removes the
> need for backslash line continuations in syscalls.master files with
> the aim of making the files more readable.  Based on the functionality
> in that patch, I'd like to propose changing the style of the file to
> something better suited the long lines introduced by long type/variable
> names and SAL annotations.  I'd also like it to be easier to diff
> between the main syscalls.master and the freebsd32 version.  Longer
> term, I hope to be able to generate freebsd32 files from the default
> syscalls.master which will be aided by reducing diffs and making room
> for more annotations.
>=20
> To those ends, I propose a reformat along the lines of the examples below:
>=20
> Old format:
> 1	AUE_EXIT	STD	{ void sys_exit(int rval); } exit \
> 				    sys_exit_args void
> ...
> 5	AUE_OPEN_RWTC	STD	{ int open( \
> 				    _In_z_ char *path, \
> 				    int flags, \
> 				    int mode); }
>=20
> New format:
> 1	AUE_EXIT	STD	{
> 		void sys_exit(
> 		     int rval
> 		);
> 	 } exit sys_exit_args void
> ...
> 5	AUE_OPEN_RWTC	STD	{=20
> 		int open(=20
> 		    _In_z_ char *path, =20
> 		    int flags, =20
> 		    int mode   =20
> 		); =20
> 	}
>=20
> For an example of where this makes diffs easier, consider preadv:
>=20
> Old format:
> 289     AUE_PREADV      STD     { ssize_t preadv(int fd, \
> 				    _In_reads_(iovcnt) \
> 				    struct iovec *iovp, \
> 				    u_int iovcnt, off_t offset); }
>=20
> New format:
> 289     AUE_PREADV      STD     {
> 		ssize_t preadv(
> 		    int fd,
> 		    _In_reads_(iovcnt) struct iovec *iovp,
> 		    u_int iovcnt,
> 		    off_t offset
> 		);
> 	 }
>=20
> New format (freebsd32):
> 289     AUE_PREADV      STD     {
> 		ssize_t freebsd32_preadv(
> 		    int fd,
> 		    _In_reads_(iovcnt) struct iovec32 *iovp,
> 		    u_int iovcnt,
> 		    uint32_t offset1,
> 		    uint32_t offset2
> 		);
> 	 }
>=20
>=20
> Some comments on this:
>  - One-variable-per-line allows for annotations and is struct-like which
>    is appropriate since this is more about declaring uap structs then
>    about function declarations.
>  - I chose the top level indent keep things readable without adding a
>    blank between each syscall block.  I'd be happy to drop things back
>    one tab if we'd rather have blanks between each declaration.
>  - If one really cared about vertical space, one could combine the ");",
>    "}", and alternative names, but I didn't find that very aesthetic.
>=20
> I'd like to know if this would break any out-of-tree parsers.  If so,
> we can easily keep backslashes, but I'd rather clear those out if
> we're going to complicate svn blame for every line in the file.  Parsers
> written in more sensible languages than the in-tree sh+sed+awk monster
> seem likely to be easy to fix and I hope that a more stylized format
> will be easier to handle with dumb parsers, but I'd like to hear if this
> change would cause issues.
>=20
> -- Brooks
>=20
> P.S. I'd plan to make this change after the 12.0 branch, but would like
> to reach concensus sooner as I'm working on yet-another-syscall vector
> in my work tree and I'd like to use this there.



--/9DWx/yDrRhgMJTb
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJb2K3zAAoJEKzQXbSebgfAyRMH/05rVb08HbVDmd7QE7YRv6Ri
YdSTWu2RsCsX32i/GeVyZOmI6JpcPu9B9LYAp/gLdcpPveGW1RPisOQHWVw/FNJ1
VaivYOSGHSP7Xmhmmdml+XVmMJ2cUZjJvDj97xfi1cgv7j+Zay1vDwLJGETmPAYo
fBo9Imnwe6gO8AzYhKqyWnKpIY4179AB7uZZMrT4MVWKbwJQ4immQL+8pLH10aPm
KSJ8a4DNBJuPGk+C/ZQNGKzDNOLdHfbWyqLqHzu1//8y1LTS3po/q+0s/DX9E63d
qrotRBcNB3brRBJg/CKFcRIH4MXhowZCMpfe7qdlYMd+FQlPH+k4HXLX7sQtvc4=
=Ahn8
-----END PGP SIGNATURE-----

--/9DWx/yDrRhgMJTb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181030191605.GA37638>