Developer Guide

  • 2021.2
  • 06/11/2021
  • Public

Create a Histogram

You can run the measurement analysis sample to create a histogram based on data collected from a real-time application. The real-time application must be instrumented with measurement library APIs.
In this mode, the analysis sample runs the instrumented application. Internally, the analysis sample runs the instrumented application with the
environment variable so the results are written to a dump file (for more information about creating a dump file for
, see Accessing Full Measurement Log). After the instrumented application completes successfully, the analysis sample reads the data from the dump file and generates the histogram. This type of analysis is called post-process analysis.
The analysis sample creates a histogram for the specified measurement instance from the instrumented application. 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.
The following example histograms are based on data collected from the multiple measurements sample (
To run this example:
  1. From your host system, connect to the target system:
    ssh <user>@<target>
  2. In the SSH session
    , run the sample:
    tcc_measurement_analysis_sample hist "Multiplication:1000" -time-units us -- tcc_multiple_measurements_sample --approximation 10000 --multiplication 100 --iterations 1000
This argument specifies the measurement instance to collect:
  • “Multiplication” is the measurement name defined in the
    call in the
  • “1000” is the buffer size – the maximum number of measurements that can be stored for this measurement instance. The size matches the number of iterations specified in the
    command. To ensure all measurement results are stored, update the buffer size if you change the number of iterations when running the sample.
This argument has the same format as the
environment variable. See Control Data Collection.
-time-units us
The output will display results in microseconds.
Separates the measurement analysis sample command from the real-time application command. For more information about the command-line options of
, see Command-Line Options.
Output Example
The sample prints the output of the profiled application and the profiling results. The profiling output contains a histogram for the measurement instance specified in the
The profiling output includes the following:
  • Histogram name based on the name of the measurement instance (“Multiplication” histogram)
  • The table representing:
    • Latency Ranges: Ranges of recorded execution times. The number of ranges is dynamic and depends logarithmically on the number of measurements.
    • Count: Number of iterations that fall into each latency range
    • Histogram: Visual representation of the corresponding count
  • Total counts: Total number of iterations shown in the histogram
  • Average execution time of the iterations
  • Deviation from the average
APPLICATION OUTPUT: Running with arguments: approximation = 10000, multiplication = 100, iterations = 1000 Running workloads. This may take a while, depending on iteration values. Workloads were run successfully. ------------------------------ PROFILING OUTPUT: ------------------------------------------------------------------------------------------------------------------------------- "Multiplication" histogram Latency Ranges [us] Count Histogram (1896, 1898) 16 | (1898, 1900) 65 |||| (1900, 1902) 144 ||||||||| (1902, 1904) 251 ||||||||||||||| (1904, 1906) 294 |||||||||||||||||| (1906, 1908) 171 |||||||||| (1908, 1910) 50 ||| (1910, 1912) 7 | (1912, 1914) 1 | (1914, 1916) 0 (1916, 1918) 0 (1918, 1920) 0 (1920, 1922) 0 (1922, 1924) 0 (1924, 1926) 0 (1926, 1928) 0 (1928, 1930) 1 | Total counts: 1000 Avg. Value: 1904 Std. Deviation: 2

Product and Performance Information


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