Lines Matching refs:work

264 	struct kwork_work *work;  in work_search()  local
268 work = container_of(node, struct kwork_work, node); in work_search()
269 cmp = work_cmp(sort_list, key, work); in work_search()
275 if (work->name == NULL) in work_search()
276 work->name = key->name; in work_search()
277 return work; in work_search()
311 struct kwork_work *work = zalloc(sizeof(*work)); in work_new() local
313 if (work == NULL) { in work_new()
319 INIT_LIST_HEAD(&work->atom_list[i]); in work_new()
321 work->id = key->id; in work_new()
322 work->cpu = key->cpu; in work_new()
323 work->name = key->name; in work_new()
324 work->class = key->class; in work_new()
325 return work; in work_new()
332 struct kwork_work *work = work_search(root, key, sort_list); in work_findnew() local
334 if (work != NULL) in work_findnew()
335 return work; in work_findnew()
337 work = work_new(key); in work_findnew()
338 if (work) in work_findnew()
339 work_insert(root, work, sort_list); in work_findnew()
341 return work; in work_findnew()
358 struct kwork_work *work, in profile_event_match() argument
361 int cpu = work->cpu; in profile_event_match()
373 (work->name != NULL) && in profile_event_match()
374 (strcmp(work->name, kwork->profile_name) != 0)) in profile_event_match()
391 struct kwork_work *work, key; in work_push_atom() local
400 work = work_findnew(&class->work_root, &key, &kwork->cmp_id); in work_push_atom()
401 if (work == NULL) { in work_push_atom()
406 if (!profile_event_match(kwork, work, sample)) in work_push_atom()
410 dst_atom = list_last_entry_or_null(&work->atom_list[dst_type], in work_push_atom()
419 *ret_work = work; in work_push_atom()
421 list_add_tail(&atom->list, &work->atom_list[src_type]); in work_push_atom()
436 struct kwork_work *work, key; in work_pop_atom() local
441 work = work_findnew(&class->work_root, &key, &kwork->cmp_id); in work_pop_atom()
443 *ret_work = work; in work_pop_atom()
445 if (work == NULL) in work_pop_atom()
448 if (!profile_event_match(kwork, work, sample)) in work_pop_atom()
451 atom = list_last_entry_or_null(&work->atom_list[dst_type], in work_pop_atom()
458 list_add_tail(&src_atom->list, &work->atom_list[src_type]); in work_pop_atom()
467 static void report_update_exit_event(struct kwork_work *work, in report_update_exit_event() argument
477 if ((delta > work->max_runtime) || in report_update_exit_event()
478 (work->max_runtime == 0)) { in report_update_exit_event()
479 work->max_runtime = delta; in report_update_exit_event()
480 work->max_runtime_start = entry_time; in report_update_exit_event()
481 work->max_runtime_end = exit_time; in report_update_exit_event()
483 work->total_runtime += delta; in report_update_exit_event()
484 work->nr_atoms++; in report_update_exit_event()
506 struct kwork_work *work = NULL; in report_exit_event() local
510 machine, &work); in report_exit_event()
511 if (work == NULL) in report_exit_event()
515 report_update_exit_event(work, atom, sample); in report_exit_event()
522 static void latency_update_entry_event(struct kwork_work *work, in latency_update_entry_event() argument
532 if ((delta > work->max_latency) || in latency_update_entry_event()
533 (work->max_latency == 0)) { in latency_update_entry_event()
534 work->max_latency = delta; in latency_update_entry_event()
535 work->max_latency_start = raise_time; in latency_update_entry_event()
536 work->max_latency_end = entry_time; in latency_update_entry_event()
538 work->total_latency += delta; in latency_update_entry_event()
539 work->nr_atoms++; in latency_update_entry_event()
561 struct kwork_work *work = NULL; in latency_entry_event() local
565 machine, &work); in latency_entry_event()
566 if (work == NULL) in latency_entry_event()
570 latency_update_entry_event(work, atom, sample); in latency_entry_event()
625 struct kwork_work *work, in timehist_print_event() argument
650 printf(" [%0*d] ", PRINT_CPU_WIDTH, work->cpu); in timehist_print_event()
655 if (work->class && work->class->work_name) { in timehist_print_event()
656 work->class->work_name(work, kwork_name, in timehist_print_event()
712 struct kwork_work *work = NULL; in timehist_entry_event() local
716 machine, &work); in timehist_entry_event()
720 if (work != NULL) in timehist_entry_event()
733 struct kwork_work *work = NULL; in timehist_exit_event() local
743 machine, &work); in timehist_exit_event()
744 if (work == NULL) in timehist_exit_event()
748 work->nr_atoms++; in timehist_exit_event()
749 timehist_print_event(kwork, work, atom, sample, &al); in timehist_exit_event()
801 struct kwork_work *work, in irq_work_init() argument
806 work->class = class; in irq_work_init()
807 work->cpu = sample->cpu; in irq_work_init()
808 work->id = evsel__intval(evsel, sample, "irq"); in irq_work_init()
809 work->name = evsel__strval(evsel, sample, "name"); in irq_work_init()
812 static void irq_work_name(struct kwork_work *work, char *buf, int len) in irq_work_name() argument
814 snprintf(buf, len, "%s:%" PRIu64 "", work->name, work->id); in irq_work_name()
920 struct kwork_work *work, in softirq_work_init() argument
927 work->id = num; in softirq_work_init()
928 work->class = class; in softirq_work_init()
929 work->cpu = sample->cpu; in softirq_work_init()
930 work->name = evsel__softirq_name(evsel, num); in softirq_work_init()
933 static void softirq_work_name(struct kwork_work *work, char *buf, int len) in softirq_work_name() argument
935 snprintf(buf, len, "(s)%s:%" PRIu64 "", work->name, work->id); in softirq_work_name()
1011 struct kwork_work *work, in workqueue_work_init() argument
1020 work->class = class; in workqueue_work_init()
1021 work->cpu = sample->cpu; in workqueue_work_init()
1022 work->id = evsel__intval(evsel, sample, "work"); in workqueue_work_init()
1023 work->name = function_addr == 0 ? NULL : in workqueue_work_init()
1027 static void workqueue_work_name(struct kwork_work *work, char *buf, int len) in workqueue_work_name() argument
1029 if (work->name != NULL) in workqueue_work_name()
1030 snprintf(buf, len, "(w)%s", work->name); in workqueue_work_name()
1032 snprintf(buf, len, "(w)0x%" PRIx64, work->id); in workqueue_work_name()
1056 static int report_print_work(struct perf_kwork *kwork, struct kwork_work *work) in report_print_work() argument
1068 if (work->class && work->class->work_name) { in report_print_work()
1069 work->class->work_name(work, kwork_name, in report_print_work()
1079 ret += printf(" %0*d |", PRINT_CPU_WIDTH, work->cpu); in report_print_work()
1087 (double)work->total_runtime / NSEC_PER_MSEC); in report_print_work()
1091 (double)work->total_latency / in report_print_work()
1092 work->nr_atoms / NSEC_PER_MSEC); in report_print_work()
1098 ret += printf(" %*" PRIu64 " |", PRINT_COUNT_WIDTH, work->nr_atoms); in report_print_work()
1104 timestamp__scnprintf_usec(work->max_runtime_start, in report_print_work()
1107 timestamp__scnprintf_usec(work->max_runtime_end, in report_print_work()
1112 (double)work->max_runtime / NSEC_PER_MSEC, in report_print_work()
1120 timestamp__scnprintf_usec(work->max_latency_start, in report_print_work()
1123 timestamp__scnprintf_usec(work->max_latency_end, in report_print_work()
1128 (double)work->max_latency / NSEC_PER_MSEC, in report_print_work()
1418 struct kwork_work *work) in process_skipped_events() argument
1424 count = nr_list_entry(&work->atom_list[i]); in process_skipped_events()
1434 struct kwork_work *work = NULL; in perf_kwork_add_work() local
1436 work = work_new(key); in perf_kwork_add_work()
1437 if (work == NULL) in perf_kwork_add_work()
1440 work_insert(&class->work_root, work, &kwork->cmp_id); in perf_kwork_add_work()
1441 return work; in perf_kwork_add_work()
1486 struct kwork_work *work; in perf_kwork__report() local
1503 work = rb_entry(next, struct kwork_work, node); in perf_kwork__report()
1504 process_skipped_events(kwork, work); in perf_kwork__report()
1506 if (work->nr_atoms != 0) { in perf_kwork__report()
1507 report_print_work(kwork, work); in perf_kwork__report()
1509 kwork->all_runtime += work->total_runtime; in perf_kwork__report()
1510 kwork->all_count += work->nr_atoms; in perf_kwork__report()