summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoredwin <edwin@99606f1f-bbb2-4562-8e6b-387ddef1dc61>2010-03-19 10:32:21 (GMT)
committer edwin <edwin@99606f1f-bbb2-4562-8e6b-387ddef1dc61>2010-03-19 10:32:21 (GMT)
commit5482f50830c45301d07e32b3b54bc38a0529333d (patch)
treef3124208efd9d93e3e10a223d25dbc8b92ba19fc
parent273478a22c5fd2c250ccb7ae784e4c691f1e7747 (diff)
warnings are errors now. created core status reporting
git-svn-id: https://open.syn3.nl/syn3/svndav/default/trunk/projects/synapse@273 99606f1f-bbb2-4562-8e6b-387ddef1dc61
-rw-r--r--CMakeLists.txt2
-rw-r--r--Doxyfile32
-rw-r--r--ccallman.cpp43
-rw-r--r--ccallman.h5
-rw-r--r--cmessageman.cpp9
-rw-r--r--cmessageman.h6
-rw-r--r--cuserman.cpp11
-rw-r--r--cuserman.h2
-rw-r--r--modules/core.module/module.cpp22
-rw-r--r--modules/docs/html/ami_8module_2module_8cpp.html2
-rw-r--r--modules/docs/html/core_8module_2module_8cpp.html2
-rw-r--r--modules/docs/html/files.html2
-rw-r--r--modules/docs/html/globals.html2
-rw-r--r--modules/docs/html/globals_func.html2
-rw-r--r--modules/docs/html/index.html2
-rw-r--r--wwwdir/debug.html45
16 files changed, 132 insertions, 57 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0333a41..5dabfc8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ SET(CMAKE_BUILD_TYPE Debug)
SET(CMAKE_VERBOSE_MAKEFILE ON)
#add definitions, compiler switches, etc.
-ADD_DEFINITIONS(-Wall -O2 -pthread -pg)
+ADD_DEFINITIONS(-Wall -O2 -pthread -pg -Werror)
#list all source files here
file(GLOB sources *.cpp)
diff --git a/Doxyfile b/Doxyfile
index da6e0fd..72b91df 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -1,4 +1,4 @@
-# Doxyfile 1.5.5-KDevelop
+# Doxyfile 1.5.7.1-KDevelop
#---------------------------------------------------------------------------
# Project related configuration options
@@ -31,7 +31,6 @@ SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
@@ -40,6 +39,7 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
+EXTENSION_MAPPING =
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
@@ -47,6 +47,7 @@ IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
+SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -76,10 +77,11 @@ GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
-SHOW_DIRECTORIES = YES
+SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
+LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -93,7 +95,7 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
-INPUT = /home/psy/svnhobbybop/framework/synapse
+INPUT = /home/psy/opensyn3/projects/synapse
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
*.cc \
@@ -170,8 +172,8 @@ FILTER_SOURCE_FILES = NO
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
@@ -191,16 +193,25 @@ HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
+HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
-HTML_DYNAMIC_SECTIONS = NO
+GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
+CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
+GENERATE_QHP = NO
+QCH_FILE =
+QHP_NAMESPACE =
+QHP_VIRTUAL_FOLDER = doc
+QHP_CUSTOM_FILTER_NAME =
+QHP_CUST_FILTER_ATTRS =
+QHP_SECT_FILTER_ATTRS =
+QHG_LOCATION =
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NONE
@@ -217,8 +228,8 @@ COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
+PDF_HYPERLINKS = YES
+USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
@@ -284,6 +295,7 @@ MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_FONTNAME = FreeSans
+DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
diff --git a/ccallman.cpp b/ccallman.cpp
index b99a513..8cb816f 100644
--- a/ccallman.cpp
+++ b/ccallman.cpp
@@ -29,7 +29,7 @@ CcallMan::~CcallMan()
/*!
\fn CcallMan::addCall(CmsgPtr msg, CsessionPtr dst)
*/
-bool CcallMan::addCall(const CmsgPtr & msg, const CsessionPtr & dst, FsoHandler soHandler)
+void CcallMan::addCall(const CmsgPtr & msg, const CsessionPtr & dst, FsoHandler soHandler)
{
callList.push_back(Ccall(msg,dst,soHandler));
statsTotal++;
@@ -75,28 +75,37 @@ void CcallMan::endCall(CcallList::iterator callI)
/*!
\fn CcallMan::print()
*/
-void CcallMan::print(int verbose)
+string CcallMan::getStatusStr(bool queue, bool verbose)
{
- if (verbose)
- DEB( statsTotal << " calls processed, " << callList.size() << " calls queued" );
- string status;
+ stringstream status;
+ int running=0;
+
for (CcallList::iterator callI=callList.begin(); callI!=callList.end(); callI++)
{
- if (callI->started)
- status="RUNNING";
- else if (!verbose)
- continue;
- else
- status="QUEUED ";
+ if (queue)
+ {
+ status << " |";
+ if (callI->started)
+ status << "RUNNING";
+ else if (!verbose)
+ continue;
+ else
+ status << "QUEUED ";
+
+ status << " " << callI->msg->event <<
+ " FROM " << callI->msg->src <<
+ " TO " << callI->dst->id << ":" << callI->dst->user->getName() <<
+ "@" << callI->dst->module->name << callI->msg->getPrint(" |") <<
+ "\n";
+ }
- DEB(" |" << status << " " << callI->msg->event << " FROM " << callI->msg->src << " TO " <<
- callI->dst->id << ":" << callI->dst->user->getName() << "@" << callI->dst->module->name
- << callI->msg->getPrint(" |")
- );
+ if (callI->started)
+ running++;
}
-
- statsTotal=0;
+ status << statsTotal << " calls processed, " << running << "/" << callList.size() << " calls running.\n";
+
+ return (status.str());
}
bool CcallMan::interruptCall(string event, int src, int dst)
diff --git a/ccallman.h b/ccallman.h
index 4ff1700..057534b 100644
--- a/ccallman.h
+++ b/ccallman.h
@@ -26,12 +26,13 @@ public:
CcallMan();
~CcallMan();
- bool addCall(const CmsgPtr & msg, const CsessionPtr & dst, FsoHandler soHandler);
+ void addCall(const CmsgPtr & msg, const CsessionPtr & dst, FsoHandler soHandler);
CcallList::iterator startCall(const CthreadPtr & threadPtr);
void endCall(CcallList::iterator callI);
bool interruptCall(string event, int src, int dst);
bool interruptAll();
- void print(int verbose=1);
+ string getStatusStr(bool queue, bool verbose);
+
int statsTotal;
CcallList callList;
diff --git a/cmessageman.cpp b/cmessageman.cpp
index 2b0fa2b..1e93733 100644
--- a/cmessageman.cpp
+++ b/cmessageman.cpp
@@ -406,7 +406,6 @@ int CmessageMan::run(string coreName, string moduleName)
//lock core and do our stuff
{
lock_guard<mutex> lock(threadMutex);
-//TODO: make this appear on keypress, or via an event?
// DEB(maxActiveThreads << "/" << wantCurrentThreads << " threads active.");
// callMan.print();
// userMan.print();
@@ -549,3 +548,11 @@ void CmessageMan::doShutdown(int exit=0)
this->exit=exit;
threadCond.notify_all();
}
+
+string CmessageMan::getStatusStr()
+{
+ stringstream s;
+ s << maxActiveThreads << "/" << wantCurrentThreads << " threads running. ";
+
+ return(s.str());
+}
diff --git a/cmessageman.h b/cmessageman.h
index ba30a05..ded04b6 100644
--- a/cmessageman.h
+++ b/cmessageman.h
@@ -70,6 +70,10 @@ public:
//initial module that user want to start, after the coremodule is started:
string firstModuleName;
+ //for administrator/debugging
+ string getStatusStr();
+
+
private:
condition_variable threadCond;
@@ -91,6 +95,8 @@ private:
bool idleThread();
void activeThread();
+
+
CgroupPtr defaultRecvGroup;
CgroupPtr defaultSendGroup;
CgroupPtr defaultModifyGroup;
diff --git a/cuserman.cpp b/cuserman.cpp
index ed1239f..17daf80 100644
--- a/cuserman.cpp
+++ b/cuserman.cpp
@@ -241,20 +241,17 @@ bool CuserMan::delSession(const int sessionId)
-
-/*!
- \fn CuserMan::print()
- */
-void CuserMan::print()
+string CuserMan::getStatusStr()
{
+ stringstream s;
for (int sessionId=0; sessionId<MAX_SESSIONS; sessionId++)
{
if (sessions[sessionId])
{
- DEB("session " << sessionId << " = " << sessions[sessionId]->user->getName() << "@" << sessions[sessionId]->module->name );
+ s << "session " << sessionId << " = " << sessions[sessionId]->user->getName() << "@" << sessions[sessionId]->module->name << "\n";
}
}
-
+ return (s.str());
}
void CuserMan::doShutdown()
diff --git a/cuserman.h b/cuserman.h
index fb6fe0f..d18976b 100644
--- a/cuserman.h
+++ b/cuserman.h
@@ -38,7 +38,7 @@ public:
int addSession( CsessionPtr session);
CsessionPtr getSession(const int & sessionId);
bool delSession(const int id);
- void print();
+ string getStatusStr();
void doShutdown();
string login(const int & sessionId, const string & userName, const string & password);
diff --git a/modules/core.module/module.cpp b/modules/core.module/module.cpp
index 003f68f..cf1d540 100644
--- a/modules/core.module/module.cpp
+++ b/modules/core.module/module.cpp
@@ -323,8 +323,12 @@ SYNAPSE_REGISTER(core_ChangeEvent)
{
//since permissions are very important, make sure the user didnt make a typo.
//(normally we dont care about typo's since then something just wouldn't work, but this function will work if the user doesnt specify one or more parameters.)
- if (msg.returnIfOtherThan("sendGroup","event","recvGroup","modifyGroup",NULL))
- return;
+ if (msg.returnIfOtherThan(
+ (char *)"sendGroup",
+ (char *)"event",
+ (char *)"recvGroup",
+ (char *)"modifyGroup",NULL))
+ return;
string error;
{
@@ -766,14 +770,20 @@ SYNAPSE_REGISTER(core_ChangeLogging)
/** Requests status of core.
Usefull for debugging and administration.
-\par Replies \c module_Status:
+\par Replies \c core_Status:
Contains several status fields.
*/
-SYNAPSE_REGISTER(core_Status)
+SYNAPSE_REGISTER(core_GetStatus)
{
+ Cmsg out;
{
lock_guard<mutex> lock(messageMan->threadMutex);
- messageMan->logSends=msg["logSends"];
- messageMan->logReceives=msg["logReceives"];
+ out.event="core_Status";
+ out.dst=out.src;
+ out["callMan"]=messageMan->callMan.getStatusStr(msg["queue"], msg["verbose"]);
+ out["userMan"]=messageMan->userMan.getStatusStr();
+ out["threads"]=messageMan->getStatusStr();
+
}
+ out.send();
}
diff --git a/modules/docs/html/ami_8module_2module_8cpp.html b/modules/docs/html/ami_8module_2module_8cpp.html
index 32df000..e54be3e 100644
--- a/modules/docs/html/ami_8module_2module_8cpp.html
+++ b/modules/docs/html/ami_8module_2module_8cpp.html
@@ -113,7 +113,7 @@ tell the rest of the world we are ready for duty
</div>
</div><p>
</div>
-<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 12:45:28 2010 for Synapsemoduledocumentation by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 18:29:33 2010 for Synapsemoduledocumentation by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
diff --git a/modules/docs/html/core_8module_2module_8cpp.html b/modules/docs/html/core_8module_2module_8cpp.html
index e717239..4163df3 100644
--- a/modules/docs/html/core_8module_2module_8cpp.html
+++ b/modules/docs/html/core_8module_2module_8cpp.html
@@ -492,7 +492,7 @@ Dynamicly loads a synapse module.
</div>
</div><p>
</div>
-<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 12:45:28 2010 for Synapsemoduledocumentation by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 18:29:33 2010 for Synapsemoduledocumentation by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
diff --git a/modules/docs/html/files.html b/modules/docs/html/files.html
index 19f97fb..46e3fb2 100644
--- a/modules/docs/html/files.html
+++ b/modules/docs/html/files.html
@@ -25,7 +25,7 @@
<tr><td class="indexkey">core.module/<a class="el" href="core_8module_2module_8cpp.html">module.cpp</a></td><td class="indexvalue">The core module </td></tr>
</table>
</div>
-<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 12:45:28 2010 for Synapsemoduledocumentation by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 18:29:33 2010 for Synapsemoduledocumentation by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
diff --git a/modules/docs/html/globals.html b/modules/docs/html/globals.html
index 0f4868d..6470c4b 100644
--- a/modules/docs/html/globals.html
+++ b/modules/docs/html/globals.html
@@ -33,7 +33,7 @@ Here is a list of all documented file members with links to the documentation:
: <a class="el" href="ami_8module_2module_8cpp.html#9663bac24258c633a4d8df270e482a1c">module.cpp</a>
</ul>
</div>
-<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 12:45:28 2010 for Synapsemoduledocumentation by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 18:29:33 2010 for Synapsemoduledocumentation by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
diff --git a/modules/docs/html/globals_func.html b/modules/docs/html/globals_func.html
index f0f8127..c47c557 100644
--- a/modules/docs/html/globals_func.html
+++ b/modules/docs/html/globals_func.html
@@ -33,7 +33,7 @@
: <a class="el" href="ami_8module_2module_8cpp.html#9663bac24258c633a4d8df270e482a1c">module.cpp</a>
</ul>
</div>
-<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 12:45:28 2010 for Synapsemoduledocumentation by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 18:29:33 2010 for Synapsemoduledocumentation by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
diff --git a/modules/docs/html/index.html b/modules/docs/html/index.html
index 1c980a2..a899c94 100644
--- a/modules/docs/html/index.html
+++ b/modules/docs/html/index.html
@@ -17,7 +17,7 @@
<h1>Synapsemoduledocumentation Documentation</h1>
<p>
<h3 align="center">1.0 </h3>Look in the files section for more info.. </div>
-<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 12:45:28 2010 for Synapsemoduledocumentation by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Thu Mar 18 18:29:33 2010 for Synapsemoduledocumentation by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
diff --git a/wwwdir/debug.html b/wwwdir/debug.html
index 222085c..034015b 100644
--- a/wwwdir/debug.html
+++ b/wwwdir/debug.html
@@ -12,6 +12,8 @@
<script type="text/javascript" src="synapse.js"></script>
<script type="text/javascript">
+ /// SYNAPSE EVENT HANDLERS
+
synapse_register("error",function(errortxt)
{
$('#error').html(errortxt);
@@ -34,6 +36,21 @@
});
+ synapse_register("core_Status",function(msg_src, msg_dst, msg_event, msg)
+ {
+ $('#core_Status').html(
+ "Call queue:\n"+msg["callMan"]+"\nThreads:\n"+msg["threads"]+"\nSessions:\n"+msg["userMan"]
+ );
+ });
+
+ synapse_register("http_json_Status",function(msg_src, msg_dst, msg_event, msg)
+ {
+ $('#http_json_Status').html(
+ "Call queue:\n"+msg["callMan"]+"\nThreads:\n"+msg["threads"]+"\nSessions:\n"+msg["userMan"]
+ );
+ });
+
+
synapse_register("module_SessionStart",function(msg_src, msg_dst, msg_event, msg)
{
$('#authCookie').html(msg["authCookie"]);
@@ -59,12 +76,12 @@
synapse_register("test_CounterStatus",function(msg_src, msg_dst, msg_event, msg)
{
- console.info("asdf"+msg["counterSleep"]);
$("#counterSlider").slider('value', msg["counterSleep"]);
$('#counterSleep').html(msg["counterSleep"]);
});
+ /// JAVA SCRIPT EVENT HANDLERS
$(document).ready(function(){
$('#username').val("admin");
@@ -121,6 +138,18 @@
});
});
+ $('#core_GetStatus').click(function(event){
+ send(0,"core_GetStatus", {
+ "queue": $('#core_GetStatus_queue').is(':checked')?1:0,
+ "verbose": $('#core_GetStatus_verbose').is(':checked')?1:0
+ });
+ });
+
+ $('#http_json_GetStatus').click(function(event){
+ send(0,"http_json_GetStatus", {
+ });
+ });
+
});
@@ -174,7 +203,15 @@
<h2>Application level (tests)</h2>
-
+
+ <h3>Core status</h3>
+
+ <pre>
+ <div id='core_Status' ></div>
+ </pre>
+ <input type='checkbox' id='core_GetStatus_queue'>Get queue<br>
+ <input type='checkbox' id='core_GetStatus_verbose'>Verbose<br>
+ <input type='submit' value='Get...' id='core_GetStatus'>
<h3>Counter testing</h3>
@@ -192,9 +229,5 @@
<input type='submit' value='Counter faster' id='counterFaster'>
<input type='submit' value='Counter slower' id='counterSlower'>
-
-
- <h3>Status</h3>
-
</body>
</html> \ No newline at end of file