3535static opal_timer_t opal_timer_base_get_cycles_sys_timer (void );
3636static opal_timer_t opal_timer_base_get_usec_sys_timer (void );
3737
38- #if OPAL_HAVE_CLOCK_GETTIME
38+ #if OPAL_HAVE_CLOCK_GETTIME && ( 0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES )
3939static opal_timer_t opal_timer_base_get_cycles_clock_gettime (void );
4040static opal_timer_t opal_timer_base_get_usec_clock_gettime (void );
4141opal_timer_t (* opal_timer_base_get_cycles )(void ) = opal_timer_base_get_cycles_clock_gettime ;
4242opal_timer_t (* opal_timer_base_get_usec )(void ) = opal_timer_base_get_usec_clock_gettime ;
4343#else
4444opal_timer_t (* opal_timer_base_get_cycles )(void ) = opal_timer_base_get_cycles_sys_timer ;
4545opal_timer_t (* opal_timer_base_get_usec )(void ) = opal_timer_base_get_usec_sys_timer ;
46- #endif /* OPAL_HAVE_CLOCK_GETTIME */
46+ #endif /* OPAL_HAVE_CLOCK_GETTIME && (0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES) */
4747
4848opal_timer_t opal_timer_linux_freq = {0 };
4949
@@ -159,7 +159,7 @@ int opal_timer_linux_open(void)
159159 int ret = OPAL_SUCCESS ;
160160
161161 if (mca_timer_base_monotonic ) {
162- #if OPAL_HAVE_CLOCK_GETTIME
162+ #if OPAL_HAVE_CLOCK_GETTIME && ( 0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES )
163163 struct timespec res ;
164164 if ( 0 == clock_getres (CLOCK_MONOTONIC , & res )) {
165165 opal_timer_linux_freq = 1.e9 ;
@@ -172,15 +172,15 @@ int opal_timer_linux_open(void)
172172 /* Monotonic time requested but cannot be found. Complain! */
173173 opal_show_help ("help-opal-timer-linux.txt" , "monotonic not supported" , 1 );
174174#endif /* (0 == OPAL_TIMER_MONOTONIC) */
175- #endif
175+ #endif /* OPAL_HAVE_CLOCK_GETTIME && (0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES) */
176176 }
177177 ret = opal_timer_linux_find_freq ();
178178 opal_timer_base_get_cycles = opal_timer_base_get_cycles_sys_timer ;
179179 opal_timer_base_get_usec = opal_timer_base_get_usec_sys_timer ;
180180 return ret ;
181181}
182182
183- #if OPAL_HAVE_CLOCK_GETTIME
183+ #if OPAL_HAVE_CLOCK_GETTIME && ( 0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES )
184184opal_timer_t opal_timer_base_get_usec_clock_gettime (void )
185185{
186186 struct timespec tp ;
@@ -200,7 +200,7 @@ opal_timer_t opal_timer_base_get_cycles_clock_gettime(void)
200200 }
201201 return 0 ;
202202}
203- #endif /* OPAL_HAVE_CLOCK_GETTIME */
203+ #endif /* OPAL_HAVE_CLOCK_GETTIME && (0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES) */
204204
205205opal_timer_t opal_timer_base_get_cycles_sys_timer (void )
206206{
0 commit comments