Hi Akim, > > But what about the list-of-lists use-case? ... > ... > DEFTIMEVAR (TV_FOO, "Foo phase") > DEFTIMEVAR (TV_FOO_BAR, "Foo: Bar phase") > DEFTIMEVAR (TV_FOO_BAZ, "Foo: Baz phase")
Looks fine to me. So the approach (a) works fine with lists-of-lists; it only needs to be documented. (Because it wasn't obvious to me how to apply (a) to this use-case.) > In Bison it reads: > > /* This file contains timing variable definitions, used by timevar.h > and timevar.c. > > Syntax: > > DEFTIMEVAR (id, name) > > where ID is the enumeral value used to identify the timing > variable, and NAME is a character string describing its purpose. */ I'm missing two things: - the words "iterable" and "list" in the description of the concept, - an explanation about the ID: is it a run-time entity (i.e. will it be printed), a compile-time entity, or both? Two other points worth documenting: * When the program invokes subprocesses, which of the times (usr, sys, wall) include the times of the subprocess, and with which multiplicity? * When the program creates additional threads and these threads terminate within the particular phase, which of the times (usr, sys, wall) include the times of the threads? Another question is: what is the resolution of the timevar facility? I understand that for GCC. a resolution of 0.01 seconds is perfectly enough. But other programs execute faster and thus would be interested in microsecond resolution. Which of the high-resolution timers Linux provides [1][2] are actually useful in this context? Bruno [1] https://stackoverflow.com/questions/6749621/how-to-create-a-high-resolution-timer-in-linux-to-measure-program-performance [2] http://man7.org/linux/man-pages/man2/clock_gettime.2.html