void DomainPerformanceControlBase::sendActivityLoggingDataIfEnabled(UIntN participantIndex, UIntN domainIndex) { try { if (isActivityLoggingEnabled() == true) { UInt32 performanceControlIndex = getCurrentPerformanceControlIndex(participantIndex, domainIndex); if (performanceControlIndex == Constants::Invalid) { performanceControlIndex = 0; } EsifCapabilityData capability; capability.type = ESIF_CAPABILITY_TYPE_PERF_CONTROL; capability.size = sizeof(capability); capability.data.performanceControl.pStateLimit = performanceControlIndex; capability.data.performanceControl.lowerLimit = getPerformanceControlDynamicCaps(participantIndex, domainIndex).getCurrentLowerLimitIndex(); capability.data.performanceControl.upperLimit = getPerformanceControlDynamicCaps(participantIndex, domainIndex).getCurrentUpperLimitIndex(); getParticipantServices()->sendDptfEvent(ParticipantEvent::DptfParticipantControlAction, domainIndex, Capability::getEsifDataFromCapabilityData(&capability)); } } catch (...) { // skip if there are any issue in sending log data } }
void DomainPerformanceControl_002::throwIfPerformanceControlIndexIsOutOfBounds(UIntN domainIndex, UIntN performanceControlIndex) { auto controlSetSize = getPerformanceControlSet(getParticipantIndex(), domainIndex).getCount(); if (performanceControlIndex >= controlSetSize) { std::stringstream infoMessage; infoMessage << "Control index out of control set bounds." << std::endl << "Desired Index : " << performanceControlIndex << std::endl << "PerformanceControlSet size :" << controlSetSize << std::endl; throw dptf_exception(infoMessage.str()); } auto caps = getPerformanceControlDynamicCaps(getParticipantIndex(), domainIndex); if (performanceControlIndex < caps.getCurrentUpperLimitIndex() || performanceControlIndex > caps.getCurrentLowerLimitIndex()) { std::stringstream infoMessage; infoMessage << "Got a performance control index that was outside the allowable range." << std::endl << "Desired Index : " << performanceControlIndex << std::endl << "Upper Limit Index : " << caps.getCurrentUpperLimitIndex() << std::endl << "Lower Limit Index : " << caps.getCurrentLowerLimitIndex() << std::endl; throw dptf_exception(infoMessage.str()); } }
std::shared_ptr<XmlNode> DomainPerformanceControl_002::getXml(UIntN domainIndex) { auto root = XmlNode::createWrapperElement("performance_control"); root->addChild(getPerformanceControlStatus(getParticipantIndex(), domainIndex).getXml()); root->addChild(getPerformanceControlDynamicCaps(getParticipantIndex(), domainIndex).getXml()); root->addChild(getPerformanceControlStaticCaps(getParticipantIndex(), domainIndex).getXml()); root->addChild(getPerformanceControlSet(getParticipantIndex(), domainIndex).getXml()); root->addChild(XmlNode::createDataElement("control_knob_version", "002")); return root; }
void DomainPerformanceControl_003::capture(void) { try { m_initialStatus.set(getPerformanceControlDynamicCaps(getParticipantIndex(), getDomainIndex())); } catch (dptf_exception& e) { m_initialStatus.invalidate(); std::string warningMsg = e.what(); getParticipantServices()->writeMessageWarning(ParticipantMessage( FLF, "Failed to get the initial graphics performance control dynamic capabilities. " + warningMsg)); } }
void DomainPerformanceControl_002::capture(void) { try { m_initialStatus.set(getPerformanceControlDynamicCaps(getParticipantIndex(), getDomainIndex())); getParticipantServices()->writeMessageDebug(ParticipantMessage( FLF, "Initial performance capabilities are captured. MIN = " + StlOverride::to_string(m_initialStatus.get().getCurrentLowerLimitIndex()) + " & MAX = " + StlOverride::to_string(m_initialStatus.get().getCurrentUpperLimitIndex()))); } catch (dptf_exception& e) { m_initialStatus.invalidate(); std::string warningMsg = e.what(); getParticipantServices()->writeMessageWarning(ParticipantMessage( FLF, "Failed to get the initial processor performance control dynamic capabilities. " + warningMsg)); } }