Example #1
0
JNIEXPORT void JNICALL Java_es_bsc_cepbatools_extrae_Wrapper_Comm (JNIEnv *env,
	jclass jc, jboolean send, jint tag, jint size, jint partner, jlong id)
{
	struct extrae_UserCommunication comm;
	struct extrae_CombinedEvents events;

	UNREFERENCED(env);
	UNREFERENCED(jc);

 	Extrae_init_UserCommunication(&comm);
	Extrae_init_CombinedEvents(&events);

	if(send)
		comm.type = EXTRAE_USER_SEND;
	else
		comm.type = EXTRAE_USER_RECV;

	comm.tag=tag;
	comm.size=size;
	comm.partner=partner;
	comm.id=id;

	events.nCommunications=1;	
	events.Communications=&comm;	
	events.nEvents=0;

	Extrae_emit_CombinedEvents(&events);
}
void * Task0(void *param)
{
	struct extrae_CombinedEvents events;
	struct extrae_UserCommunication comm;
	extrae_type_t types[2] = { 123456, 123457 } ;
	extrae_value_t values[2] = { 1, 2 };

	Extrae_init_UserCommunication (&comm);
	comm.type = EXTRAE_USER_SEND;
	comm.partner = 0;
	comm.tag = 1234;
	comm.size = 1024;
	comm.id = 0xdeadbeef;

	Extrae_init_CombinedEvents (&events);
	events.nCommunications = 1;
	events.Communications = &comm;
	events.nEvents = 2;
	events.Types = types;
	events.Values = values;

	Extrae_emit_CombinedEvents (&events);
}