[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Would timevar be accepted in gnulib?

From: Bruno Haible
Subject: Re: Would timevar be accepted in gnulib?
Date: Sun, 23 Sep 2018 23:46:01 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-134-generic; KDE/5.18.0; x86_64; ; )

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?


[2] http://man7.org/linux/man-pages/man2/clock_gettime.2.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]