Developer Guide

  • 2021.2
  • 06/11/2021
  • Public

About the Sample

The measurement analysis sample (
) is an example of a profiling application that can analyze data collected from real-time applications instrumented with the Measurement Library. The sample is ready to use with any instrumented application, or you can copy and modify it for your needs.
The sample demonstrates the following types of analysis:
  • Creating histograms of collected data
    The sample demonstrates how to collect the data from an instrumented application and create histograms. The sample can collect data from one or more measurement instances in the instrumented application.
  • Monitoring measurements and deadline violations
    The sample demonstrates how to monitor measurements and/or deadline violations for one or more measurement instances in an instrumented application.
The sample is a universal instrument for measurement library data analysis, written in Python for convenience. You can use the sample as is to analyze real data from any application instrumented with the Measurement Library. It can also serve as a basis for creating your own analysis of measurement data.

Histogram Mode

In the histogram mode, the analysis sample post-processes the measurement results. This means that the analysis sample runs the instrumented application, waits until it is finished, loads the collected data from the dump file, and then runs the analysis and shows the histogram.
The dump file is created in the current directory, so it needs to have write permissions. The dump file can contain the measurement results for all iterations of the instrumented workload or for a subset of iterations, depending on the number of iterations and the buffer size. If the buffer size is smaller than the number of iterations, the histogram will only show a subset of all measurements.
Understanding the Histogram
The histogram represents the distribution of measured latencies through multiple bins ranging from minimum to maximum execution time. By looking at the histogram, you can see the relative frequency of measured latencies that fall into different latency ranges, and as a result decide the optimization methods to reduce the maximum latency and improve the determinism of the workload execution. As an example, for short workloads, latency outliers far outside the main peak of the distribution often mean processing of interrupts that interferes with the main flow of workload execution.

Monitoring Mode

The histogram mode is limited in the amount of data it can analyze as more data requires more system memory allocated for the buffers. The monitoring mode overcomes this limitation by processing the results while the instrumented application is running, rather than waiting for a dump file to be generated. This means that the results are constantly read from the shared memory where they are placed by the instrumented workload.
The analysis sample runs the instrumented application, attaches to the shared memory buffer(s), and starts reading latency data. After the application is finished, the analysis sample also stops. The processing of the received data by the analysis sample is pretty basic, it just displays the results and compares them with the deadline value to determine deadline misses.

Running with Noisy Neighbor

In many real-world cases, the real-time workload runs together with other applications, which may interfere with the system cache used by the real-time workload. To analyze the behavior of an instrumented application in such “loaded” conditions, the analysis sample can run a separate cache stressing application (Linux program
) on a selected core together with the instrumented application.

Product and Performance Information


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