configuration file syntax (Was: GSOC:Microproject)

Masatake YAMATO yamato at redhat.com
Sat Feb 24 19:25:35 UTC 2018


(I changed the subject.)

On Fri, 23 Feb 2018 12:25:12 +0000, Eugene Syromyatnikov <evgsyr at gmail.com> wrote:
> On Fri, Feb 23, 2018 at 8:47 AM, Masatake YAMATO <yamato at redhat.com> wrote:
>> How about allowing a user to define ones' own class in ~/.strace?
> 
> By the way, since you've mentioned that, we've been thinking about
> some options for configuration file for quite some time (not only for
> custom group generation, but also for color output configuration, lua
> invasiveness and other not-yet-merged stuff). Does anyone have any
> ideas regarding a good configuration file syntax?

I like ctags style (because I maintain Universal-ctags).  A ctags user
just puts options of ctags to ~/.ctags.d/foo.ctags line by line. The
file is loaded when starting up and interpreted as if the options in
the file are specified in command line. What a user can do in ctags options
can be written in a configuration file.The exception is `#', a line
comment notation.

Here is my .ctags.d/init.ctags:

    --optlib-dir=+/home/yamato/var/ctags-xparsers/optlib
    --options=linux-dotconfig.ctags
    --exclude=*.po
    --exclude=/test/
    --exclude=/tests/
    # Experimental parser definition
    --langdef=selinuxPolicyInterface
	--map-selinuxPolicyInterface=+.if
	--kinddef-selinuxPolicyInterface=i,interface,interfaces
	--regex-selinuxPolicyInterface=/interface\(`([a-zA-Z0-9_]+)'/\1/i/
    ...

    
Benefits of this style are syntax is so obvious.  However, if we want
to allow to write more complicated things in a configuration file, the
syntax is too weak; it is hard to write something that has compound
structure. (For that reason, I used yaml for defining groups as a
example).

> The other question is about prefix for user-configurable groups, it
> probably shouldn't conflict with any existing syscall qualification
> syntax, but, for example, "%%%" looks too unwieldy.

Masatake YAMATO


More information about the Strace-devel mailing list