summaryrefslogtreecommitdiff
path: root/ACE/performance-tests/Misc
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2011-03-24 18:36:12 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2011-03-24 18:36:12 +0000
commit0f0eb2f09d1a30263680e6553f30d6cecfcaa0f3 (patch)
tree0b5898ee980d34c28b93b4d9aef99a1bbcb7d729 /ACE/performance-tests/Misc
parent6e3ca7c91ae325a2eaefe8b7b1b5636a91a06d04 (diff)
downloadATCD-0f0eb2f09d1a30263680e6553f30d6cecfcaa0f3.tar.gz
Thu Mar 24 18:31:21 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
* performance-tests/Misc/basic_func.h: * performance-tests/Misc/basic_perf.cpp: * performance-tests/Misc/childbirth_time.cpp: * performance-tests/Misc/context_switch_time.cpp: * performance-tests/Misc/preempt.cpp: * performance-tests/Misc/test_naming.cpp: * performance-tests/SCTP/SOCK_SEQPACK_Association_Test.cpp: * performance-tests/TCP/tcp_test.cpp: * performance-tests/UDP/udp_test.cpp: Converted to doxygen
Diffstat (limited to 'ACE/performance-tests/Misc')
-rw-r--r--ACE/performance-tests/Misc/basic_func.h31
-rw-r--r--ACE/performance-tests/Misc/basic_perf.cpp37
-rw-r--r--ACE/performance-tests/Misc/childbirth_time.cpp119
-rw-r--r--ACE/performance-tests/Misc/context_switch_time.cpp111
-rw-r--r--ACE/performance-tests/Misc/preempt.cpp61
-rw-r--r--ACE/performance-tests/Misc/test_naming.cpp33
6 files changed, 187 insertions, 205 deletions
diff --git a/ACE/performance-tests/Misc/basic_func.h b/ACE/performance-tests/Misc/basic_func.h
index bbaf4d4cfb9..6281c349214 100644
--- a/ACE/performance-tests/Misc/basic_func.h
+++ b/ACE/performance-tests/Misc/basic_func.h
@@ -1,20 +1,17 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// performance-tests/Misc
-//
-// = FILENAME
-// basic_func.h
-//
-// = DESCRIPTION
-// For use with basic_perf.cpp.
-//
-// = AUTHOR
-// David Levine
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file basic_func.h
+ *
+ * $Id$
+ *
+ * For use with basic_perf.cpp.
+ *
+ *
+ * @author David Levine
+ */
+//=============================================================================
+
#ifndef BASIC_FUNC_H
#define BASIC_FUNC_H
diff --git a/ACE/performance-tests/Misc/basic_perf.cpp b/ACE/performance-tests/Misc/basic_perf.cpp
index ef0dd2ed893..5fb55ba3049 100644
--- a/ACE/performance-tests/Misc/basic_perf.cpp
+++ b/ACE/performance-tests/Misc/basic_perf.cpp
@@ -1,23 +1,20 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// performance-tests/Misc
-//
-// = FILENAME
-// basic_perf.cpp
-//
-// = DESCRIPTION
-// Times various simple operations.
-//
-// With Sun C++, use -O2: make CFLAGS="-mt -O2" BIN=basic_perf
-// -fast seems to produce slower times.
-//
-// = AUTHOR
-// David Levine
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file basic_perf.cpp
+ *
+ * $Id$
+ *
+ * Times various simple operations.
+ *
+ * With Sun C++, use -O2: make CFLAGS="-mt -O2" BIN=basic_perf
+ * -fast seems to produce slower times.
+ *
+ *
+ * @author David Levine
+ */
+//=============================================================================
+
#include "basic_func.h"
#include "ace/High_Res_Timer.h"
diff --git a/ACE/performance-tests/Misc/childbirth_time.cpp b/ACE/performance-tests/Misc/childbirth_time.cpp
index 5a611ddd787..ad30cbf6e28 100644
--- a/ACE/performance-tests/Misc/childbirth_time.cpp
+++ b/ACE/performance-tests/Misc/childbirth_time.cpp
@@ -1,64 +1,61 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// (none)
-//
-// = FILENAME
-// childbirth_time.cpp
-//
-// = DESCRIPTION
-// This program is used to measure various child-creation mechanisms
-// on various platforms. By default, the program measure the time
-// to 'fork' a new process using ACE_Process.spawn (). Other tests
-// are possible as described below. James Hu provides the idea to
-// batch measuring threads creation.
-//
-// Usage: childbirth_time [-n ###] [-l ###] [-p|-f|-t|-a|-m|-x] [-h] [-e]
-//
-// -n ###: Specify number of iteration in tens. If this
-// option is not specified, the default is
-// MULTIPLY_FACTOR * (100 iterations,) which is
-// equivalent to -n 10.
-//
-// -l ###: Specify MULTIPLY_FACTOR. Default is 10.
-//
-// *-p: Measure the performance of forking a child process
-// and exec an "empty" program. This test uses
-// ACE_Process.spawn (). (Default)
-//
-// -f: Measure the performance of native "fork" function
-// call. Notice that there is no equivalent NT
-// function calls and this option is only available
-// on UN*X platform.
-//
-// -t: Measure the performance of native thread creation
-// mechanisms. On Solaris, this is thr_create ().
-// On NT, this is CreateThread (). Currently, only
-// these two platforms are implemented.
-//
-// -m: Measure the performance of Thread_Manager::spawn_n
-// method.
-//
-// -x: Test the baseline performance of ACE_Thread_Mutex.
-// This really doesn't belong here
-//
-// -a: Measure the performance of thread creation using
-// ACE_OS::thr_create ().
-//
-// -h: Use High Resolution Timer if supported by platform.
-//
-// -e: Exec a program after fork (). This option has no
-// effect on NT.
-//
-// = CREATION DATE
-// June 29, 1997
-//
-// = AUTHOR
-// Nanbor Wang
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file childbirth_time.cpp
+ *
+ * $Id$
+ *
+ * This program is used to measure various child-creation mechanisms
+ * on various platforms. By default, the program measure the time
+ * to 'fork' a new process using ACE_Process.spawn (). Other tests
+ * are possible as described below. James Hu provides the idea to
+ * batch measuring threads creation.
+ *
+ * Usage: childbirth_time [-n ###] [-l ###] [-p|-f|-t|-a|-m|-x] [-h] [-e]
+ *
+ * -n ###: Specify number of iteration in tens. If this
+ * option is not specified, the default is
+ * MULTIPLY_FACTOR * (100 iterations,) which is
+ * equivalent to -n 10.
+ *
+ * -l ###: Specify MULTIPLY_FACTOR. Default is 10.
+ *
+ * *-p: Measure the performance of forking a child process
+ * and exec an "empty" program. This test uses
+ * ACE_Process.spawn (). (Default)
+ *
+ * -f: Measure the performance of native "fork" function
+ * call. Notice that there is no equivalent NT
+ * function calls and this option is only available
+ * on UN*X platform.
+ *
+ * -t: Measure the performance of native thread creation
+ * mechanisms. On Solaris, this is thr_create ().
+ * On NT, this is CreateThread (). Currently, only
+ * these two platforms are implemented.
+ *
+ * -m: Measure the performance of Thread_Manager::spawn_n
+ * method.
+ *
+ * -x: Test the baseline performance of ACE_Thread_Mutex.
+ * This really doesn't belong here
+ *
+ * -a: Measure the performance of thread creation using
+ * ACE_OS::thr_create ().
+ *
+ * -h: Use High Resolution Timer if supported by platform.
+ *
+ * -e: Exec a program after fork (). This option has no
+ * effect on NT.
+ *
+ * = CREATION DATE
+ * June 29, 1997
+ *
+ *
+ * @author Nanbor Wang
+ */
+//=============================================================================
+
// Process Creation profiling
diff --git a/ACE/performance-tests/Misc/context_switch_time.cpp b/ACE/performance-tests/Misc/context_switch_time.cpp
index 26d4fc840cb..293f687d434 100644
--- a/ACE/performance-tests/Misc/context_switch_time.cpp
+++ b/ACE/performance-tests/Misc/context_switch_time.cpp
@@ -1,48 +1,45 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// (none)
-//
-// = FILENAME
-// context_switch_time.cpp
-//
-// = DESCRIPTION
-// Program that calculates context switch time between threads.
-// The Suspend-Resume test is based on the Task Context Switching
-// measurement approach described in:
-// Darren Cathey<br>
-// "RTOS Benchmarking -- All Things Considered . . ."<br>
-// <a href="http://www.realtime-info.be"><em>Real-Time Magazine</em></a>,
-// Second Quarter 1993,
-// <em>reprinted by <a href="http://www.wrs.com/artreqfm.html">Wind River
-// Systems</a></em><p>
-// which in turn is based on Superconducting Super Collider (SSC)
-// Laboratory Ping Suspend/Resume Task and Suspend/Resume Task benchmarks.
-// It measures two different times:
-// 1) The time to resume a blocked high priority task, which does
-// nothing other than block immediately. A lower priority task
-// resumes the high priority task, so the elapsed time includes
-// two context switches, one task suspend, and one task resume.
-// 2) The time to suspend and resume a low priority task that does
-// nothing. There is no context switching. This time is subtracted
-// from the one described in 1) above, and the result is divided by
-// two to yield the context switch time.
-//
-// Notes:
-// On Solaris 2.5.1, it appears that the lowest context switching times,
-// at least on a single-CPU machine, are obtained _without_ creating new
-// LWPs for new threads (THR_NEW_LWP). The -n option enables the use of
-// THR_NEW_LWP for testing.
-//
-// = CREATION DATE
-// 17 January 1997
-//
-// = AUTHOR
-// David L. Levine
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file context_switch_time.cpp
+ *
+ * $Id$
+ *
+ * Program that calculates context switch time between threads.
+ * The Suspend-Resume test is based on the Task Context Switching
+ * measurement approach described in:
+ * Darren Cathey<br>
+ * "RTOS Benchmarking -- All Things Considered . . ."<br>
+ * <a href="http://www.realtime-info.be"><em>Real-Time Magazine</em></a>,
+ * Second Quarter 1993,
+ * <em>reprinted by <a href="http://www.wrs.com/artreqfm.html">Wind River
+ * Systems</a></em><p>
+ * which in turn is based on Superconducting Super Collider (SSC)
+ * Laboratory Ping Suspend/Resume Task and Suspend/Resume Task benchmarks.
+ * It measures two different times:
+ * 1) The time to resume a blocked high priority task, which does
+ * nothing other than block immediately. A lower priority task
+ * resumes the high priority task, so the elapsed time includes
+ * two context switches, one task suspend, and one task resume.
+ * 2) The time to suspend and resume a low priority task that does
+ * nothing. There is no context switching. This time is subtracted
+ * from the one described in 1) above, and the result is divided by
+ * two to yield the context switch time.
+ *
+ * Notes:
+ * On Solaris 2.5.1, it appears that the lowest context switching times,
+ * at least on a single-CPU machine, are obtained _without_ creating new
+ * LWPs for new threads (THR_NEW_LWP). The -n option enables the use of
+ * THR_NEW_LWP for testing.
+ *
+ * = CREATION DATE
+ * 17 January 1997
+ *
+ *
+ * @author David L. Levine
+ */
+//=============================================================================
+
static const char usage [] = "[-? |\n"
" [-c <repeat counter, 0 means forever>]\n"
@@ -665,11 +662,11 @@ public:
ACE_hrtime_t elapsed_time () const { return elapsed_time_; }
private:
+ /// Mutex used for acquire/release time measurement.
ACE_Thread_Mutex mutex_;
- // Mutex used for acquire/release time measurement.
+ /// Semaphore used for acquire/release time measurement.
ACE_Thread_Semaphore sem_;
- // Semaphore used for acquire/release time measurement.
const ACE_UINT32 iterations_;
@@ -747,9 +744,9 @@ public:
virtual int svc ();
+ /// Called by other task: it returns when this task is ready to
+ /// continue
void ready () { initialized_.acquire (); }
- // Called by other task: it returns when this task is ready to
- // continue
void done ();
@@ -763,17 +760,17 @@ private:
int terminate_;
ACE_UINT32 iterations_;
+ /// Semaphore used to resume the task.
ACE_Thread_Semaphore &sem_;
- // Semaphore used to resume the task.
+ /// Mutex used to block the task.
ACE_Thread_Mutex &mutex_;
- // Mutex used to block the task.
+ /// Clock shared between low and high priority tasks.
ACE_High_Res_Timer &timer_;
- // Clock shared between low and high priority tasks.
+ /// Running total context switch time, nsec.
ACE_hrtime_t total_time_;
- // Running total context switch time, nsec.
// Force proper construction of independent instances.
High_Priority_Synchronized_Task ();
@@ -922,17 +919,17 @@ public:
private:
const ACE_UINT32 iterations_;
+ /// Used by the low priority thread to resume the high priority thread.
ACE_Thread_Semaphore sem_;
- // Used by the low priority thread to resume the high priority thread.
+ /// Used by the low priority thread to block the high priority thread.
ACE_Thread_Mutex mutex_;
- // Used by the low priority thread to block the high priority thread.
+ /// Clock shared between low and high priority tasks.
ACE_High_Res_Timer timer_;
- // Clock shared between low and high priority tasks.
+ /// The high priority task.
High_Priority_Synchronized_Task high_;
- // The high priority task.
ACE_hrtime_t elapsed_time_;
diff --git a/ACE/performance-tests/Misc/preempt.cpp b/ACE/performance-tests/Misc/preempt.cpp
index e096ff3405b..7e774fac3a8 100644
--- a/ACE/performance-tests/Misc/preempt.cpp
+++ b/ACE/performance-tests/Misc/preempt.cpp
@@ -1,35 +1,32 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// performance-tests/Misc
-//
-// = FILENAME
-// preempt.cpp
-//
-// = DESCRIPTION
-// This is a simple test to illustrate OS thread preemption. One
-// ore more high priority threads periodically (every half
-// second, by default) reads the clock. They use select () to
-// block for that duration. Meanwhile, a low priority thread
-// continually chews up the CPU. Without preemption, the high
-// priority thread won't have a chance to read the clock in a
-// timely manner.
-//
-// At the end of the test, the actual clock read intervals by the
-// high priority task(s) are printed out. With proper
-// preemption, the intervals should correspond to the requested
-// clock read interval.
-//
-// There is a -y option for the low priority thread to periodically
-// yield. It shouldn't be necessary to use that option, if preemption
-// is supported. It's a handy option for testing.
-//
-// = AUTHOR
-// David L. Levine
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file preempt.cpp
+ *
+ * $Id$
+ *
+ * This is a simple test to illustrate OS thread preemption. One
+ * ore more high priority threads periodically (every half
+ * second, by default) reads the clock. They use select () to
+ * block for that duration. Meanwhile, a low priority thread
+ * continually chews up the CPU. Without preemption, the high
+ * priority thread won't have a chance to read the clock in a
+ * timely manner.
+ *
+ * At the end of the test, the actual clock read intervals by the
+ * high priority task(s) are printed out. With proper
+ * preemption, the intervals should correspond to the requested
+ * clock read interval.
+ *
+ * There is a -y option for the low priority thread to periodically
+ * yield. It shouldn't be necessary to use that option, if preemption
+ * is supported. It's a handy option for testing.
+ *
+ *
+ * @author David L. Levine
+ */
+//=============================================================================
+
#include "ace/OS_main.h"
#include "ace/ACE.h"
diff --git a/ACE/performance-tests/Misc/test_naming.cpp b/ACE/performance-tests/Misc/test_naming.cpp
index 55cdd416e63..c98e6455440 100644
--- a/ACE/performance-tests/Misc/test_naming.cpp
+++ b/ACE/performance-tests/Misc/test_naming.cpp
@@ -1,21 +1,18 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// performance_tests
-//
-// = FILENAME
-// test_naming.cpp
-//
-// = DESCRIPTION
-// This is an example to do performance testing of the Naming Service
-// using both the normal Memory Pool as well as the light Memory Pool.
-//
-// = AUTHOR
-// Prashant Jain
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file test_naming.cpp
+ *
+ * $Id$
+ *
+ * This is an example to do performance testing of the Naming Service
+ * using both the normal Memory Pool as well as the light Memory Pool.
+ *
+ *
+ * @author Prashant Jain
+ */
+//=============================================================================
+
#include "ace/OS_main.h"
#include "ace/ACE.h"