Skip to content

Commit

Permalink
Implement improvements CORE-2773 : Let "Start trace session" service …
Browse files Browse the repository at this point in the history
…report ID of newly created trace session

and CORE-2774 : Let "Start trace session" service report if there was no trace plugin's loaded by the engine
  • Loading branch information
hvlad committed Nov 30, 2009
1 parent 6751d05 commit 78fb021
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/jrd/trace/TraceManager.h
Expand Up @@ -59,6 +59,9 @@ class TraceManager
static ConfigStorage* getStorage()
{ return storageInstance.getStorage(); }

static size_t pluginsCount()
{ return modules->getCount(); }

void event_attach(TraceConnection* connection, bool create_db,
ntrace_result_t att_result);

Expand Down
10 changes: 7 additions & 3 deletions src/jrd/trace/TraceService.cpp
Expand Up @@ -83,6 +83,12 @@ void TraceSvcJrd::setAttachInfo(const string& /*service_name*/, const string& us

void TraceSvcJrd::startSession(TraceSession& session, bool interactive)
{
if (!TraceManager::pluginsCount())
{
m_svc.printf("Can not start trace session. There is no trace plugins loaded\n");
return;
}

ConfigStorage* storage = TraceManager::getStorage();

{ // scope
Expand Down Expand Up @@ -111,6 +117,7 @@ void TraceSvcJrd::startSession(TraceSession& session, bool interactive)
}

m_svc.started();
m_svc.printf("Trace session ID %ld started\n", session.ses_id);

if (interactive)
{
Expand All @@ -120,9 +127,6 @@ void TraceSvcJrd::startSession(TraceSession& session, bool interactive)
storage->removeSession(session.ses_id);
}
}
else {
m_svc.printf("Trace session ID %ld started\n", session.ses_id);
}
}

void TraceSvcJrd::stopSession(ULONG id)
Expand Down

0 comments on commit 78fb021

Please sign in to comment.