Developer Guide

  • 2021.2
  • 06/11/2021
  • Public
Contents

Accessing Full Measurement Log

To get full measurement results for post-processing, you can enable a measurement buffer and dump the data to a file.
This example shows how to enable a dump file in the writer application (
tcc_single_measurement_sample
) because the measurement library supports dump functionality via a combination of
TCC_MEASUREMENTS_BUFFERS
and
TCC_MEASUREMENTS_DUMP_FILE
environment variables. It is more common, however, to implement dump functionality in the reader application (
tcc_measurement_monitoring_sample
). In this release, the measurement monitoring sample does not support dumping, but you can implement it manually.
When enabling a dump file in the writer application (
tcc_single_measurement_sample
), make sure the buffer size specified in
TCC_MEASUREMENTS_BUFFERS
is the same as or more than the amount of data that will be written to it. If the buffer size is smaller, only the data that is in the buffer at the end of the application will be dumped.
To run this example:
  1. From your host system, open two terminal windows. In the first window, you will start running the monitoring sample per the next steps. Then, in the second window, you will run the single measurement sample as input into the monitoring sample.
  2. In the first terminal window, connect to the target system:
    ssh <user>@<target>
  3. In the SSH session, run the monitoring sample and leave it running. The sample will wait for you to start the single measurement sample in the next step.
    TCC_MEASUREMENTS_BUFFERS=Approximation:10 TCC_MEASUREMENTS_TIME_UNIT=ns tcc_measurement_monitoring_sample
    where:
    Argument
    Description
    TCC_MEASUREMENTS_BUFFERS=Approximation:10
    This environment variable specifies the measurement instance to collect:
    • “Approximation” is the measurement name defined in the
      __itt_string_handle_create
      call in the
      tcc_single_measurement_sample
      .
    • “10” is the maximum number of measurements that can be stored for this measurement instance.
    For more information about this environment variable, see Control Data Collection.
    TCC_MEASUREMENTS_TIME_UNIT=ns
    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_MEASUREMENTS_DUMP_FILE=log.txt tcc_single_measurement_sample --approximation 20 --iterations 10
    where:
    Argument
    Description
    TCC_MEASUREMENTS_BUFFERS=Approximation:10
    This environment variable matches the environment set in the
    tcc_measurement_monitoring_sample
    command.
    TCC_USE_SHARED_MEMORY=true
    Use a shared memory ring buffer instead of a local buffer to store all measurement results.
    TCC_MEASUREMENTS_DUMP_FILE=log.txt
    Store the measurement buffers in
    log.txt
    after the program finishes.
    tcc_single_measurement_sample --approximation 20 --iterations 10
    The sample will calculate the 20th approximation of 2/pi and run 10 times.
    For more information about these command-line options, see Command-Line Options.
  6. View the full measurement results after the sample finishes execution. Example dump file
    log.txt
    :
    # cat log.txt Approximation: 644, 573, 527, 521, 521, 527, 521, 517, 525, 517

Product and Performance Information

1

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