aboutsummaryrefslogtreecommitdiff
path: root/daemon/SessionData.cpp
diff options
context:
space:
mode:
authorDrew Richardson <drew.richardson@arm.com>2012-03-01 12:00:00 -0800
committerDrew Richardson <drew.richardson@arm.com>2014-12-19 15:24:06 -0800
commit3de04f9cecf0d50e895f9fe0164ecbbbae997319 (patch)
tree9bc04b0b4ad5b313559479d6bd12942961017b7d /daemon/SessionData.cpp
parent689b7539711ab098911503808cc3e24307d9bcf7 (diff)
gator: Version 5.95.9
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Diffstat (limited to 'daemon/SessionData.cpp')
-rw-r--r--daemon/SessionData.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/daemon/SessionData.cpp b/daemon/SessionData.cpp
index f84253a..4adcfcd 100644
--- a/daemon/SessionData.cpp
+++ b/daemon/SessionData.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (C) ARM Limited 2010-2011. All rights reserved.
+ * Copyright (C) ARM Limited 2010-2012. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -12,7 +12,7 @@
#include "Logging.h"
extern void handleException();
-SessionData gSessionData;
+SessionData* gSessionData = NULL;
SessionData::SessionData() {
initialize();
@@ -27,6 +27,7 @@ void SessionData::initialize() {
mLocalCapture = false;
mOneShot = false;
strcpy(mCoreName, "unknown");
+ configurationXMLPath = NULL;
apcDir = NULL;
mSampleRate = 0;
mDuration = 0;
@@ -34,6 +35,8 @@ void SessionData::initialize() {
mBacktraceDepth = 0;
mTotalBufferSize = 0;
mCores = 1;
+
+ initializeCounters();
}
void SessionData::initializeCounters() {
@@ -62,39 +65,39 @@ void SessionData::parseSessionXML(char* xmlString) {
if (session.parameters.output_path == 0 && session.parameters.target_path == 0) {
logg->logError(__FILE__, __LINE__, "No capture path (target or host) was provided.");
handleException();
- } else if (gSessionData.mLocalCapture && session.parameters.target_path == 0) {
+ } else if (gSessionData->mLocalCapture && session.parameters.target_path == 0) {
logg->logError(__FILE__, __LINE__, "Missing target_path tag in session xml required for a local capture.");
handleException();
}
// Set session data values
if (strcmp(session.parameters.sample_rate, "high") == 0) {
- gSessionData.mSampleRate = 10000;
+ gSessionData->mSampleRate = 10000;
} else if (strcmp(session.parameters.sample_rate, "normal") == 0) {
- gSessionData.mSampleRate = 1000;
+ gSessionData->mSampleRate = 1000;
} else { // "low"
- gSessionData.mSampleRate = 100;
+ gSessionData->mSampleRate = 100;
}
- gSessionData.mBacktraceDepth = session.parameters.call_stack_unwinding == true ? 128 : 0;
- gSessionData.mDuration = session.parameters.duration;
+ gSessionData->mBacktraceDepth = session.parameters.call_stack_unwinding == true ? 128 : 0;
+ gSessionData->mDuration = session.parameters.duration;
// Determine buffer size (in MB) based on buffer mode
- gSessionData.mOneShot = true;
+ gSessionData->mOneShot = true;
if (strcmp(session.parameters.buffer_mode, "streaming") == 0) {
- gSessionData.mOneShot = false;
- gSessionData.mTotalBufferSize = 1;
+ gSessionData->mOneShot = false;
+ gSessionData->mTotalBufferSize = 1;
} else if (strcmp(session.parameters.buffer_mode, "small") == 0) {
- gSessionData.mTotalBufferSize = 1;
+ gSessionData->mTotalBufferSize = 1;
} else if (strcmp(session.parameters.buffer_mode, "normal") == 0) {
- gSessionData.mTotalBufferSize = 4;
+ gSessionData->mTotalBufferSize = 4;
} else if (strcmp(session.parameters.buffer_mode, "large") == 0) {
- gSessionData.mTotalBufferSize = 16;
+ gSessionData->mTotalBufferSize = 16;
} else {
logg->logError(__FILE__, __LINE__, "Invalid value for buffer mode in session xml.");
handleException();
}
- gSessionData.images = session.parameters.images;
- gSessionData.target_path = session.parameters.target_path;
- gSessionData.title = session.parameters.title;
+ gSessionData->images = session.parameters.images;
+ gSessionData->target_path = session.parameters.target_path;
+ gSessionData->title = session.parameters.title;
}