System Response Time Measurement (SRTM) Sample
The SRTM (System Response Time Measurement) sample measures real-time timer delivery latencies using a periodic wRTOS timer driven by the fastest available clock. It calculates and logs latency statistics, including minimum, maximum, and average latency, and optionally displays a histogram of latency distribution. This tool helps evaluate the precision and consistency of timer delivery, which is critical for validating system real-time responsiveness.
The sample supports multi-instance execution via shared memory, allowing simultaneous sampling across multiple processors. Optionally, the sample can also output to shared memory for analysis by external tools, such as wRTOS Analyzer.
Source Files
| File | Description |
|---|---|
srtm.c
|
The source file gathers thread-level timer latencies (either as a Win32 or RTSS process) and prints out a summary and an optional histogram of results. This is a useful tool for measuring application-level response time latencies. At the same time, the system is stressed by other activity, such as disk, network, and GUI IO, and/or heavy processing. You can also compare different hardware platforms. |
Building the Sample
Build the sample using any of the four supported build configurations: Release, Debug (Windows) or RTSSDebug, RTSSRelease (RTSS). See Usage for additional options.
Running the Sample
Run the sample. See Usage for additional options.
Usage
srtm | srtm [/?] [/h] [/1] [/f] seconds_to_sample
Options
/h
Display histogram (in addition to summary).
/1
Use a 10 MS timer period (default is 1 MS).
/f
Use fastest available timer (1MS or better).
/n num
Multiple SRTM instances aware (num = the total number of instances).
/m name
Output latency data to shared memory region name (for external tools).
/?
Help on usage.
To run a single instance:
Rtssrun srtm.rtss /h /f 15
To run multiple instances on different processors:
Rtssrun srtm.rtss /n 4 /h /f 15
Repeat the above command up to 4 times (ideally from different command prompts) to run each instance.
To integrate with wRTOS Analyzer via shared memory:
Rtssrun srtm.rtss /m SharedMemName 15
If no parameters are given, the sample will run with this command:
srtm /h /f 15
Expected Results
- Summary statistics per processor, including:
- Total timer ticks sampled
- Minimum, maximum, and average latencies (in microseconds)
- Overrun count (latencies exceeding timer period)
- Additional info if latencies exceeded two timer periods
- Optional histogram (if /h flag used):
- Distribution of timer delivery latencies, in microseconds, grouped into buckets.
- Multi-instance mode coordinates between instances and reports processor-specific results in order.
Unexpected Results
- High overrun or out-of-range latency counts.
- Incorrect multi-instance sync.
APIs Referenced
|
RTAPI |
|---|
See Also: