diff options
author | Drew Richardson <drew.richardson@arm.com> | 2015-07-22 12:00:00 -0700 |
---|---|---|
committer | Drew Richardson <drew.richardson@arm.com> | 2015-07-24 07:41:39 -0700 |
commit | 7ca6004c0b05138c49b9b21e0045487f55a60ab6 (patch) | |
tree | 74cdc2c608e28891189b58e68992b3a8acf140e0 /daemon/ConfigurationXML.cpp | |
parent | c2fdcde9f26fff5eebbcc2ab34adb9d4202e0d55 (diff) |
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Diffstat (limited to 'daemon/ConfigurationXML.cpp')
-rw-r--r-- | daemon/ConfigurationXML.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/daemon/ConfigurationXML.cpp b/daemon/ConfigurationXML.cpp index be224a4..b433811 100644 --- a/daemon/ConfigurationXML.cpp +++ b/daemon/ConfigurationXML.cpp @@ -68,8 +68,10 @@ int ConfigurationXML::parse(const char* configurationXML) { mxml_node_t *tree, *node; int ret; - // clear counter overflow - gSessionData->mCounterOverflow = 0; + if (gSessionData->mCountersError != NULL) { + free(gSessionData->mCountersError); + gSessionData->mCountersError = NULL; + } gSessionData->mIsEBS = false; mIndex = 0; @@ -98,6 +100,14 @@ int ConfigurationXML::parse(const char* configurationXML) { mxmlDelete(tree); + if (gSessionData->mCountersError == NULL && mIndex > MAX_PERFORMANCE_COUNTERS) { + if (asprintf(&gSessionData->mCountersError, "Only %i performance counters are permitted, %i are selected", MAX_PERFORMANCE_COUNTERS, mIndex) <= 0) { + logg->logError("asprintf failed"); + handleException(); + } + } + gSessionData->mCcnDriver.validateCounters(); + return ret; } @@ -149,7 +159,6 @@ void ConfigurationXML::configurationTag(mxml_node_t *node) { // handle all other performance counters if (mIndex >= MAX_PERFORMANCE_COUNTERS) { mIndex++; - gSessionData->mCounterOverflow = mIndex; return; } |