TlmRecorders better identified with the number of the channel they are related to.

This commit is contained in:
Éder F. Zulian
2016-01-15 11:15:20 -02:00
parent d7b8e7c8f6
commit bb51520213
3 changed files with 4 additions and 3 deletions

View File

@@ -48,7 +48,7 @@
using namespace std;
TlmRecorder::TlmRecorder(string uri, string dbname, bool recenable) : sqlScriptURI(uri), dbName(dbname), senderName("TlmRecorder"), recordingEnabled(recenable), totalNumTransactions(1), simulationTimeCoveredByRecording(SC_ZERO_TIME)
TlmRecorder::TlmRecorder(string recorderName, string uri, string dbname, bool recenable) : sqlScriptURI(uri), dbName(dbname), senderName(recorderName), recordingEnabled(recenable), totalNumTransactions(1), simulationTimeCoveredByRecording(SC_ZERO_TIME)
{
if (TlmRecorder::recordingEnabled == true) {
recordedData.reserve(transactionCommitRate);

View File

@@ -62,7 +62,7 @@ public:
std::string senderName;
bool recordingEnabled;
TlmRecorder(string uri, string dbname, bool recenable);
TlmRecorder(string recorderName, string uri, string dbname, bool recenable);
~TlmRecorder();
void recordMemconfig(string memconfig){this->memconfig = memconfig;}

View File

@@ -88,7 +88,8 @@ void Simulation::setupTlmRecorders(const string &traceName, const string &pathTo
for (size_t i = 0; i < Configuration::getInstance().NumberOfMemChannels; i++) {
std::string sqlScriptURI = pathToResources + string("scripts/createTraceDB.sql");
std::string dbName = traceName + string("_channel") + std::to_string(i) + ".tdb";
TlmRecorder *tlmRecorder = new TlmRecorder(sqlScriptURI.c_str(), dbName.c_str(), Configuration::getInstance().DatabaseRecording);
std::string recorderName = "TlmRecorder" + std::to_string(i);
TlmRecorder *tlmRecorder = new TlmRecorder(recorderName.c_str(), sqlScriptURI.c_str(), dbName.c_str(), Configuration::getInstance().DatabaseRecording);
tlmRecorder->recordMemconfig(Configuration::getInstance().memconfigUri);
tlmRecorder->recordMemspec(Configuration::getInstance().memspecUri);