35
35
static opal_timer_t opal_timer_base_get_cycles_sys_timer (void );
36
36
static opal_timer_t opal_timer_base_get_usec_sys_timer (void );
37
37
38
- #if OPAL_HAVE_CLOCK_GETTIME
38
+ #if OPAL_HAVE_CLOCK_GETTIME && ( 0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES )
39
39
static opal_timer_t opal_timer_base_get_cycles_clock_gettime (void );
40
40
static opal_timer_t opal_timer_base_get_usec_clock_gettime (void );
41
41
opal_timer_t (* opal_timer_base_get_cycles )(void ) = opal_timer_base_get_cycles_clock_gettime ;
42
42
opal_timer_t (* opal_timer_base_get_usec )(void ) = opal_timer_base_get_usec_clock_gettime ;
43
43
#else
44
44
opal_timer_t (* opal_timer_base_get_cycles )(void ) = opal_timer_base_get_cycles_sys_timer ;
45
45
opal_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) */
47
47
48
48
opal_timer_t opal_timer_linux_freq = {0 };
49
49
@@ -159,7 +159,7 @@ int opal_timer_linux_open(void)
159
159
int ret = OPAL_SUCCESS ;
160
160
161
161
if (mca_timer_base_monotonic ) {
162
- #if OPAL_HAVE_CLOCK_GETTIME
162
+ #if OPAL_HAVE_CLOCK_GETTIME && ( 0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES )
163
163
struct timespec res ;
164
164
if ( 0 == clock_getres (CLOCK_MONOTONIC , & res )) {
165
165
opal_timer_linux_freq = 1.e9 ;
@@ -172,15 +172,15 @@ int opal_timer_linux_open(void)
172
172
/* Monotonic time requested but cannot be found. Complain! */
173
173
opal_show_help ("help-opal-timer-linux.txt" , "monotonic not supported" , 1 );
174
174
#endif /* (0 == OPAL_TIMER_MONOTONIC) */
175
- #endif
175
+ #endif /* OPAL_HAVE_CLOCK_GETTIME && (0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES) */
176
176
}
177
177
ret = opal_timer_linux_find_freq ();
178
178
opal_timer_base_get_cycles = opal_timer_base_get_cycles_sys_timer ;
179
179
opal_timer_base_get_usec = opal_timer_base_get_usec_sys_timer ;
180
180
return ret ;
181
181
}
182
182
183
- #if OPAL_HAVE_CLOCK_GETTIME
183
+ #if OPAL_HAVE_CLOCK_GETTIME && ( 0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES )
184
184
opal_timer_t opal_timer_base_get_usec_clock_gettime (void )
185
185
{
186
186
struct timespec tp ;
@@ -200,7 +200,7 @@ opal_timer_t opal_timer_base_get_cycles_clock_gettime(void)
200
200
}
201
201
return 0 ;
202
202
}
203
- #endif /* OPAL_HAVE_CLOCK_GETTIME */
203
+ #endif /* OPAL_HAVE_CLOCK_GETTIME && (0 == OPAL_HAVE_SYS_TIMER_GET_CYCLES) */
204
204
205
205
opal_timer_t opal_timer_base_get_cycles_sys_timer (void )
206
206
{
0 commit comments