2 //=============================================================================
4 * @file Timeprobe_Test.cpp
6 * This is a simple test of ACE Timeprobes.
8 * @author Irfan Pyarali <irfan@cs.wustl.edu>
10 //=============================================================================
13 //#define ACE_ENABLE_TIMEPROBES
14 //#define ACE_MT_TIMEPROBES
15 //#define ACE_TSS_TIMEPROBES
17 #include "test_config.h"
18 #include "ace/Singleton.h"
19 #include "ace/Synch_Traits.h"
20 #include "ace/Recursive_Thread_Mutex.h"
21 #include "ace/Null_Mutex.h"
22 #include "ace/OS_NS_unistd.h"
23 #include "ace/Timeprobe.h"
27 #if defined (ACE_ENABLE_TIMEPROBES)
29 static const char *events_descriptions_0
[] =
57 static const char *events_descriptions_1
[] =
69 ACE_TIMEPROBE_EVENT_DESCRIPTIONS (events_descriptions_1
, WORK_START
);
70 ACE_TIMEPROBE_EVENT_DESCRIPTIONS (events_descriptions_0
, EVENT_ZERO
);
72 #endif /* ACE_ENABLE_TIMEPROBES */
77 ACE_FUNCTION_TIMEPROBE (WORK_START
);
81 #if !defined (ACE_HAS_PURIFY)
82 // Test creation of ACE_Singletons during static object construction.
83 // Timeprobes can do that, when they're enabled. Purify would notice
84 // the memory in use at program termination.
88 int *i
= ACE_Singleton
<int, ACE_SYNCH_RECURSIVE_MUTEX
>::instance ();
94 int static_singleton_creator
= create_singleton ();
95 #endif /* ! ACE_HAS_PURIFY */
98 run_main (int, ACE_TCHAR
*[])
100 ACE_START_TEST (ACE_TEXT ("Timeprobe_Test"));
102 ACE_TIMEPROBE ("Starting Test");
104 for (int i
= 0; i
< 3; i
++)
107 ACE_TIMEPROBE (EVENT_ZERO
+ i
);
110 ACE_TIMEPROBE ("Ending Test");