RFC: common simulator cycle output option
Hans-Peter Nilsson
hans-peter.nilsson@axis.com
Thu Dec 1 17:20:00 GMT 2005
It seems that few simulators (I only know of one ;-) have an
option to output cycle count or other measurement of execution
time other than wallclock time spent in the simulator. This
poses a problem with cross-testing code quality like in GCC
regression tests.
I'd like to introduce a general option suggesting
--generic-cycle-count[=FILE] to output something like
"Cycle-count: %lld\n" on FILE, default stderr. The output
doesn't *have* to include all cycles (if the simulator port
doesn't account for some cycles, for example memory accesses)
and may be off linearly (by a constant and a factor), but should
be repeatable (between hosts) and monotonously increasing with
execution time. Wallclock is not a repeatable measurement and
is too coarse.
I know "-v" outputs an instruction count on *some*
architectures. For CRIS (which has more detailed cycle-count
options), it outputs something like:
"run 20010122-1.x2
Simulator Execution Speed
Total instructions: 2,143
Total execution time: < 1 second
"
where the comma poses problems using a single regex field for
the number. Also, at least mips-sim doesn't output the "Total
instructions:" line (insn count isn't incremented from 0). I'm
not sure the comma can be freely removed, but that might be an
option. Still, I want the output to be cycles, not just
instructions, so I'd still prefer a separate option.
I'd like to add that option and hopefully tests to make sure it
works for most src/sim/*, but before doing that, I solicit
thoughts and suggestions. (Maybe there already is a specific
well-hidden option.)
brgds, H-P
More information about the Gdb
mailing list