diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-06-17 18:04:15 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-06-17 18:04:15 +0000 |
commit | def866e169fec82f8dc5ed0a704271370a70ec8a (patch) | |
tree | 7c06d41c5be929e2941d8469ca2cac501fe73e9f /performance-tests | |
parent | 93a16ac7e1ebc8bc27dfa8c9935bc67f32695dcd (diff) | |
download | ATCD-def866e169fec82f8dc5ed0a704271370a70ec8a.tar.gz |
Removed these files because of code rot!
Diffstat (limited to 'performance-tests')
-rw-r--r-- | performance-tests/TTCP/ORBeline/How_to_run_tests | 57 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/Makefile | 33 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/run_test | 30 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/ser | 4 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/stdmk | 34 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/tango_clt | 6 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/ttcp.idl | 25 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/ttcp_c.cc | 302 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/ttcp_c.hh | 181 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/ttcp_i.cpp | 1026 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/ttcp_i.h | 45 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/ttcp_s.cc | 168 | ||||
-rw-r--r-- | performance-tests/TTCP/ORBeline/ttcp_s.hh | 89 |
13 files changed, 0 insertions, 2000 deletions
diff --git a/performance-tests/TTCP/ORBeline/How_to_run_tests b/performance-tests/TTCP/ORBeline/How_to_run_tests deleted file mode 100644 index 75d5500fb20..00000000000 --- a/performance-tests/TTCP/ORBeline/How_to_run_tests +++ /dev/null @@ -1,57 +0,0 @@ -// ORBeline -// -// sequence AND string - -// HOSTNAMES: -// For our tests, tango.cs.wustl.edu was the receiver hostname. For atm transfers, you -// should setup the environment variable ORBELINE_IPADDR=ATM-IP-ADDR. Otherwise, -// the ethernet IP address of tango.cs.wustl.edu wis used. -// For your case, substitute the proper receiver hostname for your system. - -// ORBeline DAEMONS: -// there must be an ORBeline daemon running on the receiver host in your system. -// in our case, we had an ORBeline daemon running on tango.cs.wustl.edu - -// ACE_ROOT: -// ACE_ROOT can be set to the root directory of ACE so that these lines -// can be cut and pasted to run tests. - -// Results: -// These examples show the result files being stored in a /results directory off -// the current path. This can be set to whatever you like. - -// ****** sequence ****** (-q option flag) - -// ATM with 64k receiver buffers (setenv ORBELINE_IPADDR=128.252.114.18) -Receiver_Host: server "$ACE_ROOT/apps/ttcp/orbeline/server -s -r -fm -b 65536 -q" -Sender_Host: run_test 64 tango.cs.wustl.edu ./results/sequence.atm.64 -q - -// ATM with 8k reciever buffers (setenv ORBELINE_IPADDR=128.252.114.18) -Receiver_Host: server "$ACE_ROOT/apps/ttcp/orbeline/server -s -r -fm -q" -Sender_Host: run_test 64 tango.cs.wustl.edu ./results/sequence.atm.8 -q - -// ETHERNET with 64k receiver buffers -Receiver_Host: server "$ACE_ROOT/apps/ttcp/orbeline/server -s -r -fm -b 65536 -q" -Sender_Host: run_test 64 tango.cs.wustl.edu ./results/sequence.atm.64 -q - -// ETHERNET with 8k reciever buffers -Receiver_Host: server "$ACE_ROOT/apps/ttcp/orbeline/server -s -r -fm -q" -Sender_Host: run_test 64 tango.cs.wustl.edu ./results/sequence.atm.8 -q - -// ****** string ****** (-q is omitted) - -// ATM with 64k receiver buffers (setenv ORBELINE_IPADDR=128.252.114.18) -Receiver_Host: server "$ACE_ROOT/apps/ttcp/orbeline/server -s -r -fm -b 65536" -Sender_Host: run_test 64 tango.cs.wustl.edu ./results/sequence.atm.64 - -// ATM with 8k reciever buffers (setenv ORBELINE_IPADDR=128.252.114.18) -Receiver_Host: server "$ACE_ROOT/apps/ttcp/orbeline/server -s -r -fm" -Sender_Host: run_test 64 tango.cs.wustl.edu ./results/sequence.atm.64 - -// ETHERNET with 64k receiver buffers -Receiver_Host: server "$ACE_ROOT/apps/ttcp/orbeline/server -s -r -fm" -Sender_Host: run_test 64 tango.cs.wustl.edu ./results/sequence.atm.8 - -// ETHERNET with 8k reciever buffers -Receiver_Host: server "$ACE_ROOT/apps/ttcp/orbeline/server -s -r -fm" -Sender_Host: run_test 64 tango.cs.wustl.edu ./results/sequence.atm.8 diff --git a/performance-tests/TTCP/ORBeline/Makefile b/performance-tests/TTCP/ORBeline/Makefile deleted file mode 100644 index b5e39348090..00000000000 --- a/performance-tests/TTCP/ORBeline/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -include ./stdmk -EXE = server client - -all: $(EXE) - -# Remeber -p for generating mon.out for profiler -#C++FLAGS = -O4 -p -DTEST_SEQUENCE -#C++FLAGS = -O4 -DTEST_SEQUENCE -#C++FLAGS = -O4 -p -#C++FLAGS = -g -C++FLAGS = -O4 $(CCFLAGS) - -realclean: - -rm -f core *.o client server $(EXE) *~ - -clean: - -rm -f core *.o client server $(EXE) *~ - -ttcp_c.cc: ttcp.idl - $(ORBCC) ttcp.idl - -ttcp_s.cc: ttcp.idl - $(ORBCC) ttcp.idl - -ttcp_i.o: ttcp_i.cpp - $(CC) $(C++FLAGS) -I./ -I../../include -c ttcp_i.cpp - -client : ttcp_s.o ttcp_c.o ttcp_i.o - $(CC) $(C++FLAGS) -o client ttcp_i.o ttcp_s.o ttcp_c.o $(LIBPATH) $(LIBORB) $(STDCC_LIBS) - -server : ttcp_s.o ttcp_c.o ttcp_i.o - $(CC) $(C++FLAGS) -o server ttcp_i.o ttcp_s.o ttcp_c.o $(LIBPATH) $(LIBORB) $(STDCC_LIBS) - diff --git a/performance-tests/TTCP/ORBeline/run_test b/performance-tests/TTCP/ORBeline/run_test deleted file mode 100644 index 842be36c4ac..00000000000 --- a/performance-tests/TTCP/ORBeline/run_test +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/csh -f -if ($#argv < 3) then - echo "Usage: sclt <Max msg size> <destination> <TitleOfThisTest> -q" - exit 1 -endif -# -@ msize=1024 -@ limit= ($argv[1] * 1024) -#echo $limit -#echo $msize -echo "Iteration#" 1 ": client -D -fm -s -t -l" $msize "-h" $2 "-L" $3 $4 -client -D -fm -s -t -l $msize -h $2 -x -L $3 $4 -set flag=0 -while ($msize <= $limit) - if ($flag == 0) goto label - echo "Iteration#" 1 ": client -D -fm -s -t -l" $msize "-h" $2 "-x -L" $3 $4 - client -D -fm -s -t -l $msize -h $2 -x -L $3 $4 - label: - set flag=1 - foreach i (2 3 4 5) - echo "Iteration#" $i ": client -D -fm -s -t -l" $msize "-h" $2 "-x -L " $3 $4 - client -D -fm -s -t -l $msize -h $2 -L $3 $4 - end - echo "---------------------------" - @ msize = ($msize * 2) -end - -echo " " -echo "Done at:" -date diff --git a/performance-tests/TTCP/ORBeline/ser b/performance-tests/TTCP/ORBeline/ser deleted file mode 100644 index da25e305013..00000000000 --- a/performance-tests/TTCP/ORBeline/ser +++ /dev/null @@ -1,4 +0,0 @@ -server -s -r -fm -b 65536 $1 -#8192 -#16384 -#32768 diff --git a/performance-tests/TTCP/ORBeline/stdmk b/performance-tests/TTCP/ORBeline/stdmk deleted file mode 100644 index 0acbf5c922c..00000000000 --- a/performance-tests/TTCP/ORBeline/stdmk +++ /dev/null @@ -1,34 +0,0 @@ -CC = CC -DEBUG = - -ORBELINEDIR = $(ORBELINE_ROOT) - -ORBCC = $(ORBELINEDIR)/bin/orbeline -v _c -m _s - -CCINCLUDES = -I. -I$(ORBELINEDIR)/include - -CCFLAGS = $(CCINCLUDES) $(DEBUG) - -LIBPATH = -L$(ORBELINEDIR)/lib - -STDCC_LIBS = -lsocket -lnsl -ldl - -LIBIR = -lir -LIBORB = -lorb -lorbinit -LIBDII = -ldii -lir - -.SUFFIXES: .C .o .h .hh .cc - -.C.o: - $(CC) $(CCFLAGS) -c -o $@ $< - -.cc.o: - $(CC) $(CCFLAGS) -c -o $@ $< - -.C.cpp: - $(CC) -E $(CCFLAGS) $< > $@ - -.cc.cpp: - $(CC) -E $(CCFLAGS) $< > $@ - - diff --git a/performance-tests/TTCP/ORBeline/tango_clt b/performance-tests/TTCP/ORBeline/tango_clt deleted file mode 100644 index fb5ec083ec1..00000000000 --- a/performance-tests/TTCP/ORBeline/tango_clt +++ /dev/null @@ -1,6 +0,0 @@ -client -fm -s -t -D -l 1024 -h tango.cs.wustl.edu $1 -#4096 -#32768 -#16384 -#131072 -#262144 diff --git a/performance-tests/TTCP/ORBeline/ttcp.idl b/performance-tests/TTCP/ORBeline/ttcp.idl deleted file mode 100644 index 201fa70c3af..00000000000 --- a/performance-tests/TTCP/ORBeline/ttcp.idl +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// @(#)ttcp.idl 1.1 10/18/96 - - -interface ttcp_sequence { - -typedef sequence<char> my_sequence; - - oneway void send (in my_sequence ttcp_rec); - oneway void send_hack (in string ttcp_string); - oneway void start_timer (); - oneway void stop_timer (); -}; - -interface ttcp_string { - - oneway void send (in string ttcp_string); - oneway void send_hack (in string ttcp_string); - oneway void start_timer (); - oneway void stop_timer (); -}; - - diff --git a/performance-tests/TTCP/ORBeline/ttcp_c.cc b/performance-tests/TTCP/ORBeline/ttcp_c.cc deleted file mode 100644 index da268e96821..00000000000 --- a/performance-tests/TTCP/ORBeline/ttcp_c.cc +++ /dev/null @@ -1,302 +0,0 @@ -/* This file is automatically generated by Orbeline. */ -/* Do not modify this file. */ -/* Orbeline (c) is copyrighted by PostModern Computing, Inc. */ - -#include <ttcp_c.hh> - -const CORBA::TypeInfo ttcp_sequence::_class_info("ttcp_sequence", - &ttcp_sequence::_reader, - CORBA::Object::_desc(), - 0); -const CORBA::TypeInfo *ttcp_sequence::_desc() -{ - return &_class_info; -} -const CORBA::TypeInfo *ttcp_sequence::_type_info() const -{ - return &_class_info; -} -void *ttcp_sequence::_safe_narrow(const CORBA::TypeInfo *info) const -{ - if (&_class_info == info) - return (void *) this; - void *ret = NULL; - return ret; -} -ttcp_sequence *ttcp_sequence::_narrow(const CORBA::Object *obj) -{ - void *ptr = obj->_safe_narrow(&_class_info); - return (ttcp_sequence *) ptr; -} -ttcp_sequence *ttcp_sequence::_bind(CORBA::Environment &_env, const char *_object_name, - const char *_host_name, const CORBA::BindOptions *opt) -{ - _env.clear_exception(); - ttcp_sequence *_impl; - CORBA::Object *_obj = _implementation("ttcp_sequence", _object_name); - if (!_obj) { - _impl = new ttcp_sequence(_object_name); -#if defined(_MSC_BUG) - _impl->Object::_bind("ttcp_sequence", _env, _object_name, _host_name, opt); -#else - _impl->CORBA::Object::_bind("ttcp_sequence", _env, _object_name, _host_name, opt); -#endif - if (_env.check_exception()) { - delete _impl; - return NULL; - } - } - else - _impl = ttcp_sequence::_narrow(_obj); - return _impl; -} - -#if !defined(_IMPLEMENT_SEQUENCE_CORBA__Char_ttcp_sequence__) && defined(_DECLARE_SEQUENCE_CORBA__Char_ttcp_sequence___ttcp_idl) -#define _IMPLEMENT_SEQUENCE_CORBA__Char_ttcp_sequence__ -IMPLEMENT_PRIMITIVE_SEQUENCE(CORBA__Char,CORBA::Char,ttcp_sequence::) -#endif - - - - - -void ttcp_sequence::send(const ttcp_sequence::my_sequence& ttcp_rec, CORBA::Environment& _env) -{ - _env.clear_exception(); - if (_is_local()) { - send(ttcp_rec); - return; - } - CORBA::MarshalStream *_strm = _create_oneway_request( - "ttcp_sequence", _ttcp_sequence_M_send,_env); - if (_env.check_exception()) - return; - _strm->putSequence(ttcp_rec, CORBA::MarshalStream::ARG_IN); - _send_oneway(_env); - if (_env.check_exception()) { - if (CORBA::StExcep::TRANSIENT::_cast(_env.exception_value()) != NULL) - send(ttcp_rec, _env); - return; - } - _strm->flush(_env); - return; -} - - - - -void ttcp_sequence::send_hack(const CORBA::String& ttcp_string, CORBA::Environment& _env) -{ - _env.clear_exception(); - if (_is_local()) { - send_hack(ttcp_string); - return; - } - CORBA::MarshalStream *_strm = _create_oneway_request( - "ttcp_sequence", _ttcp_sequence_M_send_hack,_env); - if (_env.check_exception()) - return; - _strm->putString(ttcp_string, CORBA::MarshalStream::ARG_IN); - _send_oneway(_env); - if (_env.check_exception()) { - if (CORBA::StExcep::TRANSIENT::_cast(_env.exception_value()) != NULL) - send_hack(ttcp_string, _env); - return; - } - _strm->flush(_env); - return; -} - - - - -void ttcp_sequence::start_timer(CORBA::Environment& _env) -{ - _env.clear_exception(); - if (_is_local()) { - start_timer(); - return; - } - CORBA::MarshalStream *_strm = _create_oneway_request( - "ttcp_sequence", _ttcp_sequence_M_start_timer,_env); - if (_env.check_exception()) - return; - _send_oneway(_env); - if (_env.check_exception()) { - if (CORBA::StExcep::TRANSIENT::_cast(_env.exception_value()) != NULL) - start_timer(_env); - return; - } - _strm->flush(_env); - return; -} - - - - -void ttcp_sequence::stop_timer(CORBA::Environment& _env) -{ - _env.clear_exception(); - if (_is_local()) { - stop_timer(); - return; - } - CORBA::MarshalStream *_strm = _create_oneway_request( - "ttcp_sequence", _ttcp_sequence_M_stop_timer,_env); - if (_env.check_exception()) - return; - _send_oneway(_env); - if (_env.check_exception()) { - if (CORBA::StExcep::TRANSIENT::_cast(_env.exception_value()) != NULL) - stop_timer(_env); - return; - } - _strm->flush(_env); - return; -} - -const CORBA::TypeInfo ttcp_string::_class_info("ttcp_string", - &ttcp_string::_reader, - CORBA::Object::_desc(), - 0); -const CORBA::TypeInfo *ttcp_string::_desc() -{ - return &_class_info; -} -const CORBA::TypeInfo *ttcp_string::_type_info() const -{ - return &_class_info; -} -void *ttcp_string::_safe_narrow(const CORBA::TypeInfo *info) const -{ - if (&_class_info == info) - return (void *) this; - void *ret = NULL; - return ret; -} -ttcp_string *ttcp_string::_narrow(const CORBA::Object *obj) -{ - void *ptr = obj->_safe_narrow(&_class_info); - return (ttcp_string *) ptr; -} -ttcp_string *ttcp_string::_bind(CORBA::Environment &_env, const char *_object_name, - const char *_host_name, const CORBA::BindOptions *opt) -{ - _env.clear_exception(); - ttcp_string *_impl; - CORBA::Object *_obj = _implementation("ttcp_string", _object_name); - if (!_obj) { - _impl = new ttcp_string(_object_name); -#if defined(_MSC_BUG) - _impl->Object::_bind("ttcp_string", _env, _object_name, _host_name, opt); -#else - _impl->CORBA::Object::_bind("ttcp_string", _env, _object_name, _host_name, opt); -#endif - if (_env.check_exception()) { - delete _impl; - return NULL; - } - } - else - _impl = ttcp_string::_narrow(_obj); - return _impl; -} - - - -void ttcp_string::send(const CORBA::String& ttcp_string, CORBA::Environment& _env) -{ - _env.clear_exception(); - if (_is_local()) { - send(ttcp_string); - return; - } - CORBA::MarshalStream *_strm = _create_oneway_request( - "ttcp_string", _ttcp_string_M_send,_env); - if (_env.check_exception()) - return; - _strm->putString(ttcp_string, CORBA::MarshalStream::ARG_IN); - _send_oneway(_env); - if (_env.check_exception()) { - if (CORBA::StExcep::TRANSIENT::_cast(_env.exception_value()) != NULL) - send(ttcp_string, _env); - return; - } - _strm->flush(_env); - return; -} - - - - -void ttcp_string::send_hack(const CORBA::String& ttcp_string, CORBA::Environment& _env) -{ - _env.clear_exception(); - if (_is_local()) { - send_hack(ttcp_string); - return; - } - CORBA::MarshalStream *_strm = _create_oneway_request( - "ttcp_string", _ttcp_string_M_send_hack,_env); - if (_env.check_exception()) - return; - _strm->putString(ttcp_string, CORBA::MarshalStream::ARG_IN); - _send_oneway(_env); - if (_env.check_exception()) { - if (CORBA::StExcep::TRANSIENT::_cast(_env.exception_value()) != NULL) - send_hack(ttcp_string, _env); - return; - } - _strm->flush(_env); - return; -} - - - - -void ttcp_string::start_timer(CORBA::Environment& _env) -{ - _env.clear_exception(); - if (_is_local()) { - start_timer(); - return; - } - CORBA::MarshalStream *_strm = _create_oneway_request( - "ttcp_string", _ttcp_string_M_start_timer,_env); - if (_env.check_exception()) - return; - _send_oneway(_env); - if (_env.check_exception()) { - if (CORBA::StExcep::TRANSIENT::_cast(_env.exception_value()) != NULL) - start_timer(_env); - return; - } - _strm->flush(_env); - return; -} - - - - -void ttcp_string::stop_timer(CORBA::Environment& _env) -{ - _env.clear_exception(); - if (_is_local()) { - stop_timer(); - return; - } - CORBA::MarshalStream *_strm = _create_oneway_request( - "ttcp_string", _ttcp_string_M_stop_timer,_env); - if (_env.check_exception()) - return; - _send_oneway(_env); - if (_env.check_exception()) { - if (CORBA::StExcep::TRANSIENT::_cast(_env.exception_value()) != NULL) - stop_timer(_env); - return; - } - _strm->flush(_env); - return; -} - - diff --git a/performance-tests/TTCP/ORBeline/ttcp_c.hh b/performance-tests/TTCP/ORBeline/ttcp_c.hh deleted file mode 100644 index b8eaca3f9a8..00000000000 --- a/performance-tests/TTCP/ORBeline/ttcp_c.hh +++ /dev/null @@ -1,181 +0,0 @@ -#ifndef _ttcp_c_hh -#define _ttcp_c_hh - -/* This file is automatically generated by Orbeline. */ -/* Do not modify this file. */ -/* Orbeline (c) is copyrighted by PostModern Computing, Inc. */ - -#include <corba.h> -#include <arrmac.h> -#include <seqmac.h> - - - -class ttcp_sequence: public virtual CORBA::Object -{ - private: - static const CORBA::TypeInfo _class_info; - public: - static const CORBA::TypeInfo *_desc(); - virtual const CORBA::TypeInfo *_type_info() const; - virtual void *_safe_narrow(const CORBA::TypeInfo *) const; - static CORBA::Object *_reader(NCistream& strm) { - return new ttcp_sequence(strm); - } - protected: -#if defined(_MSC_BUG) - ttcp_sequence(const char *obj_name = NULL) :Object(obj_name) {} - ttcp_sequence(NCistream& strm) :Object(strm) {} -#else - ttcp_sequence(const char *obj_name = NULL) :CORBA::Object(obj_name) {} - ttcp_sequence(NCistream& strm) :CORBA::Object(strm) {} -#endif - virtual ~ttcp_sequence() {} - public: - enum _ttcp_sequence_Methods { - _ttcp_sequence_M_send = 0, - _ttcp_sequence_M_send_hack, - _ttcp_sequence_M_start_timer, - _ttcp_sequence_M_stop_timer - }; - static ttcp_sequence *_narrow(const CORBA::Object *obj); - static ttcp_sequence *_bind(CORBA::Environment &_env, const char *object_name = NULL, - const char *host_name = NULL, const CORBA::BindOptions* opt = NULL); - static ttcp_sequence *_bind(const char *object_name = NULL, - const char *host_name = NULL, const CORBA::BindOptions* opt = NULL) { - CORBA::Environment env; - return _bind(env, object_name, host_name, opt); - } - virtual const char *_interface_name() const { return "ttcp_sequence"; } - -#ifndef _DECLARE_SEQUENCE_CORBA__Char_ttcp_sequence__ -#define _DECLARE_SEQUENCE_CORBA__Char_ttcp_sequence__ -#define _DECLARE_SEQUENCE_CORBA__Char_ttcp_sequence___ttcp_idl -DECLARE_PRIMITIVE_SEQUENCE(CORBA__Char,CORBA::Char); -#endif - - typedef ttcp_sequence::IDLSequence(CORBA__Char) my_sequence; - - - - - void send(const ttcp_sequence::my_sequence& ttcp_rec, CORBA::Environment& _env); - - virtual void send(const ttcp_sequence::my_sequence& ttcp_rec) { - send(ttcp_rec, _environment()); - } - - - - - void send_hack(const CORBA::String& ttcp_string, CORBA::Environment& _env); - - virtual void send_hack(const CORBA::String& ttcp_string) { - send_hack(ttcp_string, _environment()); - } - - - - - void start_timer(CORBA::Environment& _env); - - virtual void start_timer() { - start_timer(_environment()); - } - - - - - void stop_timer(CORBA::Environment& _env); - - virtual void stop_timer() { - stop_timer(_environment()); - } - - -}; -typedef ttcp_sequence* ttcp_sequenceRef; - - - - -class ttcp_string: public virtual CORBA::Object -{ - private: - static const CORBA::TypeInfo _class_info; - public: - static const CORBA::TypeInfo *_desc(); - virtual const CORBA::TypeInfo *_type_info() const; - virtual void *_safe_narrow(const CORBA::TypeInfo *) const; - static CORBA::Object *_reader(NCistream& strm) { - return new ttcp_string(strm); - } - protected: -#if defined(_MSC_BUG) - ttcp_string(const char *obj_name = NULL) :Object(obj_name) {} - ttcp_string(NCistream& strm) :Object(strm) {} -#else - ttcp_string(const char *obj_name = NULL) :CORBA::Object(obj_name) {} - ttcp_string(NCistream& strm) :CORBA::Object(strm) {} -#endif - virtual ~ttcp_string() {} - public: - enum _ttcp_string_Methods { - _ttcp_string_M_send = 0, - _ttcp_string_M_send_hack, - _ttcp_string_M_start_timer, - _ttcp_string_M_stop_timer - }; - static ttcp_string *_narrow(const CORBA::Object *obj); - static ttcp_string *_bind(CORBA::Environment &_env, const char *object_name = NULL, - const char *host_name = NULL, const CORBA::BindOptions* opt = NULL); - static ttcp_string *_bind(const char *object_name = NULL, - const char *host_name = NULL, const CORBA::BindOptions* opt = NULL) { - CORBA::Environment env; - return _bind(env, object_name, host_name, opt); - } - virtual const char *_interface_name() const { return "ttcp_string"; } - - - - void send(const CORBA::String& ttcp_string, CORBA::Environment& _env); - - virtual void send(const CORBA::String& ttcp_string) { - send(ttcp_string, _environment()); - } - - - - - void send_hack(const CORBA::String& ttcp_string, CORBA::Environment& _env); - - virtual void send_hack(const CORBA::String& ttcp_string) { - send_hack(ttcp_string, _environment()); - } - - - - - void start_timer(CORBA::Environment& _env); - - virtual void start_timer() { - start_timer(_environment()); - } - - - - - void stop_timer(CORBA::Environment& _env); - - virtual void stop_timer() { - stop_timer(_environment()); - } - - -}; -typedef ttcp_string* ttcp_stringRef; - - - -#endif - diff --git a/performance-tests/TTCP/ORBeline/ttcp_i.cpp b/performance-tests/TTCP/ORBeline/ttcp_i.cpp deleted file mode 100644 index f6f510bd1f5..00000000000 --- a/performance-tests/TTCP/ORBeline/ttcp_i.cpp +++ /dev/null @@ -1,1026 +0,0 @@ -// $Id$ - -/* - * T T C P . C - */ - -/* #define BSD43 */ -/* #define BSD42 */ -/* #define BSD41a */ -#define SYSV /* required on SGI IRIX releases before 3.3 */ - -#include <stdio.h> -#include <signal.h> -#include <ctype.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <malloc.h> -#include <string.h> -#include <stdlib.h> -#include <memory.h> -#include <netinet/tcp.h> -#include <arpa/inet.h> -#include <netdb.h> -#include <sys/time.h> /* struct itimerval */ -#include <limits.h> -#include <sys/un.h> -#include <unistd.h> - -#if defined(SYSV) -#define bcopy(b1,b2,n) memcpy(b2,b1,n) -#define bzero(b1,n) memset(b1,0,n) -#include <sys/times.h> -#include <sys/param.h> -struct rusage - { - struct timeval ru_utime, ru_stime; - }; -#define RUSAGE_SELF 0 - -#else -#include <sys/resource.h> -#endif - -ACE_RCSID(ORBeline, ttcp_i, "$Id$") - -void err (char *s); -void mes (char *s); -void pattern (register char *cp, register int cnt); -char *outfmt (double b); -static void getrusage (int ignored, register struct rusage *ru); -static void gettimeofday (struct timeval *tp, struct timezone *zp); -void prep_timer (void); -double read_timer (char *str, int len); -static void prusage (register struct rusage *r0, struct rusage *r1, struct timeval *e, struct timeval *b, char *outp); -static void tvadd (struct timeval *tsum, struct timeval *t0, struct timeval *t1); -static void tvsub (struct timeval *tdiff, struct timeval *t1, struct timeval *t0); -static void psecs (long l, register char *cp); -void delay (int us); -int mread (int fd, register char *bufp, unsigned n); -int Nread (int fd, void *buf, int count); -int Nwrite (int fd, void *buf, int count); -static void SD_Ready (int io_descriptor); -void set_sock_desc(int starter); -void stop_timer (unsigned long numbytes); - -int fromlen; -int domain = PF_INET; /* Default is to use Internet domain sockets. */ -char *domainname; /* Rendezvous address for UNIX domain sockets. */ -int fd; /* fd of network socket */ - -int buflen = 8 * 1024; /* length of buffer */ -char *buf; /* ptr to dynamic buffer */ -int nbuf = 2 * 1024; /* number of buffers to send in sinkmode */ - -int bufoffset = 0; /* align buffer to this */ -int bufalign = 16 * 1024; /* modulo this */ - -int udp = 0; /* 0 = tcp, !0 = udp */ -int options = 0; /* socket options */ -int one = 1; /* for 4.3 BSD style setsockopt() */ -short port = 5001; /* TCP port number */ -char *host; /* ptr to name of host */ -int trans; /* 0=receive, !0=transmit mode */ -int sinkmode = 0; /* 0=normal I/O, !0=sink/source mode */ -int verbose = 0; /* 0=print basic info, 1=print cpu rate, proc - * resource usage. */ -int nodelay = 0; /* set TCP_NODELAY socket option */ -int b_flag = 0; /* use mread() */ -int sockbufsize = 0; /* socket buffer size to use */ -int new_line=0; /* This is a special flag */ -int write_to_file=1; /* indecates writing to file (default)*/ -int SEQUENCE=0; /* String parameter is the default */ -char fmt = 'K'; /* output format:k=kilobits,K=kilobytes, - * m = megabits, M = megabytes, - * g = gigabits, G = gigabytes */ -int touchdata = 0; /* access data after reading */ - -struct hostent *addr; -extern int errno; -extern int optind; -extern char *optarg; -char *title = 0; - -char stats[128]; -unsigned long nbytes; /* bytes on net */ -unsigned long numCalls; /* # of I/O system calls */ -double cput, realt; /* user, real time (seconds) */ - -// AAAAHHHHHHH what's this!!! C++ in the middle of C code???????!!!!!! - - -#include <iostream.h> -#include "ttcp_i.h" - -char *orb_host; - -// ttcp_i is the server side - - -// ----------------------------------------- start hack -// hack to get the sock desc ehab - -void -set_sock_desc(int starter) -{ - // 14 is just a guess... - for (int i = starter; i < 14; i++) - { - sockaddr_in addr; - int addrlen = sizeof addr; - if (getpeername (i, (sockaddr *) &addr, &addrlen) < 0) - continue; - - printf ("socket descriptor %d connected to %s on port %d\n", - i, inet_ntoa (addr.sin_addr), ntohs (addr.sin_port)); - SD_Ready (i); - } -} - -// hack to get the socket descriptor in the server side - -// I dublicated the functions. However, the ideal way is to creat a base -// class that will be inhereted from both ttcp_sequence and ttcp_string. -// BTW, I could not get '#ifdef' to work over here ! -void -ttcp_sequence_i::send_hack (const CORBA::String& ttcp_string) -{ - set_sock_desc(1); -} - -void -ttcp_string_i::send_hack (const CORBA::String& ttcp_string) -{ - set_sock_desc(1); -} - -static void -SD_Ready (int io_descriptor) -{ - if (sockbufsize) - { - if (setsockopt (io_descriptor, SOL_SOCKET, SO_RCVBUF, (char *) &sockbufsize, - sizeof sockbufsize) < 0) - perror ("setsockopt: rcvbuf"), exit (1); - - if (setsockopt (io_descriptor, SOL_SOCKET, SO_SNDBUF, (char *) &sockbufsize, - sizeof sockbufsize) < 0) - perror ("setsockopt: sndbuf"), exit (1); - } - - int sndbufsize = 0, rcvbufsize = 0; - int buflen = sizeof (int); - if (getsockopt (io_descriptor, SOL_SOCKET, SO_SNDBUF, (char *) &sndbufsize, &buflen) < 0) - err ("getsockopt: sndbuf"); - if (getsockopt (io_descriptor, SOL_SOCKET, SO_RCVBUF, (char *) &rcvbufsize, &buflen) < 0) - err ("getsockopt: rcvbuf"); - char buf[BUFSIZ]; - sprintf (buf, "descriptor %d, sndbuf = %d, rcvbuf = %d\n", - io_descriptor, sndbufsize, rcvbufsize); - mes (buf); - - if (nodelay) - { - struct protoent *p; - p = getprotobyname ("tcp"); - if (setsockopt (io_descriptor, - p->p_proto, - TCP_NODELAY, - (char *)& one, - sizeof (one))) - mes ("setsockopt: nodelay"); - mes ("nodelay"); - } -} - -// ----------------------------------------- end hack - - -// ttcp_i is the server side - -ttcp_sequence_i::ttcp_sequence_i() -{ - this->nbytes_ = 0; - // register a callback so we can futs with the descriptor - // being used by orbix. -} - -void -ttcp_sequence_i::start_timer () -{ - this->nbytes_ = 0; - prep_timer (); -} - -void -ttcp_sequence_i::stop_timer () -{ - stop_timer (this->nbytes_); -} - -void -ttcp_sequence_i::send(const ttcp_sequence::my_sequence& ttcp_seq) -{ - this->nbytes_ += ttcp_seq.length(); -} - -ttcp_string_i::ttcp_string_i() -{ - this->nbytes_ = 0; - // register a callback so we can futs with the descriptor - // being used by orbix. -} - -void -ttcp_string_i::start_timer () -{ - prep_timer (); -} - - -void -ttcp_string_i::stop_timer () -{ - stop_timer (this->nbytes_); -} - -void -ttcp_string_i::send(const CORBA::String& ttcp_string) -{ - this->nbytes_ += strlen (ttcp_string); -} - -// common to sequence and string -void -stop_timer (unsigned long numbytes) -{ - (void) read_timer (stats, sizeof (stats)); - - if (cput <= 0.0) - cput = 0.001; - if (realt <= 0.0) - realt = 0.001; - fprintf (stdout, - "ttcp%s%s: %ld bytes in %.2f real seconds = %s/sec +++\n", - trans ? "-t" : "-r", SEQUENCE ? "(Seq)" : "(Str)", - numbytes, realt, outfmt (((double) numbytes) / realt)); - - - if (verbose) - { - fprintf (stdout, - "ttcp%s%s: %ld bytes in %.2f CPU seconds = %s/cpu sec\n", - trans ? "-t" : "-r",SEQUENCE ? "(Seq)" : "(Str)", - numbytes, cput, outfmt (((double) numbytes) / cput)); - } - fprintf (stdout, - "ttcp%s%s: %d I/O calls, msec/call = %.2f, calls/sec = %.2f\n", - trans ? "-t" : "-r",SEQUENCE ? "(Seq)" : "(Str)", - numCalls, - 1024.0 * realt / ((double) numCalls), - ((double) numCalls) / realt); - fprintf (stdout, "ttcp%s%s: %s\n", trans ? "-t" : "-r",SEQUENCE ? "(Seq)" : "(Str)", stats); - if (verbose) - { - fprintf (stdout, - "ttcp%s: buffer address %#x\n", - trans ? "-t" : "-r", - buf); - } -numbytes = 0; - - // you shoudl exit here when you use -p (profiler) so the server will - // produce mon.out -#ifdef PROFILE - exit(1); -#endif -} // end of stop_timer - - -char Usage[] = "\ -Usage: ttcp -t [-options] host [ < in ]\n\ - ttcp -r [-options > out]\n\ -Common options:\n\ - -l ## length of bufs read from or written to network (default 8192)\n\ - -u use UDP instead of TCP\n\ - -U use UNIX domain sockets instead of Internet domain sockets\n\ - -p ## port number to send to or listen at (default 5001)\n\ - -s -t: source a pattern to network\n\ - -r: sink (discard) all data from network\n\ - -A align the start of buffers to this modulus (default 16384)\n\ - -O start buffers at this offset from the modulus (default 0)\n\ - -v verbose: print more statistics\n\ - -d set SO_DEBUG socket option\n\ - -b ## set socket buffer size (if supported)\n\ - -f X format for rate: k,K = kilo{bit,byte}; m,M = mega; g,G = giga\n\ -Options specific to -t:\n\ - -n## number of source bufs written to network (default 2048)\n\ - -D don't buffer TCP writes (sets TCP_NODELAY socket option)\n\ -Options specific to -r:\n\ - -B for -s, only output full blocks as specified by -l (for TAR)\n\ - -T \"touch\": access each byte as it's read\n\ - -L<test_title> the title of the current test\n\ - -F don't write to a file (writting in a file dat.out is default)\n\ - -q run the test using sequence parameter (string is defualt) \n\ -"; - -#if !defined (__cplusplus) -typedef void (*SIG_TYP)(); -#endif - -#ifdef SVR4 -void -sigpipe (int foo) -#else -void -sigpipe () -#endif -{ -} - -int -main (int argc, char *argv[]) -{ - - unsigned long addr_tmp; - int c; - - if (argc < 2) - goto usage; - - while ((c = ACE_OS::getopt (argc, argv, "qFdrstU:uvBDTb:L:f:l:n:p:A:O:h:x")) != -1) - { - switch (c) - { - case 'L': - title = optarg; - fprintf(stdout,"---->title=%s\n",title); - break; - case 'x': - new_line = 1; - break; - case 'q': - SEQUENCE = 1; - break; - case 'F': - write_to_file = 0; - break; - case 'h': - orb_host = optarg; - break; - case 'B': - b_flag = 1; - break; - case 't': - trans = 1; - break; - case 'r': - trans = 0; - break; - case 'd': - options |= SO_DEBUG; - break; - case 'D': -#ifdef TCP_NODELAY - nodelay = 1; -#else - fprintf (stderr, - "ttcp: -D option ignored: TCP_NODELAY socket option not supported\n"); -#endif - break; - case 'n': - nbuf = atoi (optarg); - break; - case 'l': - buflen = atoi (optarg); - break; - case 's': - sinkmode = !sinkmode; - break; - case 'p': - port = atoi (optarg); - break; - case 'U': - domain = PF_UNIX; - domainname = optarg; - break; - case 'u': - udp = 1; - break; - case 'v': - verbose = 1; - break; - case 'A': - bufalign = atoi (optarg); - break; - case 'O': - bufoffset = atoi (optarg); - break; - case 'b': -#if defined(SO_SNDBUF) || defined(SO_RCVBUF) - sockbufsize = atoi (optarg); -#else - fprintf (stderr, "ttcp: -b option ignored: SO_SNDBUF/SO_RCVBUF socket options not supported\n"); -#endif - break; - case 'f': - fmt = *optarg; - break; - case 'T': - touchdata = 1; - break; - - default: - goto usage; - } - } - - // - // Receiver - // - - if (!trans) - { - - // Sequence and String Interfaces - // instantiate ONLY one object at a time, so no dispatching overhead is counted - char *interface_name = new char[15]; - if (SEQUENCE) - { - printf("I am here\n"); - ttcp_sequence *my_ttcp = new ttcp_sequence_i; - strcpy(interface_name,"ttcp_sequence"); - } - else - { - ttcp_string *my_ttcp_s = new ttcp_string_i; - strcpy(interface_name,"ttcp_string"); - } - - // tell ORBeline that we have completed the server's initialization: - CORBA::BOA::impl_is_ready(); - - cout << "server exiting" << endl; - return 0; - } - - // - // Transmitter - // - - CORBA::Environment env; - ttcp_sequence *ttcp_seq; - ttcp_string *ttcp_str; - - if (SEQUENCE) - { - if ( (ttcp_seq = ttcp_sequence::_bind(0,::orb_host,0)) == 0) - { - cerr << "\n ttcp_i: Failed to _bind to " << orb_host << endl; - exit(-1); - } - } - else // string parameter used - if ( (ttcp_str = ttcp_string::_bind (0,::orb_host,0))== 0) - { - cerr << "\n ttcp_i: Failed to _bind to " << orb_host << endl; - exit(-1); - } - - // hack to get the socket descriptor in the server side after sending this msg - if (SEQUENCE) - ttcp_seq->send_hack("hack"); - else - ttcp_str->send_hack("hack"); - - // hack to get the socket descriptor in the client side: - - set_sock_desc(1); // replace "ttcp_->_fd" in the following with sockdesc - - // - // Prepare the Message to be sent - // - - errno = 0; - if (sinkmode) - { - if ((buf = (char *) malloc (buflen + bufalign)) == (char *) NULL) - err ("malloc"); - if (bufalign != 0) - buf += (bufalign - ((int) buf % bufalign) + bufoffset) % bufalign; - - // ttcp_sequence::my_sequence sequence_message; ORBIX - ttcp_sequence::my_sequence message (buflen + 1); - ::buf[::buflen-1] = '\0'; - if (SEQUENCE) - { - message._num_allocated = buflen; - message._count = buflen; - message._contents = buf; - } - - - pattern (buf, buflen); - // - // Start the timers on the client and server sides - // - - prep_timer (); - - if (SEQUENCE) - ttcp_seq->start_timer (); - else - ttcp_str->start_timer (); - while (nbuf--) - { - if (SEQUENCE) - ttcp_seq->send (message); - else - ttcp_str->send (buf); - - numCalls++; - nbytes += buflen; - } - - } - else - { - register int cnt; - while ((cnt = read (0, buf, buflen)) > 0 && - Nwrite (fd, buf, cnt) == cnt) - nbytes += cnt; - } - - if (errno) - err ("IO"); - - - // - // Stop the timers on both sides - // - - - if (SEQUENCE) - ttcp_seq->stop_timer(); - else - ttcp_str->stop_timer(); - - - (void) read_timer (stats, sizeof (stats)); - - - // - // Print the results. - // - - if (cput <= 0.0) - cput = 0.001; - if (realt <= 0.0) - realt = 0.001; - - if (write_to_file) - { - if (title != 0) - { - double tmp; - FILE *fd; - char filename[BUFSIZ]; - ACE_OS::sprintf (filename, "%s.results", title); - fd = fopen(filename,"a+"); - if (new_line) - fprintf(fd,"\n -l %ldk \t", buflen/1024); - tmp = ((double) nbytes) / realt; - fprintf(fd,"%.2f ", tmp * 8.0 / 1024.0 / 1024.0); - fclose(fd); - } - } - - fprintf (stdout, - "\nttcp%s%s: %ld bytes in %.2f real seconds = %s/sec +++\n", - trans ? "-t" : "-r", SEQUENCE ? "(Seq)" : "(Str)", - nbytes, realt, outfmt (((double) nbytes) / realt)); - - if (verbose) - { - fprintf (stdout, - "ttcp%s%s: %ld bytes in %.2f CPU seconds = %s/cpu sec\n", - trans ? "-t" : "-r", SEQUENCE ? "(Seq)" : "(Str)", - nbytes, cput, outfmt (((double) nbytes) / cput)); - } - fprintf (stdout, - "ttcp%s%s: %d I/O calls, msec/call = %.2f, calls/sec = %.2f\n", - trans ? "-t" : "-r", SEQUENCE ? "(Seq)" : "(Str)", - numCalls, - 1024.0 * realt / ((double) numCalls), - ((double) numCalls) / realt); - fprintf (stdout, "ttcp%s%s: %s\n",trans ? "-t" : "-r", SEQUENCE ? "(Seq)" : "(Str)", stats); - if (verbose) - { - fprintf (stdout, - "ttcp%s: buffer address %#x\n", - trans ? "-t" : "-r", - buf); - } - exit (0); - - usage: - fprintf (stderr, Usage); - return 1; -} - -void -err (char *s) -{ - fprintf (stderr, "ttcp%s: ", trans ? "-t" : "-r"); - perror (s); - fprintf (stderr, "errno=%d\n", errno); - exit (1); -} - -void -mes (char *s) -{ - fprintf (stderr, "ttcp%s%s: %s\n", trans ? "-t" : "-r",SEQUENCE ? "(Seq)" : "(Str)", s); -// fprintf (stderr, "ttcp%s: %s\n", trans ? "-t" : "-r", s); -} - -void -pattern (register char *cp, register int cnt) -{ - register char c; - c = 0; - while (cnt-- > 0) - { - while (!isprint ((c & 0x7F))) - c++; - *cp++ = (c++ & 0x7F); - } -} - -char * -outfmt (double b) -{ - static char obuf[50]; - switch (fmt) - { - case 'G': - sprintf (obuf, "%.2f GB", b / 1024.0 / 1024.0 / 1024.0); - break; - default: - case 'K': - sprintf (obuf, "%.2f KB", b / 1024.0); - break; - case 'M': - sprintf (obuf, "%.2f MB", b / 1024.0 / 1024.0); - break; - case 'g': - sprintf (obuf, "%.2f Gbit", b * 8.0 / 1024.0 / 1024.0 / 1024.0); - break; - case 'k': - sprintf (obuf, "%.2f Kbit", b * 8.0 / 1024.0); - break; - case 'm': - sprintf (obuf, "%.2f Mbit", b * 8.0 / 1024.0 / 1024.0); - break; - } - return obuf; -} - -static struct itimerval itime0; /* Time at which timing started */ -static struct rusage ru0; /* Resource utilization at the start */ - -#if defined(SYSV) -/*ARGSUSED */ -static void -getrusage (int ignored, register struct rusage *ru) -{ - struct tms buf; - - times (&buf); - - /* Assumption: HZ <= 2147 (LONG_MAX/1000000) */ - ru->ru_stime.tv_sec = buf.tms_stime / HZ; - ru->ru_stime.tv_usec = ((buf.tms_stime % HZ) * 1000000) / HZ; - ru->ru_utime.tv_sec = buf.tms_utime / HZ; - ru->ru_utime.tv_usec = ((buf.tms_utime % HZ) * 1000000) / HZ; -} - -/*ARGSUSED */ -static void -gettimeofday (struct timeval *tp, struct timezone *zp) -{ - tp->tv_sec = time (0); - tp->tv_usec = 0; -} -#endif /* SYSV */ -/* - * P R E P _ T I M E R - */ -void -prep_timer () -{ - itime0.it_interval.tv_sec = 0; - itime0.it_interval.tv_usec = 0; - itime0.it_value.tv_sec = LONG_MAX / 22; /* greatest possible value , itimer() count backwards */ - itime0.it_value.tv_usec = 0; - - - getrusage (RUSAGE_SELF, &ru0); - - /* Init REAL Timer */ - if (setitimer (ITIMER_REAL, &itime0, NULL)) - { - perror ("Setting 'itimer' REAL failed"); - return; - } - -} - -/* - * R E A D _ T I M E R - * - */ -double -read_timer (char *str, int len) -{ - struct itimerval itimedol; - struct rusage ru1; - struct timeval td; - struct timeval tend, tstart; - char line[132]; - - getrusage (RUSAGE_SELF, &ru1); - - if (getitimer (ITIMER_REAL, &itimedol)) - { - perror ("Getting 'itimer' REAL failed"); - return (0.0); - } - - prusage (&ru0, &ru1, &itime0.it_value, &itimedol.it_value, line); - (void) strncpy (str, line, len); - - /* Get real time */ - tvsub (&td, &itime0.it_value, &itimedol.it_value); - realt = td.tv_sec + ((double) td.tv_usec) / 1000000; - - /* Get CPU time (user+sys) */ - tvadd (&tend, &ru1.ru_utime, &ru1.ru_stime); - tvadd (&tstart, &ru0.ru_utime, &ru0.ru_stime); - tvsub (&td, &tend, &tstart); - cput = td.tv_sec + ((double) td.tv_usec) / 1000000; - if (cput < 0.00001) - cput = 0.00001; - return (cput); -} - -static void -prusage (register struct rusage *r0, struct rusage *r1, - struct timeval *e, struct timeval *b, char *outp) -{ - struct timeval tdiff; - register time_t t; - register char *cp; - register int i; - int ms; - - t = (r1->ru_utime.tv_sec - r0->ru_utime.tv_sec) * 100 + - (r1->ru_utime.tv_usec - r0->ru_utime.tv_usec) / 10000 + - (r1->ru_stime.tv_sec - r0->ru_stime.tv_sec) * 100 + - (r1->ru_stime.tv_usec - r0->ru_stime.tv_usec) / 10000; - ms = (e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000; - -#define END(x) {while(*x) x++;} -#if defined(SYSV) - cp = "%Uuser %Ssys %Ereal %P"; -#else -#if defined(sgi) /* IRIX 3.3 will show 0 for %M,%F,%R,%C */ - cp = "%Uuser %Ssys %Ereal %P %Mmaxrss %F+%Rpf %Ccsw"; -#else - cp = "%Uuser %Ssys %Ereal %P %Xi+%Dd %Mmaxrss %F+%Rpf %Ccsw"; -#endif -#endif - for (; *cp; cp++) - { - if (*cp != '%') - *outp++ = *cp; - else if (cp[1]) - switch (*++cp) - { - - case 'U': - tvsub (&tdiff, &r1->ru_utime, &r0->ru_utime); - sprintf (outp, "%d.%01d", tdiff.tv_sec, tdiff.tv_usec / 100000); - END (outp); - break; - - case 'S': - tvsub (&tdiff, &r1->ru_stime, &r0->ru_stime); - sprintf (outp, "%d.%01d", tdiff.tv_sec, tdiff.tv_usec / 100000); - END (outp); - break; - - case 'E': - psecs (ms / 100, outp); - END (outp); - break; - - case 'P': - sprintf (outp, "%d%%", (int) (t * 100 / ((ms ? ms : 1)))); - END (outp); - break; - -#if !defined(SYSV) - case 'W': - i = r1->ru_nswap - r0->ru_nswap; - sprintf (outp, "%d", i); - END (outp); - break; - - case 'X': - sprintf (outp, "%d", t == 0 ? 0 : (r1->ru_ixrss - r0->ru_ixrss) / t); - END (outp); - break; - - case 'D': - sprintf (outp, "%d", t == 0 ? 0 : - (r1->ru_idrss + r1->ru_isrss - (r0->ru_idrss + r0->ru_isrss)) / t); - END (outp); - break; - - case 'K': - sprintf (outp, "%d", t == 0 ? 0 : - ((r1->ru_ixrss + r1->ru_isrss + r1->ru_idrss) - - (r0->ru_ixrss + r0->ru_idrss + r0->ru_isrss)) / t); - END (outp); - break; - - case 'M': - sprintf (outp, "%d", r1->ru_maxrss / 2); - END (outp); - break; - - case 'F': - sprintf (outp, "%d", r1->ru_majflt - r0->ru_majflt); - END (outp); - break; - - case 'R': - sprintf (outp, "%d", r1->ru_minflt - r0->ru_minflt); - END (outp); - break; - - case 'I': - sprintf (outp, "%d", r1->ru_inblock - r0->ru_inblock); - END (outp); - break; - - case 'O': - sprintf (outp, "%d", r1->ru_oublock - r0->ru_oublock); - END (outp); - break; - case 'C': - sprintf (outp, "%d+%d", r1->ru_nvcsw - r0->ru_nvcsw, - r1->ru_nivcsw - r0->ru_nivcsw); - END (outp); - break; -#endif /* !SYSV */ - } - } - *outp = '\0'; -} - -static void -tvadd (struct timeval *tsum, struct timeval *t0, struct timeval *t1) -{ - - tsum->tv_sec = t0->tv_sec + t1->tv_sec; - tsum->tv_usec = t0->tv_usec + t1->tv_usec; - if (tsum->tv_usec > 1000000) - tsum->tv_sec++, tsum->tv_usec -= 1000000; -} - -static void -tvsub (struct timeval *tdiff, struct timeval *t1, struct timeval *t0) -{ - - tdiff->tv_sec = t1->tv_sec - t0->tv_sec; - tdiff->tv_usec = t1->tv_usec - t0->tv_usec; - if (tdiff->tv_usec < 0) - tdiff->tv_sec--, tdiff->tv_usec += 1000000; -} - -static void -psecs (long l, register char *cp) -{ - register int i; - - i = l / 3600; - if (i) - { - sprintf (cp, "%d:", i); - END (cp); - i = l % 3600; - sprintf (cp, "%d%d", (i / 60) / 10, (i / 60) % 10); - END (cp); - } - else - { - i = l; - sprintf (cp, "%d", i / 60); - END (cp); - } - i %= 60; - *cp++ = ':'; - sprintf (cp, "%d%d", i / 10, i % 10); -} - -/* - * N R E A D - */ -int -Nread (int fd, void *buf, int count) -{ - struct sockaddr_in from; - int len = sizeof (from); - register int cnt; - if (udp) - { - cnt = recvfrom (fd, (char *) buf, count, 0, (struct sockaddr *) &from, &len); - numCalls++; - } - else - { - if (b_flag) - cnt = mread (fd, (char *) buf, count); /* fill buf */ - else - { - cnt = read (fd, buf, count); - numCalls++; - } - if (touchdata && cnt > 0) - { - register int c = cnt, sum; - register char *b = (char *) buf; - while (c--) - sum += *b++; - } - } - return (cnt); -} - - -/* - * N W R I T E - */ -int -Nwrite (int fd, void *buf, int count) -{ - return 0; -} - -void -delay (int us) -{ - struct timeval tv; - - tv.tv_sec = 0; - tv.tv_usec = us; - (void) select (1, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &tv); -} - -/* - * M R E A D - * - * This function performs the function of a read(II) but will - * call read(II) multiple times in order to get the requested - * number of characters. This can be necessary because - * network connections don't deliver data with the same - * grouping as it is written with. Written by Robert S. Miles, BRL. - */ -int -mread (int fd, register char *bufp, unsigned n) -{ - register unsigned count = 0; - register int nread; - - do - { - nread = read (fd, bufp, n - count); - numCalls++; - if (nread < 0) - { - perror ("ttcp_mread"); - return (-1); - } - if (nread == 0) - return ((int) count); - count += (unsigned) nread; - bufp += nread; - } - while (count < n); - - return ((int) count); -} diff --git a/performance-tests/TTCP/ORBeline/ttcp_i.h b/performance-tests/TTCP/ORBeline/ttcp_i.h deleted file mode 100644 index 0a4ed7b4b5c..00000000000 --- a/performance-tests/TTCP/ORBeline/ttcp_i.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - - -// ttcp_i.C -// implementation of the ttcp and Profile_Logger objects. - -#ifndef TTCP_I_H -#define TTCP_I_H - -// This is a total hack... -#define private public -#include "ttcp_s.hh" -#include "ttcp_c.hh" - -class ttcp_string_i : public ttcp_string_impl { -public: - - ttcp_string_i(); - - virtual void send(const CORBA::String& ttcp_string); - virtual void send_hack(const CORBA::String& ttcp_string); - virtual void start_timer(); - virtual void stop_timer(); - -private: - unsigned long nbytes_; -}; - -class ttcp_sequence_i : public ttcp_sequence_impl { -public: - - ttcp_sequence_i(); - - virtual void send(const ttcp_sequence::my_sequence& ttcp_seq); - virtual void send_hack(const CORBA::String& ttcp_string); - virtual void start_timer(); - virtual void stop_timer(); - -private: - unsigned long nbytes_; -}; - - -#endif diff --git a/performance-tests/TTCP/ORBeline/ttcp_s.cc b/performance-tests/TTCP/ORBeline/ttcp_s.cc deleted file mode 100644 index 514ff8a5d26..00000000000 --- a/performance-tests/TTCP/ORBeline/ttcp_s.cc +++ /dev/null @@ -1,168 +0,0 @@ -/* This file is automatically generated by Orbeline. */ -/* Do not modify this file. */ -/* Orbeline (c) is copyrighted by PostModern Computing, Inc. */ - -#include <ttcp_s.hh> - - - -static CORBA::_PMCSkelFunc _ttcp_sequence_func_array[] = { - &ttcp_sequence_impl::_send, - &ttcp_sequence_impl::_send_hack, - &ttcp_sequence_impl::_start_timer, - &ttcp_sequence_impl::_stop_timer, - 0 - }; -ttcp_sequence_impl::ttcp_sequence_impl(const char *object_name) : - ttcp_sequence(object_name) -{ - _object_name(object_name); - CORBA::Environment _env; - _register_implementation("ttcp_sequence", 4, _ttcp_sequence_func_array, (void *) this, _env); -} -ttcp_sequence_impl::~ttcp_sequence_impl() -{ - CORBA::Environment _env; - _unregister_implementation("ttcp_sequence", (void *) this, _env); -} - - -void ttcp_sequence_impl::_send(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal) { - ttcp_sequence_impl *_impl = (ttcp_sequence_impl *) obj; - _env.clear_exception(); - ttcp_sequence::my_sequence ttcp_rec; - strm.getSequence(ttcp_rec, CORBA::MarshalStream::ARG_IN); - strm.flush(_env); - if (_env.check_exception()) - return; - _impl->_principal(principal); - _impl->send(ttcp_rec); - strm.putEnvironment(_env); - _impl->_principal((CORBA::Principal *) NULL); -} - - -void ttcp_sequence_impl::_send_hack(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal) { - ttcp_sequence_impl *_impl = (ttcp_sequence_impl *) obj; - _env.clear_exception(); - CORBA::String ttcp_string; - strm.getString(ttcp_string, CORBA::MarshalStream::ARG_IN); - strm.flush(_env); - if (_env.check_exception()) - return; - _impl->_principal(principal); - _impl->send_hack(ttcp_string); - strm.putEnvironment(_env); - _impl->_principal((CORBA::Principal *) NULL); -} - - -void ttcp_sequence_impl::_start_timer(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal) { - ttcp_sequence_impl *_impl = (ttcp_sequence_impl *) obj; - _env.clear_exception(); - strm.flush(_env); - if (_env.check_exception()) - return; - _impl->_principal(principal); - _impl->start_timer(); - strm.putEnvironment(_env); - _impl->_principal((CORBA::Principal *) NULL); -} - - -void ttcp_sequence_impl::_stop_timer(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal) { - ttcp_sequence_impl *_impl = (ttcp_sequence_impl *) obj; - _env.clear_exception(); - strm.flush(_env); - if (_env.check_exception()) - return; - _impl->_principal(principal); - _impl->stop_timer(); - strm.putEnvironment(_env); - _impl->_principal((CORBA::Principal *) NULL); -} - -static CORBA::_PMCSkelFunc _ttcp_string_func_array[] = { - &ttcp_string_impl::_send, - &ttcp_string_impl::_send_hack, - &ttcp_string_impl::_start_timer, - &ttcp_string_impl::_stop_timer, - 0 - }; -ttcp_string_impl::ttcp_string_impl(const char *object_name) : - ttcp_string(object_name) -{ - _object_name(object_name); - CORBA::Environment _env; - _register_implementation("ttcp_string", 4, _ttcp_string_func_array, (void *) this, _env); -} -ttcp_string_impl::~ttcp_string_impl() -{ - CORBA::Environment _env; - _unregister_implementation("ttcp_string", (void *) this, _env); -} - -void ttcp_string_impl::_send(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal) { - ttcp_string_impl *_impl = (ttcp_string_impl *) obj; - _env.clear_exception(); - CORBA::String ttcp_string; - strm.getString(ttcp_string, CORBA::MarshalStream::ARG_IN); - strm.flush(_env); - if (_env.check_exception()) - return; - _impl->_principal(principal); - _impl->send(ttcp_string); - strm.putEnvironment(_env); - _impl->_principal((CORBA::Principal *) NULL); -} - - -void ttcp_string_impl::_send_hack(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal) { - ttcp_string_impl *_impl = (ttcp_string_impl *) obj; - _env.clear_exception(); - CORBA::String ttcp_string; - strm.getString(ttcp_string, CORBA::MarshalStream::ARG_IN); - strm.flush(_env); - if (_env.check_exception()) - return; - _impl->_principal(principal); - _impl->send_hack(ttcp_string); - strm.putEnvironment(_env); - _impl->_principal((CORBA::Principal *) NULL); -} - - -void ttcp_string_impl::_start_timer(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal) { - ttcp_string_impl *_impl = (ttcp_string_impl *) obj; - _env.clear_exception(); - strm.flush(_env); - if (_env.check_exception()) - return; - _impl->_principal(principal); - _impl->start_timer(); - strm.putEnvironment(_env); - _impl->_principal((CORBA::Principal *) NULL); -} - - -void ttcp_string_impl::_stop_timer(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal) { - ttcp_string_impl *_impl = (ttcp_string_impl *) obj; - _env.clear_exception(); - strm.flush(_env); - if (_env.check_exception()) - return; - _impl->_principal(principal); - _impl->stop_timer(); - strm.putEnvironment(_env); - _impl->_principal((CORBA::Principal *) NULL); -} - - diff --git a/performance-tests/TTCP/ORBeline/ttcp_s.hh b/performance-tests/TTCP/ORBeline/ttcp_s.hh deleted file mode 100644 index 645981eec22..00000000000 --- a/performance-tests/TTCP/ORBeline/ttcp_s.hh +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef _ttcp_s_hh -#define _ttcp_s_hh - -#include <ttcp_c.hh> -#include <corba.h> - -/* This file is automatically generated by Orbeline. */ -/* Do not modify this file. */ -/* Orbeline (c) is copyrighted by PostModern Computing, Inc. */ - -class ttcp_sequence_impl: public virtual ttcp_sequence -{ - protected: - ttcp_sequence_impl(const char *object_name = NULL); - virtual ~ttcp_sequence_impl(); - public: - virtual const CORBA::TypeInfo *_type_info() const { - return ttcp_sequence::_type_info(); - } - virtual void *_safe_narrow(const CORBA::TypeInfo *inf) const { - return ttcp_sequence::_safe_narrow(inf); - } - virtual const char *_interface_name() const { - return ttcp_sequence::_interface_name(); - } - virtual CORBA::Boolean _is_local() const { return 1; } - - /* The following operations need to be implemented by the server. */ - virtual void send(const ttcp_sequence::my_sequence& ttcp_rec) = 0; - virtual void send_hack(const CORBA::String& ttcp_string) = 0; - virtual void start_timer() = 0; - virtual void stop_timer() = 0; - - /* The following operations are implemented automatically. */ - - static void _send(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal); - - static void _send_hack(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal); - - static void _start_timer(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal); - - static void _stop_timer(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal); - -}; -class ttcp_string_impl: public virtual ttcp_string -{ - protected: - ttcp_string_impl(const char *object_name = NULL); - virtual ~ttcp_string_impl(); - public: - virtual const CORBA::TypeInfo *_type_info() const { - return ttcp_string::_type_info(); - } - virtual void *_safe_narrow(const CORBA::TypeInfo *inf) const { - return ttcp_string::_safe_narrow(inf); - } - virtual const char *_interface_name() const { - return ttcp_string::_interface_name(); - } - virtual CORBA::Boolean _is_local() const { return 1; } - - /* The following operations need to be implemented by the server. */ - virtual void send(const CORBA::String& ttcp_string) = 0; - virtual void send_hack(const CORBA::String& ttcp_string) = 0; - virtual void start_timer() = 0; - virtual void stop_timer() = 0; - - /* The following operations are implemented automatically. */ - - static void _send(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal); - - static void _send_hack(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal); - - static void _start_timer(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal); - - static void _stop_timer(void *obj, CORBA::MarshalStream &strm, - CORBA::Environment& _env, CORBA::Principal *principal); - -}; - -#endif - |