/****************************************************************************** Copyright 1998 Compaq Computer Corporation. Confidential computer software. Valid license from Compaq required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. Compaq, the Compaq logo, and the Digital logo are registered in the U.S. Patent and Trademark Office. ******************************************************************************* File: TPSSRV.C Purpose: test program to benchmark RTR Performance over various platforms DESCRIPTION: TPSSRV and TPSREQ are intended to provide the ability to make meaningful measurements of RTR performance which are directly comparable over the various supported platforms. Some of the other test applications may be inadequate for this purpose for a couple of reasons: 1) When invoked with a single-channel, they essentially measure only the speed of the disk, and don't load the acp heavily enough to make changes in acp cpu performance measurable. 2) When invoked with multiple channels, may make use of operating-system specific methods to achieve concurrency. The variations in the efficiency of these over multiple platforms could mask measurements of RTR itself. This program, together with TPRREQ is intended to be simple, be capable of generating enough load to allow meaningful measurements, to make no use of OS-specific features, and to do as little as possible when running other than to make RTR calls. The idea is that these programs should *not* be extended in any way which alters their run-time performance, thus giving us a stable reference which can be used to evaluate new versions of RTR against their predecessors. Modification History: sailesh 14-apr-2004 PTR 14-9-241 : Added 'norecovery' option for creation of non-recoverable partition for journal-less operation ******************************************************************************/ #include "tpsapp.h" static int test_main(void) { char* facility; rtr_uns_32_t nr_channels; rtr_ope_flag_t open_flags = RTR_F_OPE_SERVER; rtr_uns_32_t idx; rtr_channel_t channel; rtr_status_t sts; rtr_keyseg_t keyseg[1] = {0}; rtr_uns_8_t low_bound = 0; rtr_uns_8_t high_bound = 255; keyseg[0].ks_type = rtr_keyseg_unsigned; keyseg[0].ks_length = 1; keyseg[0].ks_offset = 0; keyseg[0].ks_lo_bound = &low_bound; keyseg[0].ks_hi_bound = &high_bound; facility = get_command_line_string( "-facility", "rtr$default_facility" ); nr_channels = get_command_line_unsigned( "-channels", "40" ); if (get_command_line_arg_idx( "-shadow" )) open_flags |= RTR_F_OPE_SHADOW; if (get_command_line_arg_idx( "-nostandby" )) open_flags |= RTR_F_OPE_NOSTANDBY; /* PTR 14-9-241 Added norecovery option */ if (get_command_line_arg_idx( "-norecovery" )) open_flags |= RTR_F_OPE_NO_RECOVERY; for (idx = 0; idx < nr_channels; idx++) { sts = rtr_open_channel ( /* pchannel */ &channel, /* flags */ open_flags, /* facnam */ facility, /* chanam */ RTR_NO_CHANAM, /* pevtnum */ RTR_NO_PEVTNUM, /* access */ RTR_NO_ACCESS, /* numseg */ 1, /* pkeyseg */ keyseg ); exit_if_error ( "rtr_open_channel", sts ); } do { union { rtr_status_data_t status_data; char message[RTR_MAX_MSGLEN]; } msgbuf; rtr_msgsb_t msgsb; sts = rtr_receive_message ( /* pchannel */ &channel, /* flags */ RTR_NO_FLAGS, /* prcvchan */ RTR_ANYCHAN, /* pmsg */ &msgbuf, /* maxlen */ RTR_MAX_MSGLEN, /* timoutms */ RTR_NO_TIMOUTMS, /* pmsgsb */ &msgsb ); exit_if_error ( "rtr_receive_message", sts ); switch( msgsb.msgtype ) { case rtr_mt_opened: case rtr_mt_msg1: case rtr_mt_msg1_uncertain: case rtr_mt_accepted: case rtr_mt_rejected: break; default: exit_if_error ( "unexpected message", msgbuf.status_data.status ); printf( "unexpected message with success status!" ); exit(1); } } while (1); return 0; }