Developer Guide

  • 2021.1
  • 11/03/2021
  • Public

Monitor Measurements and Deadline Violations

You can run the measurement monitoring sample to monitor measurements and track deadline violations based on data collected from the single measurement sample (
In this mode, the monitoring sample starts first and waits for the single measurement sample to start. After the single measurement sample starts, the monitoring sample attaches to the shared memory buffer and starts reading the latency data that
placed there. The monitoring sample compares the data to the deadline. The sample prints each latency measurement and indicates whether it exceeded the deadline. This type of analysis is called “online” monitoring. This means that the results are constantly read from the shared memory buffer where they are placed by the
The monitoring sample monitors the specified measurement instances from
. A
measurement instance
refers to the measurement library APIs that you have added to your application to measure the latency of the real-time cycle or any part of it. For more information about instrumenting your code with measurement library APIs, see Instrument the Code.
To run this example:
  1. From your host system, open two terminal windows.
  2. In the first terminal window, connect to the target system:
    ssh <user>@<target>
  3. In the SSH session, run the monitoring sample. The sample will wait for you to start the single measurement sample.
    TCC_MEASUREMENTS_BUFFERS=Approximation:10:2500 TCC_MEASUREMENTS_TIME_UNIT=ns tcc_measurement_monitoring_sample
    This argument specifies the measurement instance to collect:
    • “Approximation” is the measurement name defined in the
      call in the
    • “10” is the maximum number of measurements that can be stored for this measurement instance.
    • “2500” is the deadline in time units specified in TCC_MEASUREMENTS_TIME_UNIT.
    The deadline is specified in nanoseconds and print measured latencies in nanoseconds
    For more information about this environment variable, see Control Data Collection.
  4. In the second terminal window, connect to the target system:
    ssh <user>@<target>
  5. Start the single measurement sample:
    TCC_MEASUREMENTS_BUFFERS=Approximation:10 TCC_USE_SHARED_MEMORY=true tcc_single_measurement_sample -a 20 --iterations 10 --outliers
    This argument matches the measurement name and buffer size in the
    Use a shared memory ring buffer instead of a local buffer to store all measurement results.
    tcc_single_measurement_sample -a 20 --iterations 10 --outliers
    The sample will calculate the 20th approximation of 2/pi, run 10 times, and generate latency outliers.
    For more information about these command-line options, see Command-Line Options.
  6. Go back to the first terminal. You should see that the monitoring sample is printing latency measurements and deadline violations, if any.
Example Output
This sample prints profiling results of the profiled application.
The profiling output includes the following:
  • Informational message with monitoring settings (measurement instance name and maximum number of measurements that can be stored)
  • List of measurement results with deadline violations
  • Summary:
    • Number of measurements that exceeded the deadline
    • Count of read data: Total number of measurements
Initializing monitoring for "Approximation", buffer size 10 Approximation: 366343738 CPU cycles (130687691 ns) Latency exceeding deadline: 366343738 CPU cycles (130687691 ns) Approximation: 584 CPU cycles (208 ns) Approximation: 534 CPU cycles (190 ns) Approximation: 537 CPU cycles (191 ns) Approximation: 539 CPU cycles (192 ns) Approximation: 366588744 CPU cycles (130775094 ns) Latency exceeding deadline: 366588744 CPU cycles (130775094 ns) Approximation: 536 CPU cycles (191 ns) Approximation: 535 CPU cycles (190 ns) Approximation: 536 CPU cycles (191 ns) Approximation: 541 CPU cycles (192 ns) Deadline: 7008 CPU cycles (2500 ns) Number of exceeding deadlines: 2 of 10 Count of read data: 10 Finishing monitoring

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at