Previous: Targeted Sampling, Up: Sampling


3.7 Sampling and Trace Mode RTIs

The RTIs below control sampling and trace mode.

— RTI: int trace_mode ON

If ON is 0 (the default, called timing mode), use timing simulation for warmup and sample modes. If ON is 1, use functional simulation for sample mode and don't use warmup mode at all. Trace mode is much faster than timing mode but no timing data is available. In trace mode and during sample mode procedures hooked to proc->at_trace_insn_finish will be called after each instruction. See ez_trace.cc for an example.

— RTI: double timing_sim_after_insn start_at

Start data collection at instruction number start_at. Default value is zero (start data collection at first instruction). Ignored when performing targeted sampling (see ss_target_spec). See Single Sample for an example of its use in single-sample simulation and Periodic Sampling for an example of its use in periodic sampling simulation. It is not used for targeted simulation.

— RTI: double commit_limit stop_at

Stop simulation after stop_at instructions committed. Default value is 1e20 (one hundred quintillion). This RTI should only be used in single-sample simulations. See Single Sample for an example of its use in single-sample simulation. It should not be used for other sampling schemes.

— RTI: int ss_sample_period period

If periodic sampling turned on, start samples every period instructions. (Start of first sample specified by timing_sim_after_insn.) Periodic sampling is turned on if ss_target_spec is blank and if period is greater than the value of ss_sample_size. Default value is 1e6. See Periodic Sampling for an example of its use.

— RTI: int ss_sample_size size

Set number of instructions in sample to size. Default value is 1e6. Honored for periodic and targeted sampling. See ss_sample_period. See Periodic Sampling and Targeted Sampling for examples.

— RTI: int ss_warmup_size warmup_size

Start warmup mode warmup_size instructions before each sample, at beginning of simulation, or at end of last sample, whichever is latest. Default value is 10000. Honored for all sampling schemes (single, periodic, targeted). See Single Sample, Periodic Sampling, and Targeted Sampling for examples.

— RTI: char* ss_target_spec item1:item2...

Perform targeted simulation as indicated by items. If the value of this RTI is blank don't perform targeted simulation. Each item consists of a letter followed by a floating-point number or string, items are separated by a colon (:).

An item can specify a name (nNAME), a sample start time (sSTART), a sample weight (wWEIGHT), benchmark end (eEND), or a convenience multiplier (mMULT).

The items are read in order, when a weight or multiplier item is encountered the respective values are recorded for use on following (but not preceding) samples. Before a weight item is encountered a 1 is used for WEIGHT, likewise for MULT.

The first name item is used to specify a name for the set of samples, the name is printed in the simulator output but is not otherwise used by the simulator. (If a name item is not specified then Anonymous is used as the name.) It is hoped that sample sets will be carefully developed, tuned, and documented. Subsequent name items are ignored but may be used in the future to label samples.

When a start-time sample is encountered the simulator will be set to start a sample at time MULT * START, data from that sample will be scaled by WEIGHT. Either ss_target_spec is blank, or the last item must be a benchmark end, and the number of instructions encountered during simulation must be within FUZZ instructions of END * MULT, where FUZZ = max(1000, END * MULT * 0.00004).

Samples must be specified in order and cannot overlap.

Example: nstandard-sparse-1.0:w2:m1000:s500:w3:s1800:m1:e1874500. This specifies two samples. One starts at instruction 500000, the other starts at instruction 1800000. The benchmark is expected to end less than 1000 instructions before 1874500. Data from the first sample will have weight 2, meaning, for example, that if 20 L2 cache misses were encountered during the sample the number used for collecting data will be 40. The simulator will show the name “standard-sparse-1.0” for this set of samples.

See Targeted Sampling for more information.