+++ /dev/null
-/*
- Copyright (c) 1999-2012 OPEN CASCADE SAS
-
- The content of this file is subject to the Open CASCADE Technology Public
- License Version 6.5 (the "License"). You may not use the content of this file
- except in compliance with the License. Please obtain a copy of the License
- at http://www.opencascade.org and read it completely before using this file.
-
- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
-
- The Original Code and all software distributed under the License is
- distributed on an "AS IS" basis, without warranty of any kind, and the
- Initial Developer hereby disclaims all such warranties, including without
- limitation, any warranties of merchantability, fitness for a particular
- purpose or non-infringement. Please see the License for the specific terms
- and conditions governing the rights and limitations under the License.
-
-*/
-
-#ifndef _DEBUGTOOLS_H
-#define _DEBUGTOOLS_H
-
-#ifndef Standard_EXPORT
-#ifdef WNT
-#define Standard_EXPORT __declspec( dllexport )
-#else
-#define Standard_EXPORT extern
-#endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-Standard_EXPORT int perf_init_meter (const char * const MeterName);
-Standard_EXPORT int perf_tick_meter (const char * const MeterName);
-Standard_EXPORT int perf_tick_imeter (const int iMeter);
-Standard_EXPORT int perf_start_meter (const char * const MeterName);
-Standard_EXPORT int perf_start_imeter (const int iMeter);
-Standard_EXPORT int perf_stop_meter (const char * const MeterName);
-Standard_EXPORT int perf_stop_imeter (const int iMeter);
-Standard_EXPORT int perf_get_meter (const char * const MeterName,
- int * nb_enter,
- double * seconds);
-Standard_EXPORT void perf_close_meter (const char * const MeterName);
-Standard_EXPORT void perf_print_all_meters (void);
-Standard_EXPORT void perf_destroy_all_meters (void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef PERF_ENABLE_METERS
-#define PERF_TICK_METER(_m_name) { \
- static int __iMeter = 0; \
- if (__iMeter) perf_tick_imeter (__iMeter); \
- else __iMeter = perf_tick_meter (_m_name); \
-}
-
-#define PERF_START_METER(_m_name) { \
- static int __iMeter = 0; \
- if (__iMeter) perf_start_imeter (__iMeter); \
- else __iMeter = perf_start_meter (_m_name); \
-}
-
-#define PERF_STOP_METER(_m_name) { \
- static int __iMeter = 0; \
- if (__iMeter) perf_stop_imeter (__iMeter); \
- else __iMeter = perf_stop_meter (_m_name); \
-}
-
-#define PERF_CLOSE_METER(_m_name) perf_close_meter (_m_name);
-
-#define PERF_PRINT_ALL { \
- perf_print_all_meters(); \
-}
-
-#define PERF_PRINT_ALL_METERS { \
- perf_print_all_meters(); \
- perf_destroy_all_meters(); \
-}
-
-#else
-#define PERF_TICK_METER(_m_name)
-#define PERF_START_METER(_m_name)
-#define PERF_STOP_METER(_m_name)
-#define PERF_CLOSE_METER(_m_name)
-#define PERF_PRINT_ALL
-#define PERF_PRINT_ALL_METERS
-#endif
-
-#endif
+++ /dev/null
-DebugTools.h
-Perf.cxx
+++ /dev/null
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
-//
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
-//
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
-//
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
-
-/*======================================================================
-File : Perf.c
-Purpose : Set of functions to measure the CPU user time
-Author : Michael SAZONOV <msv@nnov.matra-dtv.fr>
-Created : 10/08/2000
-History : 25/09/2001 : AGV : (const char *) in prototypes;
- search in table using hashvalue
- 09/11/2001 : AGV : Add functions perf_*_imeter for performance
- Add function perf_tick_meter
-======================================================================*/
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <DebugTools.h>
-
-#ifndef WNT
-#include <unistd.h>
-#endif
-
-/* Function times() is more precise than clock() because it does not take into
- account the system time and the time of child processes */
-#include <time.h>
-#ifdef WNT
-#define STRICT
-#include <windows.h>
-typedef __int64 PERF_TIME;
-#define PICK_TIME(_utime) { \
- FILETIME t1, t2, ktime; \
- GetThreadTimes (GetCurrentThread(), &t1, &t2, &ktime, (FILETIME *)&(_utime));\
-}
-#define GET_SECONDS(_utime) (((double)(_utime))/10000000.)
-#else
-#include <sys/times.h>
-typedef clock_t PERF_TIME;
-#define PICK_TIME(_utime) { \
- struct tms tmbuf; \
- times (&tmbuf); \
- (_utime) = tmbuf.tms_utime; \
-}
-
-#ifndef CLK_TCK
-#define CLK_TCK 100 /* as SunOS */
-#endif
-
-#define GET_SECONDS(_utime) (((double)(_utime))/CLK_TCK)
-#endif
-/*======================================================================
- DEFINITIONS
-======================================================================*/
-
-typedef struct {
- char* name; /* identifier */
- unsigned int hash; /* hash value */
- PERF_TIME cumul_time; /* cumulative time */
- PERF_TIME start_time; /* to store start time */
- int nb_enter; /* number of enters */
-} t_TimeCounter;
-
-#define MAX_METERS 100
-
-static t_TimeCounter MeterTable[MAX_METERS];
-static int nb_meters = 0;
-
-static t_TimeCounter* find_meter (const char * const MeterName);
-static t_TimeCounter* _perf_init_meter (const char * const MeterName,
- const int doFind);
-static unsigned int hash_value (const char * const aString);
-
-/*======================================================================
-Function : perf_init_meter
-Purpose : Creates new counter (if it is absent) identified by
- MeterName and resets its cumulative value
-Returns : iMeter if OK, 0 if alloc problem
-======================================================================*/
-int perf_init_meter (const char * const MeterName)
-{
- t_TimeCounter* ptc = _perf_init_meter (MeterName, ~0);
- return (ptc ? (ptc-MeterTable)+1 : 0);
-}
-
-/*======================================================================
-Function : perf_tick_meter
-Purpose : Increments the counter of meter MeterName without changing
- its state with respect to measurement of time.
- creates new meter if there is no such meter
-Returns : iMeter if OK, 0 if no such meter and cannot create a new one
-======================================================================*/
-int perf_tick_meter (const char * const MeterName)
-{
- t_TimeCounter* ptc = find_meter (MeterName);
-
- if (!ptc) {
- /* create new meter */
- ptc = _perf_init_meter (MeterName, 0);
- }
-
- if (ptc) {
- ptc -> nb_enter ++;
- return (ptc-MeterTable) + 1;
- }
- return 0;
-}
-
-/*======================================================================
-Function : perf_tick_imeter
-Purpose : Increments the counter of meter iMeter without changing
- its state with respect to measurement of time.
-Returns : iMeter if OK, 0 if no such meter
-======================================================================*/
-int perf_tick_imeter (const int iMeter)
-{
- if (iMeter > 0 && iMeter <= nb_meters) {
- MeterTable[iMeter-1].nb_enter ++;
- return iMeter;
- }
- return 0;
-}
-
-/*======================================================================
-Function : perf_start_meter
-Purpose : Forces meter MeterName to begin to count by remembering
- the current data of timer;
- creates new meter if there is no such meter
-Returns : iMeter if OK, 0 if no such meter and cannot create a new one
-======================================================================*/
-int perf_start_meter (const char * const MeterName)
-{
- t_TimeCounter* ptc = find_meter (MeterName);
-
- if (!ptc) {
- /* create new meter */
- ptc = _perf_init_meter (MeterName, 0);
- }
-
- if (ptc) {
- PICK_TIME (ptc->start_time)
- return (ptc - MeterTable) + 1;
- }
-
- return 0;
-}
-
-/*======================================================================
-Function : perf_start_imeter
-Purpose : Forces meter with number iMeter to begin count by remembering
- the current data of timer;
- the meter must be previously created
-Returns : iMeter if OK, 0 if no such meter
-======================================================================*/
-int perf_start_imeter (const int iMeter)
-{
- if (iMeter > 0 && iMeter <= nb_meters) {
- t_TimeCounter * const ptc = &MeterTable[iMeter-1];
- PICK_TIME (ptc->start_time)
- return iMeter;
- }
- return 0;
-}
-
-/*======================================================================
-Function : perf_stop_meter
-Purpose : Forces meter MeterName to stop and cumulate time elapsed
- since start
-Returns : 1 if OK, 0 if no such meter or it is has not been started
-======================================================================*/
-int perf_stop_meter (const char * const MeterName)
-{
- t_TimeCounter* ptc = find_meter (MeterName);
-
- if (ptc && ptc->start_time) {
- PERF_TIME utime;
- PICK_TIME (utime)
- ptc->cumul_time += utime - ptc->start_time;
- ptc->start_time = 0;
- ptc->nb_enter++;
- return (ptc-MeterTable) + 1;
- }
-
- return 0;
-}
-
-/*======================================================================
-Function : perf_stop_imeter
-Purpose : Forces meter with number iMeter to stop and cumulate the time
- elapsed since the start
-Returns : iMeter if OK, 0 if no such meter
-======================================================================*/
-int perf_stop_imeter (const int iMeter)
-{
- if (iMeter > 0 && iMeter <= nb_meters) {
- t_TimeCounter * const ptc = &MeterTable[iMeter-1];
-
- if (ptc->start_time) {
- PERF_TIME utime;
- PICK_TIME (utime)
- ptc->cumul_time += utime - ptc->start_time;
- ptc->start_time = 0;
- ptc->nb_enter++;
- return iMeter;
- }
- }
- return 0;
-}
-
-/*======================================================================
-Function : perf_get_meter
-Purpose : Tells the time cumulated by meter MeterName and the number
- of enters to this meter
-Output : *nb_enter, *seconds if the pointers != NULL
-Returns : iMeter if OK, 0 if no such meter
-======================================================================*/
-int perf_get_meter (const char * const MeterName,
- int * nb_enter,
- double * seconds)
-{
- t_TimeCounter* ptc = find_meter (MeterName);
-
- if (!ptc) return 0;
-
- if (nb_enter) *nb_enter = ptc->nb_enter;
- if (seconds) *seconds = GET_SECONDS(ptc->cumul_time);
- return (ptc-MeterTable) + 1;
-}
-
-/*======================================================================
-Function : perf_print_all_meters
-Purpose : Prints on stdout the cumulated time and the number of
- enters for each meter in MeterTable;
- resets all meters
-Output : none
-Returns : none
-======================================================================*/
-void perf_print_all_meters (void)
-{
- int i;
-
- if (!nb_meters) return;
-
- printf (" Perf meter results : enters seconds enters/sec\n");
-
- for (i=0; i<nb_meters; i++) {
- t_TimeCounter* ptc = &MeterTable[i];
-
- if (ptc && ptc->nb_enter) {
- double secs = GET_SECONDS(ptc->cumul_time);
-
- if (ptc->start_time)
- printf ("Warning : meter %s has not been stopped\n", ptc->name);
-
- printf ("%-40s : %7d %8.2f %10.2f\n",
- ptc->name, ptc->nb_enter, secs,
- (secs>0. ? ptc->nb_enter / secs : 0.));
-
- ptc->cumul_time = 0;
- ptc->start_time = 0;
- ptc->nb_enter = 0;
- }
- }
-}
-
-/*======================================================================
-Function : perf_close_meter
-Purpose : Prints out a meter and resets it
-Returns : none
-======================================================================*/
-void perf_close_meter (const char * const MeterName)
-{
- t_TimeCounter* ptc = find_meter (MeterName);
- if (ptc && ptc->nb_enter) {
- if (ptc->start_time)
- printf (" ===> Warning : meter %s has not been stopped\n", ptc->name);
- printf (" ===> [%s] : %d enters, %9.3f seconds\n",
- ptc->name, ptc->nb_enter, GET_SECONDS(ptc->cumul_time));
- ptc->cumul_time = 0;
- ptc->start_time = 0;
- ptc->nb_enter = 0;
- }
-}
-
-/*======================================================================
-Function : perf_destroy_all_meters
-Purpose : Deletes all meters and frees memory
-Returns : none
-======================================================================*/
-void perf_destroy_all_meters (void)
-{
- int i;
- for (i=0; i<nb_meters; i++)
- free (MeterTable[i].name);
- nb_meters = 0;
-}
-
-/* agv - non portable: #pragma fini (perf_print_and_destroy) */
-
-void perf_print_and_destroy (void)
-{
- perf_print_all_meters ();
- perf_destroy_all_meters ();
-}
-
-/*======================================================================
-Function : _perf_init_meter
-Purpose : Creates new counter (if it is absent) identified by
- MeterName and resets its cumulative value
-Returns : the pointer if OK, 0 if alloc problem
-Remarks : For internal use in this module
-======================================================================*/
-static t_TimeCounter* _perf_init_meter (const char * const MeterName,
- const int doFind)
-{
- static int hasbeencalled = 0;
- t_TimeCounter* ptc = 0;
- if (doFind)
- ptc = find_meter (MeterName);
-
- if (!ptc) {
- if (nb_meters >= MAX_METERS) return 0;
- ptc = &MeterTable[nb_meters];
-
- ptc -> name = strdup (MeterName);
- if (!ptc -> name)
- return 0;
-
- ptc -> hash = hash_value (MeterName);
- nb_meters++;
- }
-
- ptc->cumul_time = 0;
- ptc->start_time = 0;
- ptc->nb_enter = 0;
- if (hasbeencalled == 0) {
- /*atexit (perf_print_and_destroy);*/
- hasbeencalled = ~0;
- }
- return ptc;
-}
-
-/*======================================================================
-Function : find_meter
-Purpose : Finds the meter MeterName in the MeterTable
-Returns : Pointer to meter object
-Remarks : For internal use in this module
-======================================================================*/
-static t_TimeCounter* find_meter (const char * const MeterName)
-{
- int i;
- const unsigned int aHash = hash_value (MeterName);
- for (i=0; i<nb_meters; i++)
- if (MeterTable[i].hash == aHash)
- if (!strcmp (MeterTable[i].name, MeterName)) return &MeterTable[i];
- return NULL;
-}
-
-static const unsigned int wCRC16a[16] =
-{
- 0000000, 0140301, 0140601, 0000500,
- 0141401, 0001700, 0001200, 0141101,
- 0143001, 0003300, 0003600, 0143501,
- 0002400, 0142701, 0142201, 0002100,
-};
-
-static const unsigned int wCRC16b[16] =
-{
- 0000000, 0146001, 0154001, 0012000,
- 0170001, 0036000, 0024000, 0162001,
- 0120001, 0066000, 0074000, 0132001,
- 0050000, 0116001, 0104001, 0043000,
-};
-
-/*======================================================================
-Function : hash_value
-Returns : the hash value of the string
-Remarks : For internal use in this module
-======================================================================*/
-static unsigned int hash_value (const char * const aString)
-{
- int i;
- unsigned int aCRC = 0;
- const int aLen = strlen (aString);
- const unsigned char * aPtr = (const unsigned char *) aString;
- for (i = aLen; i > 0; i--) {
- const unsigned int bTmp = aCRC ^ (const unsigned int) (* aPtr++);
- aCRC = ((aCRC >> 8) ^ wCRC16a[bTmp & 0x0F]) ^ wCRC16b[(bTmp >> 4) & 0x0F];
- }
- return aCRC;
-}
OSD_signal.cxx
OSD_signal_WNT.cxx
OSD_ThreadFunction.hxx
-OSD_PThread.hxx
+OSD_PThread.hxx
OSD_Localizer.cxx
-OSD_PerfMeter.c
+OSD_PerfMeter.cxx
OSD_PerfMeter.h
OSD_PerfMeter.hxx
OSD_MAllocHook.cxx
+++ /dev/null
-/*
- Created on: 2000-08-10
- Created by: Michael SAZONOV
- Copyright (c) 2000-2012 OPEN CASCADE SAS
-
- The content of this file is subject to the Open CASCADE Technology Public
- License Version 6.5 (the "License"). You may not use the content of this file
- except in compliance with the License. Please obtain a copy of the License
- at http://www.opencascade.org and read it completely before using this file.
-
- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
-
- The Original Code and all software distributed under the License is
- distributed on an "AS IS" basis, without warranty of any kind, and the
- Initial Developer hereby disclaims all such warranties, including without
- limitation, any warranties of merchantability, fitness for a particular
- purpose or non-infringement. Please see the License for the specific terms
- and conditions governing the rights and limitations under the License.
-
-*/
-
-/*======================================================================
-*/
-/*Purpose : Set of functions to measure the CPU user time
-*/
-/*25/09/2001 : AGV : (const char *) in prototypes;
-*/
-/*09/11/2001 : AGV : Add functions perf_*_imeter for performance
-*/
-/*Add function perf_tick_meter
-*/
-/*14/05/2002 : AGV : Portability UNIX/Windows
-*/
-/*======================================================================*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <time.h>
-#include <OSD_PerfMeter.h>
-
-/* ------- Definitions for Windows compiler -------- */
-#ifdef WNT
-#define STRICT
-#include <windows.h>
-typedef __int64 PERF_TIME;
-#define PICK_TIME(_utime) { \
- FILETIME t1, t2, ktime; \
- GetThreadTimes (GetCurrentThread(), &t1, &t2, &ktime, (FILETIME *)&(_utime));\
-}
-#define GET_SECONDS(_utime) (((double)(_utime))/10000000.)
-
-/* ------- POSIX Definitions ---------------------- */
-#else
-#include <sys/times.h>
-typedef clock_t PERF_TIME;
-#define PICK_TIME(_utime) { \
- struct tms tmbuf; \
- times (&tmbuf); \
- (_utime) = tmbuf.tms_utime; \
-}
-#define GET_SECONDS(_utime) (((double)(_utime))/CLOCKS_PER_SEC)
-// #define GET_SECONDS(_utime) (((double)(_utime))/CLK_TCK)
-#endif
-
-/*======================================================================
- DEFINITIONS
-======================================================================*/
-
-typedef struct {
- char* name; /* identifier */
- PERF_TIME cumul_time; /* cumulative time */
- PERF_TIME start_time; /* to store start time */
- int nb_enter; /* number of enters */
-} t_TimeCounter;
-
-#define MAX_METERS 100
-
-static t_TimeCounter MeterTable[MAX_METERS];
-static int nb_meters = 0;
-
-static int find_meter (const char * const MeterName);
-static int _perf_init_meter (const char * const MeterName,
- const int doFind);
-
-/*======================================================================
-Function : perf_init_meter
-Purpose : Creates new counter (if it is absent) identified by
- MeterName and resets its cumulative value
-Returns : iMeter if OK, -1 if alloc problem
-======================================================================*/
-int perf_init_meter (const char * const MeterName)
-{
- return _perf_init_meter (MeterName, ~0);
-}
-
-/*======================================================================
-Function : perf_tick_meter
-Purpose : Increments the counter of meter MeterName without changing
- its state with respect to measurement of time.
- creates new meter if there is no such meter
-Returns : iMeter if OK, -1 if no such meter and cannot create a new one
-======================================================================*/
-int perf_tick_meter (const char * const MeterName)
-{
- int ic = find_meter (MeterName);
-
- if (ic == -1) {
- /* create new meter */
- ic = _perf_init_meter (MeterName, 0);
- }
-
- if (ic >= 0)
- MeterTable[ic].nb_enter ++;
-
- return ic;
-}
-
-/*======================================================================
-Function : perf_tick_imeter
-Purpose : Increments the counter of meter iMeter without changing
- its state with respect to measurement of time.
-Returns : iMeter if OK, -1 if no such meter
-======================================================================*/
-int perf_tick_imeter (const int iMeter)
-{
- if (iMeter >= 0 && iMeter < nb_meters) {
- MeterTable[iMeter].nb_enter ++;
- return iMeter;
- }
- return -1;
-}
-
-/*======================================================================
-Function : perf_start_meter
-Purpose : Forces meter MeterName to begin to count by remembering
- the current data of timer;
- creates new meter if there is no such meter
-Returns : iMeter if OK, -1 if no such meter and cannot create a new one
-======================================================================*/
-int perf_start_meter (const char * const MeterName)
-{
- int ic = find_meter (MeterName);
-
- if (ic == -1) {
- /* create new meter */
- ic = _perf_init_meter (MeterName, 0);
- }
-
- if (ic >= 0)
- PICK_TIME (MeterTable[ic].start_time)
-
- return ic;
-}
-
-/*======================================================================
-Function : perf_start_imeter
-Purpose : Forces meter with number iMeter to begin count by remembering
- the current data of timer;
- the meter must be previously created
-Returns : iMeter if OK, -1 if no such meter
-======================================================================*/
-int perf_start_imeter (const int iMeter)
-{
- if (iMeter >= 0 && iMeter < nb_meters) {
- PICK_TIME (MeterTable[iMeter].start_time)
- return iMeter;
- }
- return -1;
-}
-
-/*======================================================================
-Function : perf_stop_meter
-Purpose : Forces meter MeterName to stop and cumulate time elapsed
- since start
-Returns : iMeter if OK, -1 if no such meter or it is has not been started
-======================================================================*/
-int perf_stop_meter (const char * const MeterName)
-{
- const int ic = find_meter (MeterName);
-
- if (ic >= 0 && MeterTable[ic].start_time) {
- t_TimeCounter * const ptc = &MeterTable[ic];
- PERF_TIME utime;
- PICK_TIME (utime)
- ptc->cumul_time += utime - ptc->start_time;
- ptc->start_time = 0;
- ptc->nb_enter++;
- }
-
- return ic;
-}
-
-/*======================================================================
-Function : perf_stop_imeter
-Purpose : Forces meter with number iMeter to stop and cumulate the time
- elapsed since the start
-Returns : iMeter if OK, -1 if no such meter or it is has not been started
-======================================================================*/
-int perf_stop_imeter (const int iMeter)
-{
- if (iMeter >= 0 && iMeter < nb_meters) {
- t_TimeCounter * const ptc = &MeterTable[iMeter];
- if (ptc->start_time) {
- PERF_TIME utime;
- PICK_TIME (utime)
- ptc->cumul_time += utime - ptc->start_time;
- ptc->start_time = 0;
- ptc->nb_enter++;
- return iMeter;
- }
- }
- return -1;
-}
-
-/*======================================================================
-Function : perf_get_meter
-Purpose : Tells the time cumulated by meter MeterName and the number
- of enters to this meter
-Output : *nb_enter, *seconds if the pointers != NULL
-Returns : iMeter if OK, -1 if no such meter
-======================================================================*/
-int perf_get_meter (const char * const MeterName,
- int * nb_enter,
- double * seconds)
-{
- const int ic = find_meter (MeterName);
-
- if (ic >= 0) {
- if (nb_enter) *nb_enter = MeterTable[ic].nb_enter;
- if (seconds) *seconds = GET_SECONDS(MeterTable[ic].cumul_time);
- }
- return ic;
-}
-
-/*======================================================================
-Function : perf_print_all_meters
-Purpose : Prints on stdout the cumulated time and the number of
- enters for each meter in MeterTable;
- resets all meters
-Output : none
-Returns : none
-======================================================================*/
-void perf_print_all_meters (void)
-{
- int i;
- for (i=0; i<nb_meters; i++) {
- const t_TimeCounter * const ptc = &MeterTable[i];
- if (ptc && ptc->nb_enter) {
- printf (" Perf meter results :"
- " enters seconds \xe6sec/enter\n");
- break;
- }
- }
-
- while (i < nb_meters) {
- t_TimeCounter * const ptc = &MeterTable[i++];
-
- if (ptc && ptc->nb_enter) {
- const double secs = GET_SECONDS(ptc->cumul_time);
-
- if (ptc->start_time)
- printf ("Warning : meter %s has not been stopped\n", ptc->name);
-
- printf ("%-42s : %7d %8.2f %10.2f\n",
- ptc->name, ptc->nb_enter, secs,
- (secs>0. ? 1000000 * secs/ptc->nb_enter : 0.));
-
- ptc->cumul_time = 0;
- ptc->start_time = 0;
- ptc->nb_enter = 0;
- }
- }
-}
-
-/*======================================================================
-Function : perf_close_meter
-Purpose : Prints out a meter and resets it
-Returns : none
-======================================================================*/
-void perf_close_meter (const char * const MeterName)
-{
- const int ic = find_meter (MeterName);
- if (ic >= 0 && MeterTable[ic].nb_enter) {
- t_TimeCounter * const ptc = &MeterTable[ic];
- if (ptc->start_time)
- printf (" ===> Warning : meter %s has not been stopped\n", ptc->name);
- printf (" ===> [%s] : %d enters, %9.3f seconds\n",
- ptc->name, ptc->nb_enter, GET_SECONDS(ptc->cumul_time));
- ptc->cumul_time = 0;
- ptc->start_time = 0;
- ptc->nb_enter = 0;
- }
-}
-
-/*======================================================================
-Function : perf_close_imeter
-Purpose : Prints out a meter and resets it
-Returns : none
-======================================================================*/
-void perf_close_imeter (const int iMeter)
-{
- if (iMeter >= 0 && iMeter < nb_meters && MeterTable[iMeter].nb_enter) {
- t_TimeCounter * const ptc = &MeterTable[iMeter];
- if (ptc->start_time)
- printf (" ===> Warning : meter %s has not been stopped\n", ptc->name);
- printf (" ===> [%s] : %d enters, %9.3f seconds\n",
- ptc->name, ptc->nb_enter, GET_SECONDS(ptc->cumul_time));
- ptc->cumul_time = 0;
- ptc->start_time = 0;
- ptc->nb_enter = 0;
- }
-}
-
-/*======================================================================
-Function : perf_destroy_all_meters
-Purpose : Deletes all meters and frees memory
-Returns : none
-======================================================================*/
-void perf_destroy_all_meters (void)
-{
- int i;
- for (i=0; i<nb_meters; i++)
- free (MeterTable[i].name);
- nb_meters = 0;
-}
-
-/* agv - non portable: #pragma fini (perf_print_and_destroy)
- using atexit instead (see _perf_init_meter below) */
-
-void perf_print_and_destroy (void)
-{
- perf_print_all_meters ();
- perf_destroy_all_meters ();
-}
-
-/*======================================================================
-Function : _perf_init_meter
-Purpose : Creates new counter (if it is absent) identified by
- MeterName and resets its cumulative value
-Returns : index of meter if OK, -1 if alloc problem
-Remarks : For internal use in this module
-======================================================================*/
-static int _perf_init_meter (const char * const MeterName,
- const int doFind)
-{
- static int hasbeencalled = 0;
- int ic = -1;
- if (doFind)
- ic = find_meter (MeterName);
-
- if (ic == -1) {
- if (nb_meters >= MAX_METERS) return 0;
- ic = nb_meters;
-
- MeterTable[ic].name = strdup (MeterName);
- if (!MeterTable[ic].name)
- return -1;
-
- nb_meters++;
- }
-
- MeterTable[ic].cumul_time = 0;
- MeterTable[ic].start_time = 0;
- MeterTable[ic].nb_enter = 0;
- if (hasbeencalled == 0) {
- atexit (perf_print_and_destroy);
- hasbeencalled = ~0;
- }
- return ic;
-}
-
-/*======================================================================
-Function : find_meter
-Purpose : Finds the meter MeterName in the MeterTable
-Returns : Index of meter object, -1 if not found
-Remarks : For internal use in this module
-======================================================================*/
-static int find_meter (const char * const MeterName)
-{
- int i;
- for (i=0; i<nb_meters; i++)
- if (!strcmp (MeterTable[i].name, MeterName)) return i;
- return -1;
-}
--- /dev/null
+/*
+ Created on: 2000-08-10
+ Created by: Michael SAZONOV
+ Copyright (c) 2000-2012 OPEN CASCADE SAS
+
+ The content of this file is subject to the Open CASCADE Technology Public
+ License Version 6.5 (the "License"). You may not use the content of this file
+ except in compliance with the License. Please obtain a copy of the License
+ at http://www.opencascade.org and read it completely before using this file.
+
+ The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+ main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+
+ The Original Code and all software distributed under the License is
+ distributed on an "AS IS" basis, without warranty of any kind, and the
+ Initial Developer hereby disclaims all such warranties, including without
+ limitation, any warranties of merchantability, fitness for a particular
+ purpose or non-infringement. Please see the License for the specific terms
+ and conditions governing the rights and limitations under the License.
+
+*/
+
+/*======================================================================
+*/
+/*Purpose : Set of functions to measure the CPU user time
+*/
+/*25/09/2001 : AGV : (const char *) in prototypes;
+*/
+/*09/11/2001 : AGV : Add functions perf_*_imeter for performance
+*/
+/*Add function perf_tick_meter
+*/
+/*14/05/2002 : AGV : Portability UNIX/Windows
+*/
+/*======================================================================*/
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <time.h>
+#include <OSD_Chronometer.hxx>
+#include <OSD_PerfMeter.h>
+
+
+/*======================================================================
+ DEFINITIONS
+======================================================================*/
+
+typedef Standard_Real PERF_TIME;
+
+#define PICK_TIME(_utime) { \
+ Standard_Real ktime; \
+ OSD_Chronometer::GetThreadCPU(_utime, ktime);\
+}
+
+typedef struct {
+ char* name; /* identifier */
+ PERF_TIME cumul_time; /* cumulative time */
+ PERF_TIME start_time; /* to store start time */
+ int nb_enter; /* number of enters */
+} t_TimeCounter;
+
+#define MAX_METERS 100
+
+static t_TimeCounter MeterTable[MAX_METERS];
+static int nb_meters = 0;
+
+static int find_meter (const char * const MeterName);
+static int _perf_init_meter (const char * const MeterName,
+ const int doFind);
+
+/*======================================================================
+Function : perf_init_meter
+Purpose : Creates new counter (if it is absent) identified by
+ MeterName and resets its cumulative value
+Returns : iMeter if OK, -1 if alloc problem
+======================================================================*/
+int perf_init_meter (const char * const MeterName)
+{
+ return _perf_init_meter (MeterName, ~0);
+}
+
+/*======================================================================
+Function : perf_tick_meter
+Purpose : Increments the counter of meter MeterName without changing
+ its state with respect to measurement of time.
+ creates new meter if there is no such meter
+Returns : iMeter if OK, -1 if no such meter and cannot create a new one
+======================================================================*/
+int perf_tick_meter (const char * const MeterName)
+{
+ int ic = find_meter (MeterName);
+
+ if (ic == -1) {
+ /* create new meter */
+ ic = _perf_init_meter (MeterName, 0);
+ }
+
+ if (ic >= 0)
+ MeterTable[ic].nb_enter ++;
+
+ return ic;
+}
+
+/*======================================================================
+Function : perf_tick_imeter
+Purpose : Increments the counter of meter iMeter without changing
+ its state with respect to measurement of time.
+Returns : iMeter if OK, -1 if no such meter
+======================================================================*/
+int perf_tick_imeter (const int iMeter)
+{
+ if (iMeter >= 0 && iMeter < nb_meters) {
+ MeterTable[iMeter].nb_enter ++;
+ return iMeter;
+ }
+ return -1;
+}
+
+/*======================================================================
+Function : perf_start_meter
+Purpose : Forces meter MeterName to begin to count by remembering
+ the current data of timer;
+ creates new meter if there is no such meter
+Returns : iMeter if OK, -1 if no such meter and cannot create a new one
+======================================================================*/
+int perf_start_meter (const char * const MeterName)
+{
+ int ic = find_meter (MeterName);
+
+ if (ic == -1) {
+ /* create new meter */
+ ic = _perf_init_meter (MeterName, 0);
+ }
+
+ if (ic >= 0)
+ PICK_TIME (MeterTable[ic].start_time)
+
+ return ic;
+}
+
+/*======================================================================
+Function : perf_start_imeter
+Purpose : Forces meter with number iMeter to begin count by remembering
+ the current data of timer;
+ the meter must be previously created
+Returns : iMeter if OK, -1 if no such meter
+======================================================================*/
+int perf_start_imeter (const int iMeter)
+{
+ if (iMeter >= 0 && iMeter < nb_meters) {
+ PICK_TIME (MeterTable[iMeter].start_time)
+ return iMeter;
+ }
+ return -1;
+}
+
+/*======================================================================
+Function : perf_stop_meter
+Purpose : Forces meter MeterName to stop and cumulate time elapsed
+ since start
+Returns : iMeter if OK, -1 if no such meter or it is has not been started
+======================================================================*/
+int perf_stop_meter (const char * const MeterName)
+{
+ const int ic = find_meter (MeterName);
+
+ if (ic >= 0 && MeterTable[ic].start_time) {
+ t_TimeCounter * const ptc = &MeterTable[ic];
+ PERF_TIME utime;
+ PICK_TIME (utime)
+ ptc->cumul_time += utime - ptc->start_time;
+ ptc->start_time = 0;
+ ptc->nb_enter++;
+ }
+
+ return ic;
+}
+
+/*======================================================================
+Function : perf_stop_imeter
+Purpose : Forces meter with number iMeter to stop and cumulate the time
+ elapsed since the start
+Returns : iMeter if OK, -1 if no such meter or it is has not been started
+======================================================================*/
+int perf_stop_imeter (const int iMeter)
+{
+ if (iMeter >= 0 && iMeter < nb_meters) {
+ t_TimeCounter * const ptc = &MeterTable[iMeter];
+ if (ptc->start_time) {
+ PERF_TIME utime;
+ PICK_TIME (utime)
+ ptc->cumul_time += utime - ptc->start_time;
+ ptc->start_time = 0;
+ ptc->nb_enter++;
+ return iMeter;
+ }
+ }
+ return -1;
+}
+
+/*======================================================================
+Function : perf_get_meter
+Purpose : Tells the time cumulated by meter MeterName and the number
+ of enters to this meter
+Output : *nb_enter, *seconds if the pointers != NULL
+Returns : iMeter if OK, -1 if no such meter
+======================================================================*/
+int perf_get_meter (const char * const MeterName,
+ int * nb_enter,
+ double * seconds)
+{
+ const int ic = find_meter (MeterName);
+
+ if (ic >= 0) {
+ if (nb_enter) *nb_enter = MeterTable[ic].nb_enter;
+ if (seconds) *seconds = MeterTable[ic].cumul_time;
+ }
+ return ic;
+}
+
+/*======================================================================
+Function : perf_print_all_meters
+Purpose : Prints on stdout the cumulated time and the number of
+ enters for each meter in MeterTable;
+ resets all meters
+Output : none
+Returns : none
+======================================================================*/
+void perf_print_all_meters (void)
+{
+ int i;
+ for (i=0; i<nb_meters; i++) {
+ const t_TimeCounter * const ptc = &MeterTable[i];
+ if (ptc && ptc->nb_enter) {
+ printf (" Perf meter results :"
+ " enters seconds \xe6sec/enter\n");
+ break;
+ }
+ }
+
+ while (i < nb_meters) {
+ t_TimeCounter * const ptc = &MeterTable[i++];
+
+ if (ptc && ptc->nb_enter) {
+ const double secs = ptc->cumul_time;
+
+ if (ptc->start_time)
+ printf ("Warning : meter %s has not been stopped\n", ptc->name);
+
+ printf ("%-42s : %7d %8.2f %10.2f\n",
+ ptc->name, ptc->nb_enter, secs,
+ (secs>0. ? 1000000 * secs/ptc->nb_enter : 0.));
+
+ ptc->cumul_time = 0;
+ ptc->start_time = 0;
+ ptc->nb_enter = 0;
+ }
+ }
+}
+
+/*======================================================================
+Function : perf_close_meter
+Purpose : Prints out a meter and resets it
+Returns : none
+======================================================================*/
+void perf_close_meter (const char * const MeterName)
+{
+ const int ic = find_meter (MeterName);
+ if (ic >= 0 && MeterTable[ic].nb_enter) {
+ t_TimeCounter * const ptc = &MeterTable[ic];
+ if (ptc->start_time)
+ printf (" ===> Warning : meter %s has not been stopped\n", ptc->name);
+ printf (" ===> [%s] : %d enters, %9.3f seconds\n",
+ ptc->name, ptc->nb_enter, ptc->cumul_time);
+ ptc->cumul_time = 0;
+ ptc->start_time = 0;
+ ptc->nb_enter = 0;
+ }
+}
+
+/*======================================================================
+Function : perf_close_imeter
+Purpose : Prints out a meter and resets it
+Returns : none
+======================================================================*/
+void perf_close_imeter (const int iMeter)
+{
+ if (iMeter >= 0 && iMeter < nb_meters && MeterTable[iMeter].nb_enter) {
+ t_TimeCounter * const ptc = &MeterTable[iMeter];
+ if (ptc->start_time)
+ printf (" ===> Warning : meter %s has not been stopped\n", ptc->name);
+ printf (" ===> [%s] : %d enters, %9.3f seconds\n",
+ ptc->name, ptc->nb_enter, ptc->cumul_time);
+ ptc->cumul_time = 0;
+ ptc->start_time = 0;
+ ptc->nb_enter = 0;
+ }
+}
+
+/*======================================================================
+Function : perf_destroy_all_meters
+Purpose : Deletes all meters and frees memory
+Returns : none
+======================================================================*/
+void perf_destroy_all_meters (void)
+{
+ int i;
+ for (i=0; i<nb_meters; i++)
+ free (MeterTable[i].name);
+ nb_meters = 0;
+}
+
+/* agv - non portable: #pragma fini (perf_print_and_destroy)
+ using atexit instead (see _perf_init_meter below) */
+
+void perf_print_and_destroy (void)
+{
+ perf_print_all_meters ();
+ perf_destroy_all_meters ();
+}
+
+/*======================================================================
+Function : _perf_init_meter
+Purpose : Creates new counter (if it is absent) identified by
+ MeterName and resets its cumulative value
+Returns : index of meter if OK, -1 if alloc problem
+Remarks : For internal use in this module
+======================================================================*/
+static int _perf_init_meter (const char * const MeterName,
+ const int doFind)
+{
+ static int hasbeencalled = 0;
+ int ic = -1;
+ if (doFind)
+ ic = find_meter (MeterName);
+
+ if (ic == -1) {
+ if (nb_meters >= MAX_METERS) return 0;
+ ic = nb_meters;
+
+ MeterTable[ic].name = strdup (MeterName);
+ if (!MeterTable[ic].name)
+ return -1;
+
+ nb_meters++;
+ }
+
+ MeterTable[ic].cumul_time = 0;
+ MeterTable[ic].start_time = 0;
+ MeterTable[ic].nb_enter = 0;
+ if (hasbeencalled == 0) {
+ atexit (perf_print_and_destroy);
+ hasbeencalled = ~0;
+ }
+ return ic;
+}
+
+/*======================================================================
+Function : find_meter
+Purpose : Finds the meter MeterName in the MeterTable
+Returns : Index of meter object, -1 if not found
+Remarks : For internal use in this module
+======================================================================*/
+static int find_meter (const char * const MeterName)
+{
+ int i;
+ for (i=0; i<nb_meters; i++)
+ if (!strcmp (MeterTable[i].name, MeterName)) return i;
+ return -1;
+}
#define PERF_PRINT_ALL
#endif
-#ifndef Standard_EXPORT
-#ifdef WNT
-#define Standard_EXPORT __declspec( dllexport )
-#else
-#define Standard_EXPORT extern
-#endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-Standard_EXPORT int perf_init_meter (const char * const MeterName);
+Standard_EXPORTEXTERNC int perf_init_meter (const char * const MeterName);
/* Creates new counter (if it is absent) identified by
MeterName and resets its cumulative value
Returns : iMeter if OK, -1 if alloc problem
*/
-Standard_EXPORT int perf_start_meter (const char * const MeterName);
+Standard_EXPORTEXTERNC int perf_start_meter (const char * const MeterName);
/* Forces meter MeterName to begin to count by remembering
the current data of timer.
Creates new meter if there is no such meter
Returns : iMeter if OK, -1 if no such meter and cannot create a new one
*/
-Standard_EXPORT int perf_start_imeter (const int iMeter);
+Standard_EXPORTEXTERNC int perf_start_imeter (const int iMeter);
/* Forces meter with number iMeter to begin count by remembering
the current data of timer.
Returns : iMeter if OK, -1 if no such meter
*/
-Standard_EXPORT int perf_stop_meter (const char * const MeterName);
+Standard_EXPORTEXTERNC int perf_stop_meter (const char * const MeterName);
/* Forces meter MeterName to stop and cumulate the time elapsed since the start
Returns : iMeter if OK, -1 if no such meter or it is has not been started
*/
-Standard_EXPORT int perf_stop_imeter (const int iMeter);
+Standard_EXPORTEXTERNC int perf_stop_imeter (const int iMeter);
/* Forces meter with number iMeter to stop and cumulate the time
elapsed since the start.
Returns : iMeter if OK, -1 if no such meter or it is has not been started
*/
-Standard_EXPORT int perf_tick_meter (const char * const MeterName);
+Standard_EXPORTEXTERNC int perf_tick_meter (const char * const MeterName);
/* Increments the counter of meter MeterName without changing
its state with respect to measurement of time.
Creates new meter if there is no such meter
Returns : iMeter if OK, -1 if no such meter and cannot create a new one
*/
-Standard_EXPORT int perf_tick_imeter (const int iMeter);
+Standard_EXPORTEXTERNC int perf_tick_imeter (const int iMeter);
/* Increments the counter of meter iMeter without changing
its state with respect to measurement of time.
Returns : iMeter if OK, -1 if no such meter
*/
-Standard_EXPORT int perf_get_meter (const char * const MeterName,
+Standard_EXPORTEXTERNC int perf_get_meter (const char * const MeterName,
int * nb_enter,
double * seconds);
/* Tells the time cumulated by meter MeterName and the number
Returns : iMeter if OK, -1 if no such meter
*/
-Standard_EXPORT void perf_close_meter (const char * const MeterName);
+Standard_EXPORTEXTERNC void perf_close_meter (const char * const MeterName);
/* Prints on stdout the cumulated time and the number of enters
for the specified meter
*/
-Standard_EXPORT void perf_close_imeter (const int iMeter);
+Standard_EXPORTEXTERNC void perf_close_imeter (const int iMeter);
/* Prints on stdout the cumulated time and the number of enters
for the specified meter
*/
-Standard_EXPORT void perf_print_all_meters (void);
+Standard_EXPORTEXTERNC void perf_print_all_meters (void);
/* Prints on stdout the cumulated time and the number of
enters for each alive meter which have the number of enters > 0.
Resets all meters
*/
-Standard_EXPORT void perf_destroy_all_meters (void);
+Standard_EXPORTEXTERNC void perf_destroy_all_meters (void);
/* Deletes all meters and frees memory
*/
-extern void perf_print_and_destroy (void);
+Standard_EXPORTEXTERNC void perf_print_and_destroy (void);
/* ATTENTION !!!
This func calls both perf_print_all_meters() and perf_destroy_all_meters()
and is called automatically at the end of a program
via system call atexit()
*/
-#ifdef __cplusplus
-}
-#endif
-
#endif
// and conditions governing the rights and limitations under the License.
-
#include <QABugs.hxx>
#include <Draw_Interpretor.hxx>
#include <PCollection_HAsciiString.hxx>
+#include <cstdio>
+#include <cmath>
+#include <iostream>
+#include <OSD_PerfMeter.hxx>
+#include <OSD_Timer.hxx>
+#include <BRepPrimAPI_MakeBox.hxx>
+#include <BRepPrimAPI_MakeSphere.hxx>
+#include <BRepAlgo_Cut.hxx>
+
//static Standard_Integer OCC230 (Draw_Interpretor& /*di*/, Standard_Integer /*argc*/, const char ** /*argv*/)
static Standard_Integer OCC230 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
return 0;
}
+static Standard_Integer OCC23237 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char** /*argv*/)
+{
+ OSD_PerfMeter aPM("TestMeter",0);
+ OSD_Timer aTM;
+
+ // run some operation in cycle for about 2 seconds to have good values of times to compare
+ int count = 0;
+ printf("OSD_PerfMeter test.\nRunning Boolean operation on solids in loop.\n");
+ for (; aTM.ElapsedTime() < 2.; count++)
+ {
+ aPM.Start();
+ aTM.Start();
+
+ // do some operation that will take considerable time compared with time or starting / stopping timers
+ BRepPrimAPI_MakeBox aBox (10., 10., 10.);
+ BRepPrimAPI_MakeSphere aSphere (10.);
+ BRepAlgo_Cut (aBox.Shape(), aSphere.Shape());
+
+ aTM.Stop();
+ aPM.Stop();
+ }
+
+ int aNbEnters = 0;
+ Standard_Real aPerfMeter_CPUtime = 0., aTimer_ElapsedTime = aTM.ElapsedTime();
+
+ perf_get_meter("TestMeter", &aNbEnters, &aPerfMeter_CPUtime);
+
+ Standard_Real aTimeDiff = (fabs(aTimer_ElapsedTime - aPerfMeter_CPUtime) / aTimer_ElapsedTime);
+
+ printf("\nMeasurement results (%d cycles):\n", count);
+ printf("\nOSD_PerfMeter CPU time: %lf\nOSD_Timer elapsed time: %lf\n", aPerfMeter_CPUtime, aTimer_ElapsedTime);
+ printf("Time delta is: %.3lf %%\n", aTimeDiff * 100);
+
+ if (aTimeDiff > 0.2)
+ di << "OCC23237: Error: too much difference between CPU and elapsed times";
+ else if (aNbEnters != count)
+ di << "OCC23237: Error: counter reported by PerfMeter (" << aNbEnters << ") does not correspond to actual number of cycles";
+ else
+ di << "OCC23237: OK";
+
+ return 0;
+}
+
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
char *group = "QABugs";
theCommands.Add ("OCC230", "OCC230 TrimmedCurve Pnt2d Pnt2d", __FILE__, OCC230, group);
theCommands.Add ("OCC142", "OCC142", __FILE__, OCC142, group);
theCommands.Add ("OCC23361", "OCC23361", __FILE__, OCC23361, group);
+ theCommands.Add("OCC23237", "OCC23237", __FILE__, OCC23237, group);
return;
}
#include <QANCollection.hxx>
#include <Draw_Interpretor.hxx>
-#include <DebugTools.h>
+#include <OSD_PerfMeter.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#endif
#define PERF_ENABLE_METERS
-#include <DebugTools.h>
-//////////////#include <Perf_Meter.hxx>
+#include <OSD_PerfMeter.hxx>
extern Handle(NCollection_BaseAllocator) getAlloc (const int i);
void createArray (TColgp_Array1OfPnt& anArrPnt)
{
+ OSD_PerfMeter aPerfMeter("Create array");
+
for (Standard_Integer j = 0; j < 2*REPEAT; j++) {
PERF_START_METER("Create array")
for (Standard_Integer i = anArrPnt.Lower(); i <= anArrPnt.Upper(); i++)
void printAllMeters ()
{
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
#define QANCollection_PerfArrays_HeaderFile
#define PERF_ENABLE_METERS
-#include <DebugTools.h>
+#include <OSD_PerfMeter.hxx>
////////////////////////////////#include <Perf_Meter.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array2OfPnt.hxx>
////////////////////////////////aTOper.Stop();
PERF_STOP_METER("TCollection_Array1 operator=")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
// ===================== Test perform of Array2 type ==========================
////////////////////////////////aTOper.Stop();
PERF_STOP_METER("TCollection_Array2 operator=")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_List clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
// ===================== Test perform of Queue type ==========================
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_Queue clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
// ===================== Test perform of Stack type ==========================
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_Stack clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_Set clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_SList clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
// ===================== Test perform of Sequence type ==========================
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_Sequence clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
#endif
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_Map clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
// ===================== Test perform of DataMap type ==========================
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_DataMap clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
// ===================== Test perform of DoubleMap type ==========================
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_DoubleMap clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
if (iFail1 || iFail2)
cout << "Warning : N map failed " << iFail1 << " times, T map - " <<
iFail2 << endl;
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_IndexedMap clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
// ===================== Test perform of IndexedDataMap type ==========================
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_IndexedDataMap clearing")
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
#endif
#define QANCollection_PerfSparseArray_HeaderFile
#define PERF_ENABLE_METERS
-#include <DebugTools.h>
+#include <OSD_PerfMeter.hxx>
////////////////////////////////#include <Perf_Meter.hxx>
#include <NCollection_SparseArray.hxx>
#include <NCollection_SparseArrayBase.hxx>
}
- PERF_PRINT_ALL_METERS
+ PERF_PRINT_ALL
}
#endif
-DebugTools
+
QABugs
QADNaming
QADraw
--- /dev/null
+puts "============"
+puts "CR23237"
+puts "==========="
+puts ""
+################################################
+# Bug in OSD_PerfMeter
+################################################
+
+pload QAcommands
+
+OCC23237
\ No newline at end of file