Skip to content

GpaEnableCounterByName

Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All rights reserved.

Syntax

GpaStatus GpaEnableCounterByName(
GpaSessionId session_id,
const char* counter_name);

Description

Enables the counter with the specified counter name (case insensitive). Subsequent sampling sessions will provide values for any enabled counters. Initially all counters are disabled, and must explicitly be enabled.

Parameters

NameDescription
session_idUnique identifier of a previously-created session.
counter_nameThe name of the counter to enable.

Return value

Return valueDescription
kGpaStatusOkThe specified counter was successfully enabled.
kGpaStatusErrorGpaNotInitializedGPA was not initialized. Call GpaInitialize before all other entrypoints.
kGpaStatusErrorNullPointerThe supplied session_id parameter is NULL.
kGpaStatusErrorSessionNotFoundThe supplied session_id parameter was not recognized as a previously-created session identifier.
kGpaStatusErrorCannotChangeCountersWhenSamplingThe set of enabled counters cannot be changed after GpaBeginSession is called.
kGpaStatusErrorContextNotOpenThe supplied session’s parent context is not currently open.
kGpaStatusErrorAlreadyEnabledThe specified counter was already enabled.
kGpaStatusErrorIncompatibleSampleTypesThe supplied session was not created with a GpaSessionSampleType value that supports counter collection.
kGpaStatusErrorCounterNotFoundThe specified counter name is not valid.
kGpaStatusErrorFailedAn error occurred while trying to enable the counter.
kGpaStatusErrorExceptionException occurred.