Intel® VTune™ Amplifier XE and Intel® VTune™ Amplifier for Systems Help

Creating a CSV File with External Data

Intel® VTune™ Amplifier can process and integrate performance statistics collected externally with a Using a Custom Collector or with your target application in parallel with the native VTune Amplifier analysis. To achieve this, provide the collected custom data as a csv file with a predefined structure and save this file to the VTune Amplifier result directory.

VTune Amplifier can load and process the following data types:

To make the VTune Amplifier interpret the custom statistics from the csv file, make sure the file format meets the following requirements:

File Name

csv filename should specify the hostname where your custom collector gathered the data, following these format requirements:

Filename format:[user-defined]-hostname-<hostname-of-system>.csv

Where:

Example:phases-hostname-octagon53.csv

Note

If the hostname in the csv file name is not specified or specified incorrectly, the VTune Amplifier displays the imported data with the following limitations:

  • Event timestamps are represented in the UTC format.

  • Only global data (not attributed to specific threads/processes) are displayed.

Format for Interval Values

Interval data may be optionally bound to a thread ID. VTune Amplifier represents data not bound to a particular thread (there are no TID values in the csv file) as Interpreting Frame Data. Data bound to a thread (there are TID values in the csv file) is represented as Interpreting User Task Analysis Data .

For imported interval values, use 5 columns, where the order of columns is important:

name,start_tsc.[QPC|CLOCK_MONOTONIC_RAW|RDTSC|UTC],end_tsc,[pid],[tid]

Column Name

Description

name

Name of an event.

start_tsc.[QPC|CLOCK_MONOTONIC_RAW|RDTSC|UTC]

Event start timestamp. This column name has a QPC|CLOCK_MONOTONIC_RAW, RDTSC or UTC suffix that indicates the type of a timestamp counter:

  • Specify QPC (QueryPerformanceCounter) on Windows* OS if the performance counter is used and specify CLOCK_MONOTONIC_RAW on Linux* OS if clock_gettime(CLOCK_MONOTONIC_RAW) is used.

  • Specify RDTSC if the RDTSC counter is used. To obtain RDTSC:

    • For Microsoft* Compiler and Intel® Compiler, use _rdtsc() intrinsic

    • For GCC* compiler, copy the following function to your code and call it where necessary:

    #include <stdint.h>
    int64_t rdtsc()
    {
        int64_t    tstamp;
    
    #if defined(__x86_64__)
        asm(    "rdtsc\n\t"
                "shlq   $32,%%rdx\n\t"
                "or     %%rax,%%rdx\n\t"
                "movq   %%rdx,%0\n\t"
                : "=g"(tstamp)
                :
                : "rax", "rdx" );
    #elif defined(__i386__)
        asm( "rdtsc\n": "=A"(tstamp) );
    #else
    #error NYI
    #endif
        return tstamp;
    }
    
  • Specify UTC if date and time is used. Expected format is YYYY-MM-DD hh:mm:ss.sssss, where the number of decimal digits is arbitrary.

end_tsc

Event end timestamp.

pid

Process ID, provided optionally. Absence of a value in this field does not affect how a result is imported except for extremely rare cases when the following conditions are all met:

  • Thread ID is reused by the operating system within the collection time frame.

  • Different threads with the same thread ID generate records for thecsv file.

  • Timestamps are inaccurate and data may be attributed to more than one thread with the same thread ID.

You may specify this field as an empty value within the data, or skip it from both file header and data entirely.

tid

Thread ID, provided optionally. If a value is specified in this field, the interval will be interpreted as a Task; otherwise, interval will be interpreted and shown as a Frame.

You may specify this field as an empty value within the data, or skip it from both file header and data entirely.

Examples of CSV Format and Imported Data

Format for Discrete Values

You can import two types of discrete values:

The following format is required:

tsc.[QPC|CLOCK_MONOTONIC_RAW|RDTSC|UTC],CounterName1.COUNT|INST[,CounterName2.COUNT|INST],[pid],[tid]

Column Name

Description

tsc.[QPC|CLOCK_MONOTONIC_RAW|RDTSC|UTC]

Event start timestamp. This column has a QPC|CLOCK_MONOTONIC_RAW, RDTSC, or UTC suffix that indicates the type of a timestamp counter:

  • Specify QPC (QueryPerformanceCounter) on Windows* OS if the performance counter is used and specify CLOCK_MONOTONIC_RAW on Linux* OS if clock_gettime(CLOCK_MONOTONIC_RAW) is used.

  • Specify RDTSC if the RDTSC counter is used. Use __rdtsc() intrinsic to obtain RDTSC on Windows. To obtain RDTSC on Linux, copy the following function to your code and call it where necessary:

    #include <stdint.h>
    int64_t rdtsc()
    {
        int64_t    tstamp;
    
    #if defined(__x86_64__)
        asm(    "rdtsc\n\t"
                "shlq   $32,%%rdx\n\t"
                "or     %%rax,%%rdx\n\t"
                "movq   %%rdx,%0\n\t"
                : "=g"(tstamp)
                :
                : "rax", "rdx" );
    #elif defined(__i386__)
        asm( "rdtsc\n", "=A"(tstamp) );
    #else
    #error NYI
    #endif
        return tstamp;
    }
    
  • Specify UTC if date and time is used. Expected format is YYYY-MM-DD hh:mm:ss.sssss, where the number of decimal digits is arbitrary.

CounterName1

Name of the event. Each counter has a separate column. COUNT suffix is used to specify a cumulative counter value. INST suffix is used to specify instantaneous counter values.

pid

Process ID, provided optionally. Absence of a value in this field does not affect how a result is imported except for extremely rare cases when the following conditions are all met:

  • Thread ID is reused by the operating system within the collection time frame.

  • Different threads with the same thread ID generate records for thecsv file.

  • Timestamps are inaccurate and data may be attributed to more than one thread with the same thread ID.

You may specify this field as an empty value within the data, or skip it from both file header and data entirely.

tid

Thread ID, provided optionally. If a value is specified in this field, the interval will be interpreted as a Task; otherwise, interval will be interpreted and shown as a Frame.

You may specify this field as an empty value within the data, or skip it from both file header and data entirely.

Examples of CSV Format and Imported Data

Additional Requirements

See Also