• Home
  • Raw
  • Download

Lines Matching refs:task

242 get_new_event(struct task_desc *task, u64 timestamp)  in get_new_event()  argument
245 unsigned long idx = task->nr_events; in get_new_event()
251 task->nr_events++; in get_new_event()
252 size = sizeof(struct sched_atom *) * task->nr_events; in get_new_event()
253 task->atoms = realloc(task->atoms, size); in get_new_event()
254 BUG_ON(!task->atoms); in get_new_event()
256 task->atoms[idx] = event; in get_new_event()
261 static struct sched_atom *last_event(struct task_desc *task) in last_event() argument
263 if (!task->nr_events) in last_event()
266 return task->atoms[task->nr_events - 1]; in last_event()
269 static void add_sched_event_run(struct perf_sched *sched, struct task_desc *task, in add_sched_event_run() argument
272 struct sched_atom *event, *curr_event = last_event(task); in add_sched_event_run()
284 event = get_new_event(task, timestamp); in add_sched_event_run()
292 static void add_sched_event_wakeup(struct perf_sched *sched, struct task_desc *task, in add_sched_event_wakeup() argument
297 event = get_new_event(task, timestamp); in add_sched_event_wakeup()
319 static void add_sched_event_sleep(struct perf_sched *sched, struct task_desc *task, in add_sched_event_sleep() argument
322 struct sched_atom *event = get_new_event(task, timestamp); in add_sched_event_sleep()
332 struct task_desc *task; in register_pid() local
347 task = sched->pid_to_task[pid]; in register_pid()
349 if (task) in register_pid()
350 return task; in register_pid()
352 task = zalloc(sizeof(*task)); in register_pid()
353 task->pid = pid; in register_pid()
354 task->nr = sched->nr_tasks; in register_pid()
355 strcpy(task->comm, comm); in register_pid()
360 add_sched_event_sleep(sched, task, 0, 0); in register_pid()
362 sched->pid_to_task[pid] = task; in register_pid()
366 sched->tasks[task->nr] = task; in register_pid()
371 return task; in register_pid()
377 struct task_desc *task; in print_task_traces() local
381 task = sched->tasks[i]; in print_task_traces()
383 task->nr, task->comm, task->pid, task->nr_events); in print_task_traces()
497 struct task_desc *task; member
505 struct task_desc *this_task = parms->task; in thread_func()
548 struct task_desc *task; in create_tasks() local
565 parms->task = task = sched->tasks[i]; in create_tasks()
568 sem_init(&task->sleep_sem, 0, 0); in create_tasks()
569 sem_init(&task->ready_for_work, 0, 0); in create_tasks()
570 sem_init(&task->work_done_sem, 0, 0); in create_tasks()
571 task->curr_event = 0; in create_tasks()
572 err = pthread_create(&task->thread, &attr, thread_func, parms); in create_tasks()
580 struct task_desc *task; in wait_for_tasks() local
588 task = sched->tasks[i]; in wait_for_tasks()
589 ret = sem_wait(&task->ready_for_work); in wait_for_tasks()
591 sem_init(&task->ready_for_work, 0, 0); in wait_for_tasks()
601 task = sched->tasks[i]; in wait_for_tasks()
602 ret = sem_wait(&task->work_done_sem); in wait_for_tasks()
604 sem_init(&task->work_done_sem, 0, 0); in wait_for_tasks()
605 sched->cpu_usage += task->cpu_usage; in wait_for_tasks()
606 task->cpu_usage = 0; in wait_for_tasks()
624 task = sched->tasks[i]; in wait_for_tasks()
625 sem_init(&task->sleep_sem, 0, 0); in wait_for_tasks()
626 task->curr_event = 0; in wait_for_tasks()