int intel_kmpc_11_hook_points (int rank)
{
	int count = 0;

	UNREFERENCED_PARAMETER(rank);

	/* Careful, do not overwrite the pointer to the real call if DynInst has
	   already done it */
	if (__kmpc_fork_call_real == NULL)
	{
		/* Obtain @ for __kmpc_fork_call */
		__kmpc_fork_call_real =
			(void(*)(void*,int,void*,...))
			dlsym (RTLD_NEXT, "__kmpc_fork_call");
		INC_IF_NOT_NULL(__kmpc_fork_call_real,count);
	}

	/* Obtain @ for __kmpc_barrier */
	__kmpc_barrier_real =
		(void(*)(void*,int))
		dlsym (RTLD_NEXT, "__kmpc_barrier");
	INC_IF_NOT_NULL(__kmpc_barrier_real,count);

	/* Obtain @ for __kmpc_critical */
	__kmpc_critical_real =
		(void(*)(void*,int,void*))
		dlsym (RTLD_NEXT, "__kmpc_critical");
	INC_IF_NOT_NULL(__kmpc_critical_real,count);

	/* Obtain @ for __kmpc_end_critical */
	__kmpc_end_critical_real =
		(void(*)(void*,int,void*))
		dlsym (RTLD_NEXT, "__kmpc_end_critical");
	INC_IF_NOT_NULL(__kmpc_end_critical_real,count);

	/* Obtain @ for __kmpc_dispatch_next_4 */
	__kmpc_dispatch_next_4_real =
		(int(*)(void*,int,int*,int*,int*,int*))
		dlsym (RTLD_NEXT, "__kmpc_dispatch_next_4");
	INC_IF_NOT_NULL(__kmpc_dispatch_next_4_real,count);

	/* Obtain @ for __kmpc_dispatch_next_8 */
	__kmpc_dispatch_next_8_real =
		(int(*)(void*,int,int*,long long *,long long *, long long *))
		dlsym (RTLD_NEXT, "__kmpc_dispatch_next_8");
	INC_IF_NOT_NULL(__kmpc_dispatch_next_8_real,count);

	/* Obtain @ for __kmpc_dispatch_next_8 */
	__kmpc_single_real =
		(int(*)(void*,int)) dlsym (RTLD_NEXT, "__kmpc_single");
	INC_IF_NOT_NULL(__kmpc_single_real,count);

	/* Obtain @ for __kmpc_dispatch_next_8 */
	__kmpc_end_single_real =
		(void(*)(void*,int)) dlsym (RTLD_NEXT, "__kmpc_end_single");
	INC_IF_NOT_NULL(__kmpc_end_single_real,count);

	/* Obtain @ for __kmpc_dispatch_init_4 */
	__kmpc_dispatch_init_4_real =
		(void(*)(void*,int,int,int,int,int,int)) dlsym (RTLD_NEXT, "__kmpc_dispatch_init_4");
	INC_IF_NOT_NULL(__kmpc_dispatch_init_4_real,count);

	/* Obtain @ for __kmpc_dispatch_init_8 */
	__kmpc_dispatch_init_8_real =
		(void(*)(void*,int,int,long long,long long,long long,long long)) dlsym (RTLD_NEXT, "__kmpc_dispatch_init_8");
	INC_IF_NOT_NULL(__kmpc_dispatch_init_8_real,count);

	/* Obtain @ for __kmpc_dispatch_fini_4 */
	__kmpc_dispatch_fini_4_real =
		(void(*)(void*,int)) dlsym (RTLD_NEXT, "__kmpc_dispatch_fini_4");
	INC_IF_NOT_NULL(__kmpc_dispatch_fini_4_real,count);

	/* Obtain @ for __kmpc_dispatch_fini_8 */
	__kmpc_dispatch_fini_8_real =
		(void(*)(void*,long long)) dlsym (RTLD_NEXT, "__kmpc_dispatch_fini_8");
	INC_IF_NOT_NULL(__kmpc_dispatch_fini_8_real,count);

	/* Obtain @ for __kmpc_omp_task_alloc */
	__kmpc_omp_task_alloc_real =
		(void*(*)(void*,int,int,size_t,size_t,void*)) dlsym (RTLD_NEXT, "__kmpc_omp_task_alloc");
	INC_IF_NOT_NULL(__kmpc_omp_task_alloc_real, count);

	/* Obtain @ for __kmpc_omp_task_begin_if0 */
	__kmpc_omp_task_begin_if0_real =
		(void(*)(void*,int,void*)) dlsym (RTLD_NEXT, "__kmpc_omp_task_begin_if0");
	INC_IF_NOT_NULL(__kmpc_omp_task_begin_if0_real, count);

	/* Obtain @ for __kmpc_omp_task_complete_if0 */
	__kmpc_omp_task_complete_if0_real =
		(void(*)(void*,int,void*)) dlsym (RTLD_NEXT, "__kmpc_omp_task_complete_if0");
	INC_IF_NOT_NULL(__kmpc_omp_task_complete_if0_real, count);

	/* Obtain @ for __kmpc_omp_taskwait */
	__kmpc_omp_taskwait_real = (int(*)(void*,int)) dlsym (RTLD_NEXT, "__kmpc_omp_taskwait");
	INC_IF_NOT_NULL(__kmpc_omp_taskwait_real, count);

	/* Obtain @ for ompc_set_num_threads */
	ompc_set_num_threads_real =
		(void(*)(int)) dlsym (RTLD_NEXT, "ompc_set_num_threads");
	INC_IF_NOT_NULL(ompc_set_num_threads_real, count);

	/* Any hook point? */
	return count > 0;
}
예제 #2
0
static int ibm_xlsmp_1_6_GetOpenMPHookPoints (int rank)
{
	int count = 0;

	UNREFERENCED_PARAMETER(rank)

	/* Obtain @ for _xlsmpParallelDoSetup_TPO */
	_xlsmpParallelDoSetup_TPO_real =
		(void(*)(int,void**,long,long,long,long,void**,void**,void**,long,long,void**,long))
		dlsym (RTLD_NEXT, "_xlsmpParallelDoSetup_TPO");
	INC_IF_NOT_NULL(_xlsmpParallelDoSetup_TPO_real,count);

	/* Obtain @ for _xlsmpParRegionSetup_TPO */
	_xlsmpParRegionSetup_TPO_real =
		(void(*)(int,void*,int,void*,void*,void**,long,long))
		dlsym (RTLD_NEXT, "_xlsmpParRegionSetup_TPO");
	INC_IF_NOT_NULL(_xlsmpParRegionSetup_TPO_real,count);

	/* Obtain @ for _xlsmpWSDoSetup_TPO */
	_xlsmpWSDoSetup_TPO_real =
		(void(*)(int,void*,long,long,long,long,void*,void*,void**,long))
		dlsym (RTLD_NEXT, "_xlsmpWSDoSetup_TPO");
	INC_IF_NOT_NULL(_xlsmpWSDoSetup_TPO_real,count);

	/* Obtain @ for _xlsmpWSSectSetup_TPO */
	_xlsmpWSSectSetup_TPO_real =
		(void(*)(int,void*,long,void*,void*,void**,long,long))
		dlsym (RTLD_NEXT, "_xlsmpWSSectSetup_TPO");
	INC_IF_NOT_NULL(_xlsmpWSSectSetup_TPO_real,count);

	/* Obtain @ for _xlsmpSingleSetup_TPO */
	_xlsmpSingleSetup_TPO_real =
		(void(*)(int,void*,int,void*)) dlsym (RTLD_NEXT, "_xlsmpSingleSetup_TPO");
	INC_IF_NOT_NULL(_xlsmpSingleSetup_TPO_real,count);

	/* Obtain @ for _xlsmpBarrier_TPO */
	_xlsmpBarrier_TPO_real =
		(void(*)(int,int*)) dlsym (RTLD_NEXT, "_xlsmpBarrier_TPO");
	INC_IF_NOT_NULL(_xlsmpBarrier_TPO_real,count);

	/* Obtain @ for _xlsmpGetDefaultSLock */
	_xlsmpGetDefaultSLock_real =
		(void(*)(void*)) dlsym (RTLD_NEXT, "_xlsmpGetDefaultSLock");
	INC_IF_NOT_NULL(_xlsmpGetDefaultSLock_real,count);

	/* Obtain @ for _xlsmpRelDefaultSLock */
	_xlsmpRelDefaultSLock_real =
		(void(*)(void*)) dlsym (RTLD_NEXT, "_xlsmpRelDefaultSLock");
	INC_IF_NOT_NULL(_xlsmpRelDefaultSLock_real,count);

	/* Obtain @ for _xlsmpGetSLock */
	_xlsmpGetSLock_real =
		(void(*)(void*)) dlsym (RTLD_NEXT, "_xlsmpGetSLock");
	INC_IF_NOT_NULL(_xlsmpGetSLock_real,count);

	/* Obtain @ for _xlsmpRelSLock */
	_xlsmpRelSLock_real =
		(void(*)(void*)) dlsym (RTLD_NEXT, "_xlsmpRelSLock");
	INC_IF_NOT_NULL(_xlsmpRelSLock_real,count);

	/* Any hook point? */
	return count > 0;
}