Пример #1
0
void WriteEnabled_pthread_Operations (FILE * fd)
{
	unsigned u;
	int anypresent = FALSE;
#if defined(HAVE_BFD)
	int createpresent = FALSE;
#endif

	for (u = 0; u < MAX_PTHREAD_TYPE_ENTRIES; u++)
	{
		anypresent = anypresent || pthread_event_presency_label[u].present;
#if defined(HAVE_BFD)
		if (pthread_event_presency_label[u].eventtype == PTHREAD_CREATE_EV)
			createpresent = TRUE;
#endif
	}

	if (anypresent)
	{

		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "%d    %d    %s\n", 0, PTHREAD_BASE_EV, "pthread call");
		fprintf (fd, "VALUES\n");
		fprintf (fd, "0 Outside pthread call\n");
		for (u = 0; u < MAX_PTHREAD_TYPE_ENTRIES; u++)
			if (pthread_event_presency_label[u].present)
				fprintf (fd, "%d %s\n", 
					pthread_event_presency_label[u].eventval,
					pthread_event_presency_label[u].description);
		LET_SPACES(fd);
	}

#if defined(HAVE_BFD)
	/* Hey, pthread & OpenMP share the same labels? */
	if (createpresent)
		Address2Info_Write_OMP_Labels (fd, PTHREAD_FUNC_EV, "pthread function",
			PTHREAD_FUNC_LINE_EV, "pthread function line and file",
			get_option_merge_UniqueCallerID());
