Example #1
0
int
_perfctr_shutdown_thread( hwd_context_t * ctx )
{
#ifdef DEBUG
	int retval = vperfctr_unlink( ctx->perfctr );
	SUBDBG( "_papi_hwd_shutdown vperfctr_unlink(%p) = %d\n", ctx->perfctr,
			retval );
#else
	vperfctr_unlink( ctx->perfctr );
#endif
	vperfctr_close( ctx->perfctr );
	SUBDBG( "_perfctr_shutdown vperfctr_close(%p)\n", ctx->perfctr );
	memset( ctx, 0x0, sizeof ( hwd_context_t ) );
	return ( PAPI_OK );
}
Example #2
0
/* This routine is for shutting down threads, including the
   master thread. */
int
_papi_hwd_shutdown( hwd_context_t * ctx )
{
	int retval = vperfctr_unlink( ctx->perfctr );
	SUBDBG( "_papi_hwd_shutdown vperfctr_unlink(%p) = %d\n", ctx->perfctr,
			retval );
	vperfctr_close( ctx->perfctr );
	SUBDBG( "_papi_hwd_shutdown vperfctr_close(%p)\n", ctx->perfctr );
	memset( ctx, 0x0, sizeof ( hwd_context_t ) );

	if ( retval )
		return ( PAPI_ESYS );
	return ( PAPI_OK );
}
Example #3
0
static int do_vperfctr_unlink(struct vperfctr *perfctr, struct task_struct *tsk)
{
	if (tsk)
		vperfctr_unlink(tsk, perfctr, 1);
	return 0;
}
Example #4
0
void __vperfctr_exit(struct vperfctr *perfctr)
{
	vperfctr_unlink(current, perfctr, 0);
}