Function gpa::metrics::CreateMetricsSource

Function Documentation

IMetricsSource *gpa::metrics::CreateMetricsSource(MetricsSourceData *pMetricsSourceData, char *pErrorMessage = nullptr, uint32_t errorSize = 0)

Creates and initializes a MetricsSource object.

Note

If the desired type is MetricsSourceType::kQueryBased_IntelMD or MetricsSourceType::kTimeBased_IntelMD (in other words, Intel MD library based), the LinkAndPrepareForMdApiSourceUsage function must have been previously called. If unsure and using kQueryBased_Unspecified, call LinkAndPrepareForMdApiSourceUsage in advance if the desired ideal is to use the Intel MD library based implementation.

Parameters
  • pMetricsSourceData -- [in] Pointer to struct describing the specific type of metrics source to create and initialize.

  • pErrorMessage -- [inout] Optional pointer to char buffer that will be initialized upon failure to the reason it occurred.

  • errorSize -- [in] Size of provided char buffer in bytes.

Returns

Upon success, a pointer to the created MetricsSource instance is returned. Otherwise, nullptr is returned and if pErrorMessage is non-null, it will contain the cause of the failure.