The probe-monitor
tool offers a way to read out and present
the probe values in continuous samples, while the simulation is
running.
All probes being monitored will be presented in a table row for each sample taken, allowing detection of abnormal values during the simulation.
It is possible to add lots of probes to the same probe-monitor, but as the number of probes increase, so does the width of the produced table. Therefore, it can be useful to create several probe-monitors, each showing some group of related feature.
To create a probe-monitor use the new-probe-monitor
command. This will create a new object such as pm0
which has some additional commands.
See figure 25 for an example.
$> ./simics targets/qsp-x86/firststeps.simics num_cores=2 simics> new-probe-monitor mode = realtime interval=1 -summary simics> pm0.add-probe probe = sim.time.wallclock sim.time.virtual mode = session simics> pm0.add-probe probe = sim.time.schedule sim.slowdown sim.esteps sim.mips cpu.esteps cpu.time.schedule cpu.schedule_percent cpu.mips simics> run-seconds 60 ┌──────────────────────────────────────────────────────────────┬──────────────────────────────────────┬──────────────────────────────────────┐ │ │ board.mb.cpu0.core[0][0] │ board.mb.cpu0.core[1][0] │ ├──────────┬──────────┬─────────┬────────┬────────────┬────────┼────────────┬─────────┬──────┬────────┼────────────┬─────────┬──────┬────────┤ │ Session │ Session │Sched (s)│Slowdown│ Esteps │ IPS │ Esteps │Sched (s)│Sched%│ IPS │ Esteps │Sched (s)│Sched%│ IPS │ │Wallclock │ Virtual- │ │ │ │ │ │ │ │ │ │ │ │ │ │(hh:mm:ss)│ Time │ │ │ │ │ │ │ │ │ │ │ │ │ │ │(hh:mm:ss)│ │ │ │ │ │ │ │ │ │ │ │ │ ├──────────┼──────────┼─────────┼────────┼────────────┼────────┼────────────┼─────────┼──────┼────────┼────────────┼─────────┼──────┼────────┤ │ 00:00:01│ 00:00:01│378.85 ms│ 0.99│ 696409015│739.61 M│ 531985315│317.16 ms│ 84%│ 1.68 G│ 164423700│ 61.69 ms│ 16%│ 2.67 G│ │ 00:00:02│ 00:00:10│997.38 ms│ 0.11│ 1158080848│ 1.15 G│ 714229158│840.88 ms│ 84%│849.38 M│ 443851690│156.49 ms│ 16%│ 2.84 G│ │ 00:00:03│ 00:00:30│998.06 ms│ 0.05│ 71030255│ 70.95 M│ 56546115│949.91 ms│ 95%│ 59.53 M│ 14484140│ 48.15 ms│ 5%│300.84 M│ │ 00:00:04│ 00:00:49│997.34 ms│ 0.05│ 69869598│ 69.78 M│ 56185665│949.43 ms│ 95%│ 59.18 M│ 13683933│ 47.91 ms│ 5%│285.62 M│ │ 00:00:05│ 00:00:56│997.45 ms│ 0.16│ 3271646626│ 3.27 G│ 3244559622│967.68 ms│ 97%│ 3.35 G│ 27087004│ 29.77 ms│ 3%│910.00 M│ │ 00:00:06│ 00:00:57│997.85 ms│ 0.82│ 919200160│917.96 M│ 653789980│712.32 ms│ 71%│917.83 M│ 265410180│285.53 ms│ 29%│929.55 M│ │ 00:00:07│ 00:00:59│998.80 ms│ 0.41│ 603301058│603.17 M│ 305625523│566.57 ms│ 57%│539.43 M│ 297675535│432.24 ms│ 43%│688.69 M│ │ 00:00:08│ 00:00:60│999.04 ms│ 1.51│ 2209183348│ 2.21 G│ 1128067814│442.09 ms│ 44%│ 2.55 G│ 1081115534│556.95 ms│ 56%│ 1.94 G│
Here, first a probe-monitor is created, that gets the name pm0
by default.
The probe-monitor samples the probes each wallclock seconds, which is controlled by the
mode
and interval
arguments.
The -summary
flag means all probe values will be displayed
when the simulation stops, providing the session or current value
for the probes subscribed to, described later.
Next, the pm0.add-probe is issued with two probes using
the mode session
. If mode is not specified, it defaults
to delta
meaning the value presented for the probe is the
difference from the previous sample. That is, it shows the value for
the sample only. With the session
mode, it instead shows
the total value since the probe was added to the monitor. In this case,
the accumulated times, both in host wall-clock and the virtual time
of the simulated system is displayed.
Apart from session
and delta
there is also
the current
mode which can be selected, which displays the
plain probe value, without any adjustments. The current
mode is interesting for some probes, which are not monotonically
increasing, such as a temperature. It can also be interesting to be
used for probes derived from checkpointed state, for example the
global virtual time, when the user wants to see the absolute time.
Finally, before the execution is started we add more probes,
now using the default delta
mode. Here we are mixing
some global probes sim.*
and some processor specific
probes cpu.*
. Since there are two processors in the simulated system
used in this example, the number of all monitored probes is 14.
When the simulation is started, the probe-monitor starts to print out table rows for the probes being measured, one second between each sample. Probes which have an object associated will be sorted under that object, so here probes for the two processors have an additional heading showing where the probes belong to.
Some more detailed information on each column or probe, that was monitored in this example.
host.time.wallclock
can be used instead. The
time here is presented as hours, minutes and second format.
session
or
current
times are presented in hours, minutes and
second format.
A value of 0.5 means Simics simulation goes twice as fast as the simulated virtual system, while a figure of 2.0 means the simulation goes in half the speed compared to the simulated system.
sim.esteps
is the total of
all cpu.esteps
in the system.
sim.esteps /
sim.time.wallclock
. Note that, depending on the simulation
speed, other prefixes then M
is used each sample, for
example G
for GIPS, or k
for kIPS.
cpu.time.schedule / sim.time.schedule
This can be used to detect bottle-necks in the simulation, if
one processor stands for the majority of the time.
sim.mips
but is actually a
bit different. The processor specific MIPS number is calculated
as:
cpu.esteps / cpu.time.schedule
. This means that the
MIPS numbers here cannot be added together. Instead this gives
an indication of how fast this particular processor executes,
given the amount of time it got. This can be used to detect
sub-optimal processor simulation even if the processor runs at a
much lower frequency, and consequently is not scheduled as much.
When the simulation is finished, the probe-monitor shows a table of all the probes that are monitored. The table provides the current value for all probes, see figure 26 for the example output.
┌─────┬────────────┬────────────────────┬────────────────────────┬───────────────────────┐ │Row #│Display Name│ Probe Name │ Object │Session Formatted Value│ ├─────┼────────────┼────────────────────┼────────────────────────┼───────────────────────┤ │ 1│Wallclock │sim.time.wallclock │Global │ 00:00:08.16│ │ 2│Virtual-Time│sim.time.virtual │Global │ 00:01:00.00│ │ 3│Sched │sim.time.schedule │Global │ 00:00:07.57│ │ 4│Slowdown │sim.slowdown │Global │ 0.14│ │ 5│Esteps │sim.esteps │Global │ 9550122021│ │ 6│IPS │sim.mips │Global │ 1.17 G│ │ 7│Esteps │cpu.esteps │board.mb.cpu0.core[0][0]│ 6959267798│ │ 8│Sched │cpu.time.schedule │board.mb.cpu0.core[0][0]│ 00:00:05.88│ │ 9│Sched% │cpu.schedule_percent│board.mb.cpu0.core[0][0]│ 77.73%│ │ 10│IPS │cpu.mips │board.mb.cpu0.core[0][0]│ 1.18 G│ │ 11│Esteps │cpu.esteps │board.mb.cpu0.core[1][0]│ 2590854223│ │ 12│Sched │cpu.time.schedule │board.mb.cpu0.core[1][0]│ 00:00:01.69│ │ 13│Sched% │cpu.schedule_percent│board.mb.cpu0.core[1][0]│ 22.27%│ │ 14│IPS │cpu.mips │board.mb.cpu0.core[1][0]│ 1.54 G│ └─────┴────────────┴────────────────────┴────────────────────────┴───────────────────────┘
The Session Formatted Value represents the probe value
formatted accordingly to the probe properties. If probes have been
added with the current
mode then an additional Current
Formatted Value column is also displayed.
It is also possible to get the same results printed out with
the pm0.summary command, where it is possible to request
more floating point decimals to be presented with
the float-decimals
argument.
The pm0.status shows the settings of the probe-monitor, including which probes that are currently monitored. Probes can be removed with the pm0.remove-probe command and it is possible to change the sampling settings of the probe-monitor itself with the pm0.sampling-settings command.
While the probe-monitor prints out the table data while the simulation
is running, all data is also saved internally. To show the entire history of
all samples, the pm0.print-table can be used and the data
can also be saved into a .csv
with
the pm0.export-table-csv command. Any data in the csv
file will be unformatted, allowing easily import in a spreadsheet
for further analyses.