int _papi_hwd_init(hwd_context_t *context)
{
  hwd_control_state_t *machdep = &context->start;
  
  /* Initialize our global machdep. */

  if ((machdep->self = pmc_dev = pmc_open()) == NULL) 
    return(PAPI_ESYS);

  /* Initialize the event fields */

  init_config(&context->start);

  return(PAPI_OK);
}
Exemple #2
0
int
_papi_hwd_init( hwd_context_t * ctx )
{
	/* Initialize our thread/process pointer. */
	if ( ( ctx->self = pmc_dev = pmc_open(  ) ) == NULL ) {
		PAPIERROR( "pmc_open() returned NULL" );
		return ( PAPI_ESYS );
	}
	SUBDBG( "_papi_hwd_init pmc_open() = %p\n", ctx->self );

	/* Linux makes sure that each thread has a virtualized TSC here.
	   This makes no sense on Windows, since the counters aren't
	   saved at context switch. */
	return ( PAPI_OK );
}