Remove PrintThreadPoolStats() from the public API.

This function uses a ThreadPool object as an argument, which is not
supposed to be exported. Also, debug compilation was broken.
(cherry picked from commit 32e510b45abfc99a9c9c6c7addbc21769244ffdb)
This commit is contained in:
Marcelo Roberto Jimenez 2011-02-07 22:33:42 -02:00
parent 28f4d398d8
commit b6baca8eb0
4 changed files with 67 additions and 65 deletions

View File

@ -255,6 +255,12 @@ Version 1.8.0
Version 1.6.11
*******************************************************************************
2011-02-07 Marcelo Roberto Jimenez <mroberto(at)users.sourceforge.net>
Remove PrintThreadPoolStats() from the public API. This function uses
a ThreadPool object as an argument, which is not supposed to be
exported.
2011-02-07 Fabrice Fontaine <fabrice.fontaine(at)orange-ftgroup.com>
Major bug fix in IPv6 code.
@ -263,7 +269,7 @@ Version 1.6.11
changing implementation of get_port in November 20th 2010 ("gena:fix
several compiler warnings" commit).
2011-02-11 Marcelo Roberto Jimenez <mroberto(at)users.sourceforge.net>
2011-02-06 Marcelo Roberto Jimenez <mroberto(at)users.sourceforge.net>
Fix for incorrectly exported include files.

View File

@ -283,33 +283,6 @@ static UPNP_INLINE void UpnpDisplayBanner(FILE *fd, const char **lines,
}
#endif
/*!
* \brief Prints thread pool statistics.
*/
#ifdef DEBUG
void PrintThreadPoolStats(
/*! [in] The thread pool. */
ThreadPool * tp,
/*! [in] The file name that called this function, use the macro
* __FILE__. */
const char *DbgFileName,
/*! [in] The line number that the function was called, use the macro
* __LINE__. */
int DbgLineNo,
/*! [in] The message. */
const char *msg);
#else
static UPNP_INLINE void PrintThreadPoolStats(ThreadPool *tp,
const char *DbgFileName, int DbgLineNo, const char *msg)
{
return;
tp = tp;
DbgFileName = DbgFileName;
DbgLineNo = DbgLineNo;
msg = msg;
}
#endif
/*@}*/
#ifdef __cplusplus

View File

@ -520,6 +520,66 @@ exit_function:
}
#endif
#ifdef DEBUG
/*!
* \brief Prints thread pool statistics.
*/
void PrintThreadPoolStats(
/*! [in] The thread pool. */
ThreadPool *tp,
/*! [in] The file name that called this function, use the macro
* __FILE__. */
const char *DbgFileName,
/*! [in] The line number that the function was called, use the macro
* __LINE__. */
int DbgLineNo,
/*! [in] The message. */
const char *msg)
{
ThreadPoolStats stats;
ThreadPoolGetStats(tp, &stats);
UpnpPrintf(UPNP_INFO, API, DbgFileName, DbgLineNo,
"%s\n"
"High Jobs pending: %d\n"
"Med Jobs Pending: %d\n"
"Low Jobs Pending: %d\n"
"Average wait in High Q in milliseconds: %lf\n"
"Average wait in Med Q in milliseconds: %lf\n"
"Average wait in Low Q in milliseconds: %lf\n"
"Max Threads Used: %d\n"
"Worker Threads: %d\n"
"Persistent Threads: %d\n"
"Idle Threads: %d\n"
"Total Threads: %d\n"
"Total Work Time: %lf\n"
"Total Idle Time: %lf\n",
msg,
stats.currentJobsHQ,
stats.currentJobsMQ,
stats.currentJobsLQ,
stats.avgWaitHQ,
stats.avgWaitMQ,
stats.avgWaitLQ,
stats.maxThreads,
stats.workerThreads,
stats.persistentThreads,
stats.idleThreads,
stats.totalThreads,
stats.totalWorkTime,
stats.totalIdleTime);
}
#else
static UPNP_INLINE void PrintThreadPoolStats(ThreadPool *tp,
const char *DbgFileName, int DbgLineNo, const char *msg)
{
return;
tp = tp;
DbgFileName = DbgFileName;
DbgLineNo = DbgLineNo;
msg = msg;
}
#endif /* DEBUG */
int UpnpFinish(void)
{
#ifdef INCLUDE_DEVICE_APIS

View File

@ -244,41 +244,4 @@ void UpnpDisplayBanner(FILE * fd,
free(leftMargin);
}
void PrintThreadPoolStats(ThreadPool *tp,
const char *DbgFileName,
int DbgLineNo, const char *msg)
{
ThreadPoolStats stats;
ThreadPoolGetStats(tp, &stats);
UpnpPrintf(UPNP_INFO, API, DbgFileName, DbgLineNo,
"%s\n"
"High Jobs pending: %d\n"
"Med Jobs Pending: %d\n"
"Low Jobs Pending: %d\n"
"Average wait in High Q in milliseconds: %lf\n"
"Average wait in Med Q in milliseconds: %lf\n"
"Average wait in Low Q in milliseconds: %lf\n"
"Max Threads Used: %d\n"
"Worker Threads: %d\n"
"Persistent Threads: %d\n"
"Idle Threads: %d\n"
"Total Threads: %d\n"
"Total Work Time: %lf\n"
"Total Idle Time: %lf\n",
msg,
stats.currentJobsHQ,
stats.currentJobsMQ,
stats.currentJobsLQ,
stats.avgWaitHQ,
stats.avgWaitMQ,
stats.avgWaitLQ,
stats.maxThreads,
stats.workerThreads,
stats.persistentThreads,
stats.idleThreads,
stats.totalThreads,
stats.totalWorkTime,
stats.totalIdleTime);
}
#endif /* DEBUG */