Developer Guide

  • 2021.2
  • 06/11/2021
  • Public
Contents

Create a Histogram from Multiple Measurement Instances

If your application has multiple measurement instances, you can create histograms for all of them in one report and compare latency distributions.
You can run the measurement analysis sample to create multiple histograms based on data collected from a real-time application during application run. 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
TCC_MEASUREMENTS_DUMP_FILE=<application_name>.hist
environment variable so the results are written to a dump file (for more information about creating a dump file for
tcc_multiple_measurements_sample
, 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 sample creates histograms for the specified measurement instances from the real-time 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. An application can have multiple measurement instances, each one tracking a different stage of the cycle, for example, input, compute, and output. 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 (
tcc_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,Approximation:1000,Cycle:1000" -time-units us -- tcc_multiple_measurements_sample --approximation 10000 --multiplication 100 --iterations 1000
where:
Argument
Description
Multiplication:1000,Approximation:1000,Cycle:1000
This argument specifies the measurement instances to collect. Each measurement instance is separated by a comma.
  • “Multiplication”, “Approximation”, and “Cycle” are the measurement names defined in the
    __itt_string_handle_create
    call in the
    tcc_multiple_measurements_sample
    .
  • “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
    tcc_multiple_measurements_sample
    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
TCC_MEASUREMENTS_BUFFERS
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
tcc_multiple_measurements_sample
, 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 each measurement instance specified in the
hist
command.
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: ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- "Cycle" histogram Latency Ranges [us] Count Histogram (1981, 1982) 34 || (1982, 1983) 92 ||||||| (1983, 1984) 200 ||||||||||||||||| (1984, 1985) 267 |||||||||||||||||||||| (1985, 1986) 198 ||||||||||||||||| (1986, 1987) 128 ||||||||||| (1987, 1988) 47 |||| (1988, 1989) 20 | (1989, 1990) 4 | (1990, 1991) 2 | (1991, 1992) 2 | (1992, 1993) 1 | (1993, 1994) 1 | (1994, 1995) 1 | (1995, 1996) 0 (1996, 1997) 0 (1997, 1998) 1 | (1998, 1999) 0 (1999, 2000) 0 (2000, 2001) 1 | (2001, 2002) 0 (2002, 2003) 0 (2003, 2004) 0 (2004, 2005) 0 (2005, 2006) 0 (2006, 2007) 0 (2007, 2008) 0 (2008, 2009) 0 (2009, 2010) 0 (2010, 2011) 0 (2011, 2012) 1 | Total counts: 1000 Avg. Value: 1985 Std. Deviation: 1 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- "Approximation" histogram Latency Ranges [us] Count Histogram (81, 82) 915 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| (82, 83) 34 || (83, 84) 23 | (84, 85) 26 || (85, 86) 1 | (86, 87) 1 | Total counts: 1000 Avg. Value: 82 Std. Deviation: 0 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- "Multiplication" histogram Latency Ranges [us] Count Histogram (1897, 1898) 6 | (1898, 1899) 25 || (1899, 1900) 69 ||||| (1900, 1901) 148 |||||||||||| (1901, 1902) 225 ||||||||||||||||||| (1902, 1903) 249 ||||||||||||||||||||| (1903, 1904) 154 ||||||||||||| (1904, 1905) 80 |||||| (1905, 1906) 27 || (1906, 1907) 8 | (1907, 1908) 0 (1908, 1909) 2 | (1909, 1910) 1 | (1910, 1911) 1 | (1911, 1912) 1 | (1912, 1913) 1 | (1913, 1914) 0 (1914, 1915) 1 | (1915, 1916) 0 (1916, 1917) 0 (1917, 1918) 0 (1918, 1919) 1 | (1919, 1920) 0 (1920, 1921) 0 (1921, 1922) 0 (1922, 1923) 0 (1923, 1924) 0 (1924, 1925) 0 (1925, 1926) 0 (1926, 1927) 0 (1927, 1928) 0 (1928, 1929) 1 | Total counts: 1000 Avg. Value: 1902 Std. Deviation: 2

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.