Exemplo n.º 1
0
int handleDefact( void *fcb, int activitytoken,
		const char *activityname ) {


	OTF_Writer_writeDefFunctionGroup( ((fcbT*)fcb)->writer, 0,
		activitytoken + 1, activityname );

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


	fcbT *fcb;
	streaminfoT* si;
	
	if( 0 != streamid ) {

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

		assert( 0 );
		
		return OTF_RETURN_ABORT;

	} else {

		fcb = ((fcbT*) fcbx);
		si = hash_search( fcb->hash, streamid );
		
		/* allocate new memory if necessary */
		if ( si->nfunctiongroups >= si->sfunctiongroups )
		{
			si->sfunctiongroups = ( si->sfunctiongroups > 0 )
				? ( 2* si->sfunctiongroups ) : 10;
			si->functiongroups = (functiongroupT*) realloc( si->functiongroups,
				si->sfunctiongroups * sizeof(functiongroupT) );
				
			assert( NULL != si->functiongroups );
		}
	
		/* insert all data about the function */
		si->functiongroups[si->nfunctiongroups].deftoken = deftoken;
		si->functiongroups[si->nfunctiongroups].name = strdup( name );
	
		++(si->nfunctiongroups);
		
		return ( 0 == OTF_Writer_writeDefFunctionGroup( fcb->writer, streamid,
			deftoken, name ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;

	}
}
Exemplo n.º 3
0
int handleDefFunctionGroup (void *userData, uint32_t stream, uint32_t funcGroup, const char *name) {

    return ( 0 == OTF_Writer_writeDefFunctionGroup ( (OTF_Writer*) userData, stream, funcGroup, name) )
           ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}