#endif
}
Пример #2
0
void OMPEvent_WriteEnabledOperations (FILE * fd)
{
	if (inuse[JOIN_OMP_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d  OpenMP Worksharing join\n", JOIN_EV);
		fprintf (fd, "VALUES\n"
		             "0 End\n"
		             "%d Join (w wait)\n"
		             "%d Join (w/o wait)\n\n",
		             JOIN_WAIT_VAL, JOIN_NOWAIT_VAL);
	}
	if (inuse[WRK_OMP_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d  OpenMP Worksharing work dispatcher\n", WORK_EV);
		fprintf (fd, "VALUES\n"
		             "0 End\n"
		             "1 Begin\n\n");
	}
	if (inuse[PAR_OMP_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d  Parallel (OMP)\n", PAR_EV);
		fprintf (fd, "VALUES\n"
		             "0 close\n"
		             "1 DO (open)\n"
		             "2 SECTIONS (open)\n"
		             "3 REGION (open)\n\n");
	}
	if (inuse[WSH_OMP_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d Worksharing (OMP)\n", WSH_EV);
		fprintf (fd, "VALUES\n"
		             "0 End\n"
		             "4 DO \n"
		             "5 SECTIONS\n"
		             "6 SINGLE\n\n");
	}
#if defined(HAVE_BFD)
	if (inuse[FNC_OMP_INDEX])
	{
		Address2Info_Write_OMP_Labels (fd, OMPFUNC_EV, "Executed OpenMP parallel function",
			OMPFUNC_LINE_EV, "Executed OpenMP parallel function line and file",
			get_option_merge_UniqueCallerID());
		Address2Info_Write_OMP_Labels (fd, TASKFUNC_EV, "Executed OpenMP task function",
			TASKFUNC_LINE_EV, "Executed OpenMP task function line and file",
			get_option_merge_UniqueCallerID());
		Address2Info_Write_OMP_Labels (fd, TASKFUNC_INST_EV, "Instantiated OpenMP task function",
			TASKFUNC_INST_LINE_EV, "Instantiated OpenMP task function line and file",
			get_option_merge_UniqueCallerID());
	}
#endif
	if (inuse[LCK_OMP_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d OpenMP named-Lock\n", NAMEDCRIT_EV);
		fprintf (fd, "VALUES\n"
		             "%d Unlocked status\n"
		             "%d Lock\n"
		             "%d Unlock\n"
		             "%d Locked status\n\n",
		             UNLOCKED_VAL, LOCK_VAL, UNLOCK_VAL, LOCKED_VAL);

		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d OpenMP named-Lock address name\n", NAMEDCRIT_NAME_EV);
	}
	if (inuse[ULCK_OMP_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d OpenMP unnamed-Lock\n", UNNAMEDCRIT_EV);
		fprintf (fd, "VALUES\n"
		             "%d Unlocked status\n"
		             "%d Lock\n"
		             "%d Unlock\n"
		             "%d Locked status\n\n",
		             UNLOCKED_VAL, LOCK_VAL, UNLOCK_VAL, LOCKED_VAL);
	}
	if (inuse[BARRIER_OMP_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d OpenMP barrier\n", BARRIEROMP_EV);
		fprintf (fd, "VALUES\n0 End\n1 Begin\n");
	}
	if (inuse[GETSETNUMTHREADS_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d OpenMP set num threads\n", OMPSETNUMTHREADS_EV);
		fprintf (fd, "0 %d OpenMP get num threads\n", OMPGETNUMTHREADS_EV);
		fprintf (fd, "VALUES\n"
		             "0 End\n"
		             "1 Begin\n");
	}
	if (inuse[TASKWAIT_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d OMP taskwait\n", TASKWAIT_EV);
		fprintf (fd, "VALUES\n0 End\n1 Begin\n\n");
	}
	if (inuse[TASKLOOP_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n"
		  "0 %d Taskloop Identifier\n\n",
		  TASKLOOPID_EV);

		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d OMP taskloop\n", TASKLOOP_EV);
		fprintf (fd, "VALUES\n0 End\n1 Begin\n\n");
	}
	if (inuse[ORDERED_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n");
		fprintf (fd, "0 %d OpenMP ordered section\n", ORDERED_EV);
		fprintf (fd, "VALUES\n"
						     "%d Outside ordered\n"
						     "%d Waiting to enter\n"
						     "%d Signaling the exit\n"
						     "%d Inside ordered\n\n",
						     OUTORDERED_VAL, WAITORDERED_VAL, POSTORDERED_VAL, INORDERED_VAL);
	}
	if (inuse[OMPT_CRITICAL_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n"
		             "0 %d OMP critical\n"
		             "VALUES\n0 End\n1 Begin\n\n",
		         OMPT_CRITICAL_EV);
	}
	if (inuse[OMPT_ATOMIC_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n"
		             "0 %d OMP atomic\n"
		             "VALUES\n0 End\n1 Begin\n\n",
		         OMPT_ATOMIC_EV);
	}
	if (inuse[OMPT_LOOP_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n"
		             "0 %d OMP loop\n"
		             "VALUES\n0 End\n1 Begin\n\n",
		         OMPT_LOOP_EV);
	}
	if (inuse[OMPT_WORKSHARE_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n"
		             "0 %d OMP workshare\n"
		             "VALUES\n0 End\n1 Begin\n\n",
		         OMPT_WORKSHARE_EV);
	}
	if (inuse[OMPT_SECTIONS_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n"
		             "0 %d OMP sections\n"
		             "VALUES\n0 End\n1 Begin\n\n",
		         OMPT_SECTIONS_EV);
	}
	if (inuse[OMPT_SINGLE_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n"
		             "0 %d OMP single\n"
		             "VALUES\n0 End\n1 Begin\n\n",
		         OMPT_SINGLE_EV);
	}
	if (inuse[OMPT_MASTER_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n"
		             "0 %d OMP master\n"
		             "VALUES\n0 End\n1 Begin\n\n",
		         OMPT_MASTER_EV);
	}
	if (inuse[TASKGROUP_START_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n"
		  "0 %d Taskgroup calls\n"
		  "VALUES\n0 Outside\n1 Start\n2 End\n",
		  TASKGROUP_START_EV);
		fprintf (fd, "EVENT_TYPE\n"
		  "0 %d Within Taskgroup region\n"
		  "VALUES\n0 End\n1 Begin\n\n",
		  TASKGROUP_INGROUP_DEEP_EV);
	}
	if (inuse[TASK_INDEX])
	{
		fprintf (fd, "EVENT_TYPE\n"
		  "0 %d Task Identifier\n\n",
		  TASKID_EV);
	}
	if (inuse[OMP_STATS_INDEX])
	{
		fprintf (fd,
		  "EVENT_TYPE\n"
		  "0 %d Number of OpenMP instantiated tasks\n"
		  "0 %d Number of OpenMP executed tasks\n\n",
		OMP_STATS_BASE+OMP_NUM_TASKS_INSTANTIATED,
		OMP_STATS_BASE+OMP_NUM_TASKS_EXECUTED);
	}
}