diff options
author | gokhale <asgokhale@users.noreply.github.com> | 1997-08-10 14:24:59 +0000 |
---|---|---|
committer | gokhale <asgokhale@users.noreply.github.com> | 1997-08-10 14:24:59 +0000 |
commit | 77c27dd455853fa54768f27ab2f9cb59d24c7dce (patch) | |
tree | 2e15e7def5fa19a036a119c8eb416b10c2c6e201 /TAO | |
parent | 45c4760b5bfaefa00b039ee66a7d2bd129e07762 (diff) | |
download | ATCD-77c27dd455853fa54768f27ab2f9cb59d24c7dce.tar.gz |
A new suite of benchmark code is added. This is the library for common
features.
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/Benchmark/benchmark/Makefile | 125 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/driver.cpp | 56 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/driver.h | 54 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/marshal_options.cpp | 278 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/marshal_options.h | 207 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/marshal_options.i | 233 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/marshal_proxy.cpp | 19 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/marshal_proxy.h | 46 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/marshal_proxy.i | 10 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/marshal_results.cpp | 32 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/marshal_results.h | 70 | ||||
-rw-r--r-- | TAO/Benchmark/benchmark/marshal_results.i | 59 |
12 files changed, 1189 insertions, 0 deletions
diff --git a/TAO/Benchmark/benchmark/Makefile b/TAO/Benchmark/benchmark/Makefile new file mode 100644 index 00000000000..8af1d3b9a9f --- /dev/null +++ b/TAO/Benchmark/benchmark/Makefile @@ -0,0 +1,125 @@ +#---------------------------------------------------------------------------- +# $Id$ +# +# Top-level Makefile for the CORBA_Benchmark +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +LIBNAME = libbenchmark +LIB = $(LIBNAME).a +SHLIB = $(LIBNAME).so + +FILES = driver \ + marshal_options \ + marshal_results \ + marshal_proxy + +LSRC = $(addsuffix .cpp,$(FILES)) + +LDLIBS = -lACE +LIBS = -lACE +VLDLIBS = $(LDLIBS:%=%$(VAR)) + +BUILD = $(VSHLIB) $(VLIB) + +ifndef TAO_ROOT +TAO_ROOT = $(WRAPPER_ROOT)/TAO +endif + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.lib.GNU +#include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU +include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU + +#---------------------------------------------------------------------------- +# Local modifications to variables imported by includes above. +#---------------------------------------------------------------------------- + +CPPFLAGS += -I$(TAO_ROOT)/Benchmark/ + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +.obj/driver.o .shobj/driver.so: driver.cpp \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/driver.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/stdcpp.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i +.obj/marshal_options.o .shobj/marshal_options.so: marshal_options.cpp \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/marshal_options.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/stdcpp.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/marshal_options.i \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i +.obj/marshal_results.o .shobj/marshal_results.so: marshal_results.cpp \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/marshal_results.h \ + $(ACE_ROOT)/ace/Profile_Timer.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/stdcpp.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/High_Res_Timer.h \ + $(ACE_ROOT)/ace/High_Res_Timer.i \ + $(ACE_ROOT)/ace/Profile_Timer.i \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/marshal_results.i +.obj/marshal_proxy.o .shobj/marshal_proxy.so: marshal_proxy.cpp \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/marshal_proxy.h \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/marshal_options.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/stdcpp.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/marshal_options.i \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/marshal_results.h \ + $(ACE_ROOT)/ace/Profile_Timer.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/High_Res_Timer.h \ + $(ACE_ROOT)/ace/High_Res_Timer.i \ + $(ACE_ROOT)/ace/Profile_Timer.i \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/marshal_results.i \ + $(ACE_ROOT)/TAO/Benchmark/benchmark/marshal_proxy.i + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/Benchmark/benchmark/driver.cpp b/TAO/Benchmark/benchmark/driver.cpp new file mode 100644 index 00000000000..b2e5a413cdb --- /dev/null +++ b/TAO/Benchmark/benchmark/driver.cpp @@ -0,0 +1,56 @@ +#include "benchmark/driver.h" + +template <class T> +CORBA_Benchmark_Driver<T>::CORBA_Benchmark_Driver (T *proxy) + : proxy_ (proxy) +{ +} + +template <class T> +CORBA_Benchmark_Driver<T>::~CORBA_Benchmark_Driver (void) +{ + delete proxy_; +} + +template <class T> +int +CORBA_Benchmark_Driver<T>::run (int argc, char *argv[]) +{ + // The run method delegates the task of parsing the command line options to + // the options data member + if (this->options_.parse_args (argc, argv) == -1) + { + ACE_DEBUG ((LM_DEBUG, "CORBA_Benchmark_Driver cannot parse arguments\n")); + return -1; + } + +#if 0 + // get a handle to the proxy + this->proxy_ = this->options_.make_proxy (); + if (this->proxy_ == 0) + { + ACE_DEBUG ((LM_DEBUG, "CORBA_Benchmark_Driver cannot make proxy\n")); + return -1; + } +#endif + + // The driver delegates the task of running the test to the newly created + // proxy + if (this->proxy_->run (this->options_, this->results_) == -1) + { + ACE_DEBUG ((LM_DEBUG, "CORBA_Benchmark_Driver cannot run\n")); + return -1; + } + + // The driver delegates the task of printing the results to the TTCP_Results + // class + if (this->results_.print_results () == -1) + { + ACE_DEBUG ((LM_DEBUG, "CORBA_Benchmark_Driver cannot print results\n")); + return -1; + } + + return 0; +} + + diff --git a/TAO/Benchmark/benchmark/driver.h b/TAO/Benchmark/benchmark/driver.h new file mode 100644 index 00000000000..06a928125f6 --- /dev/null +++ b/TAO/Benchmark/benchmark/driver.h @@ -0,0 +1,54 @@ +/* -*- C++ -*- */ + +// ============================================================================ +// +// = LIBRARY +// CORBA Benchmark +// +// = FILENAME +// driver.h +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#if !defined (_CORBA_BENCHMARK_DRIVER_H_) +#define _CORBA_BENCHMARK_DRIVER_H_ + +#include "ace/Log_Msg.h" + +template <class PROXY> +class CORBA_Benchmark_Driver +{ + // = TITLE + // CORBA Benchmark Driver. + // + // = DESCRIPTION + // This class encapsulates all the driver common to the CORBA benchmark + // tests. It provides a template to run the benchmarking code. The real + // work will be done by the PROXY class. +public: + + CORBA_Benchmark_Driver (PROXY *p); + // Constructor. + + ~CORBA_Benchmark_Driver (void); + // Destructor + + int run (int argc, char *argv[]); + // This is the starting point of all CORBA benchmark tests. + // Returns 0 on success, -1 on error. + +private: + PROXY *proxy_; + // the actual object that will do the work + + PROXY::RESULTS results_; + // Storage of test results. + + PROXY::OPTIONS options_; + // CORBA test command line options +}; + +#endif /* CORBA_BENCHMARK_DRIVER_H */ diff --git a/TAO/Benchmark/benchmark/marshal_options.cpp b/TAO/Benchmark/benchmark/marshal_options.cpp new file mode 100644 index 00000000000..2473032f5da --- /dev/null +++ b/TAO/Benchmark/benchmark/marshal_options.cpp @@ -0,0 +1,278 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Benchmark +// +// = FILENAME +// marshal_options.cpp +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#include "benchmark/marshal_options.h" +#include "ace/Get_Opt.h" + +#if !defined (__ACE_INLINE__) +#include "benchmark/marshal_options.i" +#endif /* __ACE_INLINE__ */ + +static char *usage_string = +"Marshal_Test available options: \n\ +-d : set debug ON \n\ +-D : set TCP NO DELAY on \n\ +-n <service name> : set the service name\n\ +-s <snd sock bufsize> : set sender sock buf \n\ +-r <rcv sock bufsize> : set recv sock buf \n\ +-h <hostname> : hostname to listen/connect \n\ +-p <portnum> : port num to listen \n\ +-i <iters> : number of iters \n\ +-R <ROLE> : s(ender)/r(eceiver) \n\ +-T <datatype> : s(hort)/l(ong)/d(ouble)/o(ctet)/c(har)/\n\ + S(truct)/U(nion)/A(ny)/(se)Q/R(ecursive)\n\ +-P <policy> : S(II/SI)/D(II/SI) depending on role \n\ +-I <CORBA impl> : O(rbix)/V(isiBroker)/T(AO)\n\ +-o <obj name> : obj to bind to \n\ +-f <filename> : filename to store results \n\ +"; + +int +CORBA_Marshal_Options::Usage (void) +{ + ACE_DEBUG ((LM_DEBUG, "%s\n", usage_string)); + return -1; +} + +int +CORBA_Marshal_Options::parse_args (int argc, char *argv []) +{ + int c; // option letter used + ACE_Get_Opt get_opt (argc, argv, "dDn:s:r:h:p:i:R:T:P:I:o:f:"); + + // ACE_DEBUG ((LM_DEBUG, "CORBA_Marshal_Options::parse_args\n")); + + while ((c = get_opt ()) != -1) + { + switch (c) + { + case 'd': // debug + this->debug (1); + break; + case 'D': // TCP NODELAY + this->disable_nagle (1); + break; + case 'n': + this->service_name (get_opt.optarg); + break; + case 's': // sender socket size + this->snd_socket_queue_size (ACE_OS::atoi (get_opt.optarg)); + break; + case 'r': // receive socket size + this->rcv_socket_queue_size (ACE_OS::atoi (get_opt.optarg)); + break; + case 'h': // hostname + this->hostname (ACE_OS::strdup (get_opt.optarg)); + break; + case 'p': // port number + this->port (ACE_OS::atoi (get_opt.optarg)); + break; + case 'i': // port number + this->iterations (ACE_OS::atoi (get_opt.optarg)); + break; + case 'R': // role + switch (*get_opt.optarg) + { + case 'S': // sender + case 's': // sender + this->role (SENDER); + break; + case 'R': // receiver + case 'r': // receiver + this->role (RECEIVER); + break; + default: + return this->Usage (); + } + break; + case 'T': // data type to test + switch (*get_opt.optarg) + { + case 's': // short + this->data_type (SHORT); + break; + case 'd': // double + this->data_type (DOUBLE); + break; + case 'o': // octet + this->data_type (OCTET); + break; + case 'c': // char + this->data_type (CHAR); + break; + case 'S': // Struct + this->data_type (STRUCT); + break; + case 'U': // Union + this->data_type (UNION); + break; + case 'A': // Any + this->data_type (ANY); + break; + case 'Q': // Sequence + this->data_type (SEQUENCE); + break; + case 'R': // Recursive + this->data_type (RECURSIVE); + break; + case 'l': // long, also the default + default: + this->data_type (LONG); + break; + } + break; + case 'P': // policy + switch (*get_opt.optarg) + { + case 'S': + case 's': + this->policy (STATIC); + break; + case 'D': + case 'd': + this->policy (DYNAMIC); + break; + default: + return this->Usage (); + } + break; + case 'I': // impl + switch (*get_opt.optarg) + { + case 'O': // Orbix + this->proxy_type (ORBIX); + break; + case 'V': // VisiBroker + this->proxy_type (VISIBROKER); + break; + case 'T': // TAO + this->proxy_type (TAO); + break; + } + break; + case 'o': // obj name + this->object_name (ACE_OS::strdup (get_opt.optarg)); + break; + case 'f': // file name to save results + this->filename (ACE_OS::strdup (get_opt.optarg)); + break; + default: // error + return this->Usage (); + } + } + return 0; +} + +int +CORBA_Marshal_Options::orb_init_args (int &argc, char *argv []) +{ + char buffer [200]; + + argc = 0; + switch (this->proxy_type_) + { + case ORBIX: + break; + case VISIBROKER: + { + ACE_OS::memset (buffer, '\0', 200); + if (snd_socket_queue_size_ > 0) + { + ACE_OS::sprintf (buffer, "-ORBsendbufsize %d", snd_socket_queue_size_); + orb_init_args_ += ACE_CString (buffer); + argc ++; + } + + ACE_OS::memset (buffer, '\0', 200); + if (rcv_socket_queue_size_ > 0) + { + ACE_OS::sprintf (buffer, "-ORBrcvbufsize %d", rcv_socket_queue_size_); + orb_init_args_ += ACE_CString (buffer); + argc ++; + } + } + break; + case TAO: + break; + } + ACE_OS::memset (buffer, '\0', 200); + ACE_OS::memcpy (buffer, boa_init_args_.rep (), boa_init_args_.length ()); + return 0; +} + +static char buffer [20][200]; + +int +CORBA_Marshal_Options::boa_init_args (int &argc, char *argv []) +{ + argc = 0; + switch (this->proxy_type_) + { + case ORBIX: + break; + case VISIBROKER: + { + ACE_OS::memset (buffer[argc], '\0', 200); + if (snd_socket_queue_size_ > 0) + { + ACE_OS::sprintf (buffer[argc], "-OAsendbufsize %d", snd_socket_queue_size_); + // boa_init_args_ += ACE_CString (buffer[argc]); + argc ++; + } + ACE_OS::memset (buffer[argc], '\0', 200); + if (rcv_socket_queue_size_ > 0) + { + ACE_OS::sprintf (buffer[argc], "-OArcvbufsize %d", rcv_socket_queue_size_); + // boa_init_args_ += ACE_CString (buffer[argc]); + argc ++; + } + ACE_OS::memset (buffer[argc], '\0', 200); + if (port_ > 0) + { + ACE_OS::sprintf (buffer[argc], "-OAport %d", port_); + // boa_init_args_ += ACE_CString (buffer[argc]); + argc ++; + } + ACE_OS::memset (buffer[argc], '\0', 200); + if (hostname_ != 0 && role_ == RECEIVER) + { + ACE_OS::sprintf (buffer[argc], "-OAipaddr %s", hostname_); + // boa_init_args_ += ACE_CString (buffer[argc]); + argc ++; + } + } + break; + case TAO: + { + ACE_OS::memset (buffer[argc], '\0', 200); + if (port_ > 0) + { + ACE_OS::sprintf (buffer[argc], "-OAport %d", port_); + // boa_init_args_ += ACE_CString (buffer); + argc ++; + } + ACE_OS::memset (buffer[argc], '\0', 200); + if (hostname_ != 0 && role_ == RECEIVER) + { + ACE_OS::sprintf (buffer[argc], "-OAhostname %s", hostname_); + // boa_init_args_ += ACE_CString (buffer); + argc ++; + } + } + break; + } + // ACE_OS::memset (buffer, '\0', 200); + // ACE_OS::memcpy (buffer, boa_init_args_.rep (), boa_init_args_.length ()); + return 0; +} + diff --git a/TAO/Benchmark/benchmark/marshal_options.h b/TAO/Benchmark/benchmark/marshal_options.h new file mode 100644 index 00000000000..49639cd74f1 --- /dev/null +++ b/TAO/Benchmark/benchmark/marshal_options.h @@ -0,0 +1,207 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Benchmark/Marshal +// +// = FILENAME +// marshal_options.h +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#if !defined (_CORBA_MARSHAL_OPTIONS_H_) +#define _CORBA_MARSHAL_OPTIONS_H_ + +#include "ace/OS.h" +#include "ace/SString.h" + +class CORBA_Marshal_Options +{ + // = TITLE + // CORBA_Marshal_Options + // = DESCRIPTION + // An encapsulation of all the CORBA_MARSHAL test parameters. This is + // used to communicate between the ACE_CORBA_Marshal_Driver and all + // specializations of CORBA_Marshal_Proxy. It must be noted that not all + // options will be valid for a given specialization of CORBA_Marshal_Proxy. This is + // a "all-encompassing" class. +public: + // The following data types will be tested + enum DATATYPE + { + NO_DATATYPE, + SHORT, + LONG, + DOUBLE, + CHAR, + OCTET, + STRUCT, + UNION, + ANY, + SEQUENCE, + RECURSIVE + }; + + // The following CORBA implementations will be tested + enum PROXY_TYPE + { + NO_PROXY, + TAO, + ORBIX, + VISIBROKER + }; + + // Invocation policy + enum POLICY + { + NO_POLICY, + STATIC, // SII, SSI + DYNAMIC // DII, DSI + }; + + // what role do we play? + enum ROLE + { + NO_ROLE, + SENDER, + RECEIVER + }; + + CORBA_Marshal_Options (void); + // Construction. Sets default values. + + ~CORBA_Marshal_Options (void); + // Destructor + + int parse_args (int argc, char *argv[]); + // Parse command line arguments. This decides what type of CORBA_MARSHAL + // test to run. + + // All the command line options + + //= Get/Set the data type to be sent/received + CORBA_Marshal_Options::DATATYPE data_type (void); + void data_type (CORBA_Marshal_Options::DATATYPE); + + //= Get/set the proxy type + CORBA_Marshal_Options::PROXY_TYPE proxy_type (void); + void proxy_type (CORBA_Marshal_Options::PROXY_TYPE); + + //= Get/Set the policy used by clients/servers for communication + CORBA_Marshal_Options::POLICY policy (void); + void policy (CORBA_Marshal_Options::POLICY); + + //= Get/Set whether we are client or server (sender/receiver) + CORBA_Marshal_Options::ROLE role (void); + void role (CORBA_Marshal_Options::ROLE); + + //= Get/Set the hostname client connects to or the interface on which the + //server listens to + const char *hostname (void); + void hostname (const char *); + + //= Get/set the port number on which the server listens + short port (void); + void port (short); + + //= Get/Set the object name (to which to connect to) + const char *object_name (void); + void object_name (const char *); + + //= Get/Set the service name (for impl is ready) + const char *service_name (void); + void service_name (const char *); + + // = Get/set receive sockbufsize. + int rcv_socket_queue_size (void); + void rcv_socket_queue_size (int); + + // = Get/set send sockbufsize. + int snd_socket_queue_size (void); + void snd_socket_queue_size (int); + + // = Get/set whether to use TCP_NODELAY or not + unsigned short disable_nagle (void); + void disable_nagle (unsigned short); + + // = Get/set whether to print debug messages. + unsigned short debug (void); + void debug (unsigned short); + + // =Get/Set filename to store results + const char *filename (void); + void filename (const char *fname); + + // =Get/set number of iterations + int iterations (void); + void iterations (int iter); + + int Usage (void); + // prints a usage message and always returns -1 + + int orb_init_args (int &argc, char * argv []); + // return a string that will be passed to the ORB init method based on the + // other options and proxy type + + int boa_init_args (int &argc, char * argv []); + // return a string that will be passed to the BOA init method based on the + // other options and proxy type + +private: + const char *object_name_; + // name of the object. + + const char *service_name_; + // name of the service. + + CORBA_Marshal_Options::DATATYPE data_type_; + // data type to send/receive + + CORBA_Marshal_Options::PROXY_TYPE proxy_type_; + // the proxy type, e.g., ACE, Orbix, VisiBroker, etc + + CORBA_Marshal_Options::POLICY policy_; + // communications policy used by the communicating entity + + CORBA_Marshal_Options::ROLE role_; + // Are we creating a sender or receiver? + + int rcv_socket_queue_size_; + // Size of socket queue. + + int snd_socket_queue_size_; + // Size of socket queue. + + unsigned short disable_nagle_; + // Nagle must be stopped. + + unsigned short debug_; + // Should we print debug messages? + + short port_; + // Port for socket connections to use. + + const char *hostname_; + // Host for senders to connect to. and servers to listen on + + const char *filename_; + // filename in which to store the results + + int iterations_; + // number of times to run the same test + + ACE_CString orb_init_args_; + // arguments to orb_init + + ACE_CString boa_init_args_; + // arguments to boa_init + +}; + +#if defined (__ACE_INLINE__) +#include "benchmark/marshal_options.i" +#endif /* __ACE_INLINE__ */ + +#endif diff --git a/TAO/Benchmark/benchmark/marshal_options.i b/TAO/Benchmark/benchmark/marshal_options.i new file mode 100644 index 00000000000..cb3506aa35f --- /dev/null +++ b/TAO/Benchmark/benchmark/marshal_options.i @@ -0,0 +1,233 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Benchmark/Marshal +// +// = FILENAME +// marshal_options.i +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +// constructor +ACE_INLINE +CORBA_Marshal_Options::CORBA_Marshal_Options (void) + : object_name_ (0), + data_type_ (CORBA_Marshal_Options::NO_DATATYPE), + proxy_type_ (CORBA_Marshal_Options::NO_PROXY), + policy_ (CORBA_Marshal_Options::NO_POLICY), + role_ (CORBA_Marshal_Options::NO_ROLE), + rcv_socket_queue_size_ (-1), + snd_socket_queue_size_ (-1), + disable_nagle_ (0), + debug_ (0), + hostname_ (0), + port_ (-1), + iterations_ (0) +{ +} + + +// destructor +ACE_INLINE +CORBA_Marshal_Options::~CORBA_Marshal_Options (void) +{ +} + +// set the data type to be transferred +ACE_INLINE void +CORBA_Marshal_Options::data_type (CORBA_Marshal_Options::DATATYPE dt) +{ + data_type_ = dt; +} + +// get the data type to be transferred +ACE_INLINE CORBA_Marshal_Options::DATATYPE +CORBA_Marshal_Options::data_type (void) +{ + return data_type_; +} + +// set the proxy type to be transferred +ACE_INLINE void +CORBA_Marshal_Options::proxy_type (CORBA_Marshal_Options::PROXY_TYPE pt) +{ + proxy_type_ = pt; +} + +// get the data type to be transferred +ACE_INLINE CORBA_Marshal_Options::PROXY_TYPE +CORBA_Marshal_Options::proxy_type (void) +{ + return proxy_type_; +} + +// set the policy type to be transferred +ACE_INLINE void +CORBA_Marshal_Options::policy (CORBA_Marshal_Options::POLICY inv) +{ + policy_ = inv; +} + +// get the policy type to be transferred +ACE_INLINE CORBA_Marshal_Options::POLICY +CORBA_Marshal_Options::policy (void) +{ + return policy_; +} + +// set the role type to be transferred +ACE_INLINE void +CORBA_Marshal_Options::role (CORBA_Marshal_Options::ROLE my_role) +{ + role_ = my_role; +} + +// get the role type to be transferred +ACE_INLINE CORBA_Marshal_Options::ROLE +CORBA_Marshal_Options::role (void) +{ + return role_; +} + +// set the hostname +ACE_INLINE void +CORBA_Marshal_Options::hostname (const char *hname) +{ + hostname_ = hname; +} + +// get the hostname +ACE_INLINE const char* +CORBA_Marshal_Options::hostname (void) +{ + return hostname_; +} + +// set the post +ACE_INLINE void +CORBA_Marshal_Options::port (short portnum) +{ + port_ = portnum; +} + +// get the port +ACE_INLINE short +CORBA_Marshal_Options::port (void) +{ + return port_; +} + +// set the object name +ACE_INLINE void +CORBA_Marshal_Options::object_name (const char *objname) +{ + object_name_ = objname; +} + +// get the object name +ACE_INLINE const char * +CORBA_Marshal_Options::object_name (void) +{ + return object_name_; +} + +// set the service name +ACE_INLINE void +CORBA_Marshal_Options::service_name (const char *srvname) +{ + service_name_ = srvname; +} + +// get the service name +ACE_INLINE const char * +CORBA_Marshal_Options::service_name (void) +{ + return service_name_; +} + +// set the receive sock size +ACE_INLINE void +CORBA_Marshal_Options::rcv_socket_queue_size (int socksize) +{ + rcv_socket_queue_size_ = socksize; +} + +// get the receive sock size +ACE_INLINE int +CORBA_Marshal_Options::rcv_socket_queue_size (void) +{ + return rcv_socket_queue_size_; +} + +// set the sender sock size +ACE_INLINE void +CORBA_Marshal_Options::snd_socket_queue_size (int socksize) +{ + snd_socket_queue_size_ = socksize; +} + +// get the snd sock size +ACE_INLINE int +CORBA_Marshal_Options::snd_socket_queue_size (void) +{ + return snd_socket_queue_size_; +} + +// set whether Nagle algo is to be disabled +ACE_INLINE void +CORBA_Marshal_Options::disable_nagle (unsigned short val) +{ + disable_nagle_ = (val ? 1 : 0); +} + +// get whether Nagle algo is disabled +ACE_INLINE unsigned short +CORBA_Marshal_Options::disable_nagle (void) +{ + return disable_nagle_; +} + +// set whether debug is to be disabled +ACE_INLINE void +CORBA_Marshal_Options::debug (unsigned short val) +{ + debug_ = (val ? 1 : 0); +} + +// get whether debug is disabled +ACE_INLINE unsigned short +CORBA_Marshal_Options::debug (void) +{ + return debug_; +} + +// set the filename +ACE_INLINE void +CORBA_Marshal_Options::filename (const char *fname) +{ + filename_ = fname; +} + +// get the filename +ACE_INLINE const char* +CORBA_Marshal_Options::filename (void) +{ + return filename_; +} + +// set the iterations +ACE_INLINE void +CORBA_Marshal_Options::iterations (int iter) +{ + iterations_ = iter; +} + +// get the iterations +ACE_INLINE int +CORBA_Marshal_Options::iterations (void) +{ + return iterations_; +} diff --git a/TAO/Benchmark/benchmark/marshal_proxy.cpp b/TAO/Benchmark/benchmark/marshal_proxy.cpp new file mode 100644 index 00000000000..aa6aa1e631c --- /dev/null +++ b/TAO/Benchmark/benchmark/marshal_proxy.cpp @@ -0,0 +1,19 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Benchmark +// +// = FILENAME +// marshal_proxy.cpp +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#include "benchmark/marshal_proxy.h" + +#if !defined (__ACE_INLINE__) +#include "benchmark/marshal_proxy.i" +#endif /* __ACE_INLINE__ */ + diff --git a/TAO/Benchmark/benchmark/marshal_proxy.h b/TAO/Benchmark/benchmark/marshal_proxy.h new file mode 100644 index 00000000000..de81ccf95ea --- /dev/null +++ b/TAO/Benchmark/benchmark/marshal_proxy.h @@ -0,0 +1,46 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Benchmark +// +// = FILENAME +// marshal_proxy.h +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#if !defined(_CORBA_MARSHAL_PROXY_H_) +#define _CORBA_MARSHAL_PROXY_H_ + +#include "benchmark/marshal_options.h" +#include "benchmark/marshal_results.h" + +class CORBA_Marshal_Proxy +{ + // = TITLE + // Abstract handle for all CORBA_Marshal tests. + // = DESCRIPTION + // The IMPL class is the CORBA specific class which does the real work. The + // IMPL class must support the run method +public: + typedef CORBA_Marshal_Options OPTIONS; + typedef CORBA_Marshal_Results RESULTS; + + CORBA_Marshal_Proxy (void); + // constructor + + virtual ~CORBA_Marshal_Proxy (void); + // destructor + + virtual int run (OPTIONS &, RESULTS &) = 0; + // run the test + +}; + +#if defined (__ACE_INLINE__) +#include "benchmark/marshal_proxy.i" +#endif /* __ACE_INLINE__ */ + +#endif diff --git a/TAO/Benchmark/benchmark/marshal_proxy.i b/TAO/Benchmark/benchmark/marshal_proxy.i new file mode 100644 index 00000000000..746651741b3 --- /dev/null +++ b/TAO/Benchmark/benchmark/marshal_proxy.i @@ -0,0 +1,10 @@ + +ACE_INLINE +CORBA_Marshal_Proxy::CORBA_Marshal_Proxy (void) +{ +} + +ACE_INLINE +CORBA_Marshal_Proxy::~CORBA_Marshal_Proxy (void) +{ +} diff --git a/TAO/Benchmark/benchmark/marshal_results.cpp b/TAO/Benchmark/benchmark/marshal_results.cpp new file mode 100644 index 00000000000..416827a08d7 --- /dev/null +++ b/TAO/Benchmark/benchmark/marshal_results.cpp @@ -0,0 +1,32 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Benchmark/Marshal +// +// = FILENAME +// marshal_results.cpp +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#include "benchmark/marshal_results.h" + +#if !defined (__ACE_INLINE__) +#include "benchmark/marshal_results.i" +#endif /* __ACE_INLINE__ */ + +int +CORBA_Marshal_Results::log_results (void) +{ + return 0; +} + +int +CORBA_Marshal_Results::print_results (void) +{ + // ACE_DEBUG ((LM_DEBUG, "CORBA_Marshal_Results::print_results\n")); + + return 0; // success +} diff --git a/TAO/Benchmark/benchmark/marshal_results.h b/TAO/Benchmark/benchmark/marshal_results.h new file mode 100644 index 00000000000..5f7647c77a3 --- /dev/null +++ b/TAO/Benchmark/benchmark/marshal_results.h @@ -0,0 +1,70 @@ +// ============================================================================ +// +// = LIBRARY +// CORBA Benchmark +// +// = FILENAME +// marshal_results.h +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#if !defined (_CORBA_MARSHAL_RESULTS_H_) +#define _CORBA_MARSHAL_RESULTS_H_ + +#include "ace/Profile_Timer.h" + +class CORBA_Marshal_Results +{ +public: + CORBA_Marshal_Results (void); + // Construction. + + ~CORBA_Marshal_Results (void); + // destructor. + + void clear (void); + // Clear all results. + + ACE_Profile_Timer::ACE_Elapsed_Time & elapsed_time (void); + // Get the elapsed time. + + ACE_Profile_Timer::Rusage elapsed_rusage (void); + // compute the rusage + + int start_timer (void); + // starts a profile timer. + + int stop_timer (void); + // stops the profile timer. + + void filename (const char *fname); + // set the name of the file to store results + + int log_results (void); + // log results + + int print_results (void); + // prints the results + +private: + + // = Used for performance statistics + ACE_Profile_Timer timer_; + ACE_Profile_Timer::ACE_Elapsed_Time et_; + ACE_Profile_Timer::Rusage rusage_; + + double elapsed_time_; + // Real elapsed time in seconds. + + const char *filename_; + // filename +}; + +#if defined (__ACE_INLINE__) +#include "benchmark/marshal_results.i" +#endif /* __ACE_INLINE__ */ + +#endif diff --git a/TAO/Benchmark/benchmark/marshal_results.i b/TAO/Benchmark/benchmark/marshal_results.i new file mode 100644 index 00000000000..85c6dfce5f9 --- /dev/null +++ b/TAO/Benchmark/benchmark/marshal_results.i @@ -0,0 +1,59 @@ + +// ============================================================================ +// +// = LIBRARY +// CORBA Benchmark/Marshal +// +// = FILENAME +// marshal_results.i +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +ACE_INLINE +CORBA_Marshal_Results::CORBA_Marshal_Results (void) + : filename_ (0), + elapsed_time_ (0) +{ +} + +ACE_INLINE +CORBA_Marshal_Results::~CORBA_Marshal_Results (void) +{ +} + +ACE_INLINE int +CORBA_Marshal_Results::start_timer (void) +{ + return this->timer_.start (); +} + +ACE_INLINE int +CORBA_Marshal_Results::stop_timer (void) +{ + return this->timer_.stop (); +} + +ACE_INLINE ACE_Profile_Timer::ACE_Elapsed_Time & +CORBA_Marshal_Results::elapsed_time (void) +{ + (void) this->timer_.elapsed_time (this->et_); + return this->et_; +} + +ACE_INLINE ACE_Profile_Timer::Rusage +CORBA_Marshal_Results::elapsed_rusage (void) +{ + (void) this->timer_.elapsed_rusage (this->rusage_); + return this->rusage_; +} + +ACE_INLINE void +CORBA_Marshal_Results::filename (const char *fname) +{ + this->filename_ = fname; +} + + |