Re: [PATCH] MI: new timing command

Daniel Jacobowitz
2006-12-31T15:15:35Z

On Sun, Dec 31, 2006 at 08:42:12PM +1300, Nick Roberts wrote:
> Daniel Jacobowitz writes:
> > In that case you can copy the necessary guards from that file.
> > However, it does more than just getrusage - it also supports
> > platforms with times() but without getrusage, which IIRC includes
> > Windows, so it might be better to use it.
>
> But as a last resort it returns elapsed time which would be wrong.

You keep saying this but I don't see why. Why is it wrong? On every
platform where we can do it, we'll print usage; on platforms where we
can't do it, the odds are pretty good that the OS isn't aggressively
scheduling other tasks in while we're running, so wall time is pretty
close to right.

> > I was wondering if we should make this a normal GDB setting, and use5C
> > "-gdb-set mi profiling on" to enable it. There's already a maint
> > setting to do the same thing for the CLI.
>
> The command "maint set profiling on" is relevant for both CLI and MI,
> whereas -enable-timings only works in MI.

I wasn't talking about "maint set profiling on", but about "maint time
1". That doesn't currently work in MI, but it could be made to work
and moved under the normal "set" hierarchy. Then we could use the same
setting for both CLI and MI. In that case you wouldn't have to invent
a new command that reimplements the "set" behavior; it could just be a
standard auto_boolean.

--
Daniel Jacobowitz
CodeSourcery