Exemplo n.º 1
0
int handleDefsamp( void *fcb, int sampletoken, int sampleclasstoken,
		int iscpugrpsamp, unsigned int cpuorcpugrpid, int valuetype,
		const void *valuebounds, int dodifferentiation,
		int datarephint, const char *samplename, const char *sampleunit ) {


	/* default setting */
	uint32_t properties;

	static int first= 1;

	if ( 1 == first ) {
	
		first = 0;

		/* temporarily disabled */
		/*
		fprintf( stderr, "translation of performance counter "
			"definitions not fully supported\n" );
		*/
	}
		
	if ( datarephint == VTF3_DATAREPHINT_SAMPLE ) {
		
		properties = OTF_COUNTER_SCOPE_START;

	} else if ( datarephint == VTF3_DATAREPHINT_BEFORE ) {
		
		properties = OTF_COUNTER_SCOPE_LAST;

	} else {
	
		properties = OTF_COUNTER_SCOPE_START; /* standard value */
		
		fprintf( stderr, "vtf2otf: in %s: counter type not yet supported,"
			"might not be translated correctly!!!\n", __PRETTY_FUNCTION__ );
	}

	if ( dodifferentiation ) {
	
		properties |= OTF_COUNTER_TYPE_ACC;

	} else {

		properties |= OTF_COUNTER_TYPE_ABS;
	}

	OTF_Writer_writeDefCounter( ((fcbT*)fcb)->writer, 0, sampletoken + 1,
		samplename, properties, sampleclasstoken + 1, sampleunit );

	return 0;
}
Exemplo n.º 2
0
int handleDefCounter( void* fcbx, uint32_t streamid,
		uint32_t deftoken, const char* name, uint32_t properties, 
		uint32_t countergroup, const char* unit ) {


	if( 0 != streamid ) {

		fprintf( stderr, "ERROR: cannot merge traces with local definitions. aborting\n" );

		assert( 0 );
		
		return OTF_RETURN_ABORT;

	} else {

		return ( 0 == OTF_Writer_writeDefCounter( ((fcbT*) fcbx)->writer, streamid,
			deftoken, name, properties, countergroup, unit ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;

	}
}
Exemplo n.º 3
0
int handleDefCounter (void *userData, uint32_t stream, uint32_t counter, const char *name, uint32_t properties, uint32_t counterGroup, const char *unit) {

    return ( 0 == OTF_Writer_writeDefCounter ( (OTF_Writer*) userData, stream, counter, name, properties,
             counterGroup, unit) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}