Ejemplo n.º 1
0
void process_process_data(void)
{
	if (!perf_events)
		return;

	clear_processes();
	clear_interrupts();

	all_power.erase(all_power.begin(), all_power.end());
	clear_consumers();


	cpu_credit.resize(0, 0);
	cpu_credit.resize(get_max_cpu()+1, 0);
	cpu_level.resize(0, 0);
	cpu_level.resize(get_max_cpu()+1, 0);
	cpu_blame.resize(0, NULL);
	cpu_blame.resize(get_max_cpu()+1, NULL);



	/* process data */
	perf_events->process();
	perf_events->clear();

	run_devpower_list();

	merge_processes();

	all_processes_to_all_power();
	all_interrupts_to_all_power();
	all_timers_to_all_power();
	all_work_to_all_power();
	all_devices_to_all_power();

	sort(all_power.begin(), all_power.end(), power_cpu_sort);
}
Ejemplo n.º 2
0
 WorkStealingScheduler(int task_queue_size, int init_task_list_size)
 {
     fStaticNumThreads = get_max_cpu();
     fDynamicNumThreads = getenv("OMP_NUM_THREADS") ? atoi(getenv("OMP_NUM_THREADS")) : fStaticNumThreads;
     
     fThreadPool = new DSPThreadPool(fStaticNumThreads);
     fTaskGraph = new TaskGraph(task_queue_size);
     fTaskQueueList = new TaskQueue[fStaticNumThreads];
     for (int i = 0; i < fStaticNumThreads; i++) {
         fTaskQueueList[i].Init(task_queue_size);
     }
     
     fReadyTaskListSize = init_task_list_size;
     fReadyTaskList = new int[fReadyTaskListSize];
     fReadyTaskListIndex = 0;
 }