diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2011-03-24 18:36:12 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2011-03-24 18:36:12 +0000 |
commit | 0f0eb2f09d1a30263680e6553f30d6cecfcaa0f3 (patch) | |
tree | 0b5898ee980d34c28b93b4d9aef99a1bbcb7d729 /ACE/performance-tests | |
parent | 6e3ca7c91ae325a2eaefe8b7b1b5636a91a06d04 (diff) | |
download | ATCD-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')
-rw-r--r-- | ACE/performance-tests/Misc/basic_func.h | 31 | ||||
-rw-r--r-- | ACE/performance-tests/Misc/basic_perf.cpp | 37 | ||||
-rw-r--r-- | ACE/performance-tests/Misc/childbirth_time.cpp | 119 | ||||
-rw-r--r-- | ACE/performance-tests/Misc/context_switch_time.cpp | 111 | ||||
-rw-r--r-- | ACE/performance-tests/Misc/preempt.cpp | 61 | ||||
-rw-r--r-- | ACE/performance-tests/Misc/test_naming.cpp | 33 | ||||
-rw-r--r-- | ACE/performance-tests/SCTP/SOCK_SEQPACK_Association_Test.cpp | 45 | ||||
-rw-r--r-- | ACE/performance-tests/TCP/tcp_test.cpp | 46 | ||||
-rw-r--r-- | ACE/performance-tests/UDP/udp_test.cpp | 45 |
9 files changed, 250 insertions, 278 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" diff --git a/ACE/performance-tests/SCTP/SOCK_SEQPACK_Association_Test.cpp b/ACE/performance-tests/SCTP/SOCK_SEQPACK_Association_Test.cpp index bb423300062..439f3fd31fb 100644 --- a/ACE/performance-tests/SCTP/SOCK_SEQPACK_Association_Test.cpp +++ b/ACE/performance-tests/SCTP/SOCK_SEQPACK_Association_Test.cpp @@ -1,27 +1,24 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// SOCK_SEQPACK_Association_Test.cpp -// -// = DESCRIPTION -// -// Tests the methods get_local_addrs and get_remote_addrs of class -// ACE_SOCK_SEQPACK_Association. -// -// This is not an automated "one-button" test. Rather, it prints -// some output to a log file, so that an interested human can -// inspect the output and get a vague notion of whether or not -// the methods are working properly. -// -// = AUTHOR -// Edward Mulholland (emulholl@atl.lmco.com) -// -// ============================================================================ + +//============================================================================= +/** + * @file SOCK_SEQPACK_Association_Test.cpp + * + * $Id$ + * + * + * Tests the methods get_local_addrs and get_remote_addrs of class + * ACE_SOCK_SEQPACK_Association. + * + * This is not an automated "one-button" test. Rather, it prints + * some output to a log file, so that an interested human can + * inspect the output and get a vague notion of whether or not + * the methods are working properly. + * + * + * @author Edward Mulholland (emulholl@atl.lmco.com) + */ +//============================================================================= + #include "ace/SOCK_SEQPACK_Association.h" #include "ace/SOCK_SEQPACK_Connector.h" diff --git a/ACE/performance-tests/TCP/tcp_test.cpp b/ACE/performance-tests/TCP/tcp_test.cpp index 09e5ebc219f..0e5996df6a2 100644 --- a/ACE/performance-tests/TCP/tcp_test.cpp +++ b/ACE/performance-tests/TCP/tcp_test.cpp @@ -1,21 +1,17 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// performance-tests/TCP -// -// = FILENAME -// tcp_test.cpp -// -// = DESCRIPTION -// Measures TCP round-trip performance. -// -// = AUTHORS -// Based on udp_test by Fred Kuhns and David L. Levine -// Modified by Carlos O'Ryan and Nanbor Wang. -// -// ============================================================================ + +//============================================================================= +/** + * @file tcp_test.cpp + * + * $Id$ + * + * Measures TCP round-trip performance. + * + * + * @author Based on udp_test by Fred Kuhns and David L. LevineModified by Carlos O'Ryan and Nanbor Wang. + */ +//============================================================================= + #include "ace/Reactor.h" #include "ace/Select_Reactor.h" @@ -110,27 +106,27 @@ public: ACE_Reactor_Mask close_mask); //FUZZ: disable check_for_lack_ACE_OS + /// Send the <buf> to the server. int send (const char *buf, size_t len); - // Send the <buf> to the server. //FUZZ: enable check_for_lack_ACE_OS + /// Wait for the response. int get_response (char *buf, size_t len); - // Wait for the response. + /// Send messages to server and record statistics. int run (void); - // Send messages to server and record statistics. //FUZZ: disable check_for_lack_ACE_OS + /// Send shutdown message to server. int shutdown (void); - // Send shutdown message to server. //FUZZ: enable check_for_lack_ACE_OS private: + /// To send messages and receive responses. ACE_SOCK_Stream endpoint_; - // To send messages and receive responses. + /// The address to send messages to. ACE_INET_Addr remote_addr_; - // The address to send messages to. ACE_UNIMPLEMENTED_FUNC (Client (void)) ACE_UNIMPLEMENTED_FUNC (Client (const Client &)) @@ -307,8 +303,8 @@ public: ACE_Reactor_Mask close_mask); private: + /// Receives datagrams. ACE_SOCK_Stream endpoint_; - // Receives datagrams. ACE_UNIMPLEMENTED_FUNC (Server (void)) ACE_UNIMPLEMENTED_FUNC (Server (const Server &)) diff --git a/ACE/performance-tests/UDP/udp_test.cpp b/ACE/performance-tests/UDP/udp_test.cpp index 37e008e5b67..c03937ca6a0 100644 --- a/ACE/performance-tests/UDP/udp_test.cpp +++ b/ACE/performance-tests/UDP/udp_test.cpp @@ -1,20 +1,17 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// performance-tests/UDP -// -// = FILENAME -// udp_test.cpp -// -// = DESCRIPTION -// Measures UDP round-trip performance. -// -// = AUTHORS -// Fred Kuhns and David L. Levine -// -// ============================================================================ + +//============================================================================= +/** + * @file udp_test.cpp + * + * $Id$ + * + * Measures UDP round-trip performance. + * + * + * @author Fred Kuhns and David L. Levine + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/Reactor.h" @@ -101,27 +98,27 @@ public: ACE_Reactor_Mask close_mask); //FUZZ: disable check_for_lack_ACE_OS + /// Send the <buf> to the server. int send (const char *buf, size_t len); - // Send the <buf> to the server. //FUZZ: enable check_for_lack_ACE_OS + /// Wait for the response. int get_response (char *buf, size_t len); - // Wait for the response. + /// Send messages to server and record statistics. int run (void); - // Send messages to server and record statistics. //FUZZ: disable check_for_lack_ACE_OS + /// Send shutdown message to server. int shutdown (void); - // Send shutdown message to server. //FUZZ: enable check_for_lack_ACE_OS private: + /// To send messages and receive responses. ACE_SOCK_Dgram endpoint_; - // To send messages and receive responses. + /// The address to send messages to. ACE_INET_Addr remote_addr_; - // The address to send messages to. ACE_UNIMPLEMENTED_FUNC (Client (void)) ACE_UNIMPLEMENTED_FUNC (Client (const Client &)) @@ -493,8 +490,8 @@ public: ACE_Reactor_Mask close_mask); private: + /// Receives datagrams. ACE_SOCK_Dgram endpoint_; - // Receives datagrams. ACE_UNIMPLEMENTED_FUNC (Server (void)) ACE_UNIMPLEMENTED_FUNC (Server (const Server &)) |