[RFC] New markers description without format strings

Mathieu Desnoyers <[email protected]>
Newsgroups gmane.linux.kernel.tracing
Message-ID <20070507140224.GA24160@Krystal>
Hi,

I'll skip the implementation details, but I am considering changing the
current marker implementation, which uses format strings, for something
that would look like :

trace_mark(subsysname, eventname, mark_types(MARK_CHAR, MARK_ULLONG),
           mychar, myull);



For the curious, the preliminary proof of concept looks like the
following. It gives me a neat way to pass the types and the number of
arguments taken by the markers. Moreover, this should be more efficient
to do a switch() on the enum members than to parse the format string.

#define mark_types(args...) { args }

#define trace_mark(facname, eventname, types, args...) \
        static enum ltt_types types_##facname##_##eventname[] = types; \
        static struct ltt_types_struct struct_types_##facname##_##eventname = \
                { #facname, #eventname, types_##facname##_##eventname, \
                ARRAY_SIZE(types_##facname##_##eventname) };

Mathieu

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.