Lines Matching full:work
271 struct kwork_work *work; in work_search() local
275 work = container_of(node, struct kwork_work, node); in work_search()
276 cmp = work_cmp(sort_list, key, work); in work_search()
282 if (work->name == NULL) in work_search()
283 work->name = key->name; in work_search()
284 return work; in work_search()
318 struct kwork_work *work = zalloc(sizeof(*work)); in work_new() local
320 if (work == NULL) { in work_new()
321 pr_err("Failed to zalloc kwork work\n"); in work_new()
326 INIT_LIST_HEAD(&work->atom_list[i]); in work_new()
328 work->id = key->id; in work_new()
329 work->cpu = key->cpu; in work_new()
330 work->name = key->name; in work_new()
331 work->class = key->class; in work_new()
332 return work; in work_new()
339 struct kwork_work *work = work_search(root, key, sort_list); in work_findnew() local
341 if (work != NULL) in work_findnew()
342 return work; in work_findnew()
344 work = work_new(key); in work_findnew()
345 if (work) in work_findnew()
346 work_insert(root, work, sort_list); in work_findnew()
348 return work; in work_findnew()
365 struct kwork_work *work, in profile_event_match() argument
368 int cpu = work->cpu; in profile_event_match()
380 (work->name != NULL) && in profile_event_match()
381 (strcmp(work->name, kwork->profile_name) != 0)) in profile_event_match()
398 struct kwork_work *work, key; in work_push_atom() local
407 work = work_findnew(&class->work_root, &key, &kwork->cmp_id); in work_push_atom()
408 if (work == NULL) { in work_push_atom()
413 if (!profile_event_match(kwork, work, sample)) in work_push_atom()
417 dst_atom = list_last_entry_or_null(&work->atom_list[dst_type], in work_push_atom()
426 *ret_work = work; in work_push_atom()
428 list_add_tail(&atom->list, &work->atom_list[src_type]); in work_push_atom()
443 struct kwork_work *work, key; in work_pop_atom() local
448 work = work_findnew(&class->work_root, &key, &kwork->cmp_id); in work_pop_atom()
450 *ret_work = work; in work_pop_atom()
452 if (work == NULL) in work_pop_atom()
455 if (!profile_event_match(kwork, work, sample)) in work_pop_atom()
458 atom = list_last_entry_or_null(&work->atom_list[dst_type], in work_pop_atom()
465 list_add_tail(&src_atom->list, &work->atom_list[src_type]); in work_pop_atom()
474 static void report_update_exit_event(struct kwork_work *work, in report_update_exit_event() argument
484 if ((delta > work->max_runtime) || in report_update_exit_event()
485 (work->max_runtime == 0)) { in report_update_exit_event()
486 work->max_runtime = delta; in report_update_exit_event()
487 work->max_runtime_start = entry_time; in report_update_exit_event()
488 work->max_runtime_end = exit_time; in report_update_exit_event()
490 work->total_runtime += delta; in report_update_exit_event()
491 work->nr_atoms++; in report_update_exit_event()
513 struct kwork_work *work = NULL; in report_exit_event() local
517 machine, &work); in report_exit_event()
518 if (work == NULL) in report_exit_event()
522 report_update_exit_event(work, atom, sample); in report_exit_event()
529 static void latency_update_entry_event(struct kwork_work *work, in latency_update_entry_event() argument
539 if ((delta > work->max_latency) || in latency_update_entry_event()
540 (work->max_latency == 0)) { in latency_update_entry_event()
541 work->max_latency = delta; in latency_update_entry_event()
542 work->max_latency_start = raise_time; in latency_update_entry_event()
543 work->max_latency_end = entry_time; in latency_update_entry_event()
545 work->total_latency += delta; in latency_update_entry_event()
546 work->nr_atoms++; in latency_update_entry_event()
568 struct kwork_work *work = NULL; in latency_entry_event() local
572 machine, &work); in latency_entry_event()
573 if (work == NULL) in latency_entry_event()
577 latency_update_entry_event(work, atom, sample); in latency_entry_event()
634 struct kwork_work *work, in timehist_print_event() argument
659 printf(" [%0*d] ", PRINT_CPU_WIDTH, work->cpu); in timehist_print_event()
664 if (work->class && work->class->work_name) { in timehist_print_event()
665 work->class->work_name(work, kwork_name, in timehist_print_event()
727 struct kwork_work *work = NULL; in timehist_entry_event() local
731 machine, &work); in timehist_entry_event()
735 if (work != NULL) in timehist_entry_event()
748 struct kwork_work *work = NULL; in timehist_exit_event() local
761 machine, &work); in timehist_exit_event()
762 if (work == NULL) { in timehist_exit_event()
768 work->nr_atoms++; in timehist_exit_event()
769 timehist_print_event(kwork, work, atom, sample, &al); in timehist_exit_event()
823 struct kwork_work *work, in irq_work_init() argument
828 work->class = class; in irq_work_init()
829 work->cpu = sample->cpu; in irq_work_init()
830 work->id = evsel__intval(evsel, sample, "irq"); in irq_work_init()
831 work->name = evsel__strval(evsel, sample, "name"); in irq_work_init()
834 static void irq_work_name(struct kwork_work *work, char *buf, int len) in irq_work_name() argument
836 snprintf(buf, len, "%s:%" PRIu64 "", work->name, work->id); in irq_work_name()
942 struct kwork_work *work, in softirq_work_init() argument
949 work->id = num; in softirq_work_init()
950 work->class = class; in softirq_work_init()
951 work->cpu = sample->cpu; in softirq_work_init()
952 work->name = evsel__softirq_name(evsel, num); in softirq_work_init()
955 static void softirq_work_name(struct kwork_work *work, char *buf, int len) in softirq_work_name() argument
957 snprintf(buf, len, "(s)%s:%" PRIu64 "", work->name, work->id); in softirq_work_name()
1033 struct kwork_work *work, in workqueue_work_init() argument
1042 work->class = class; in workqueue_work_init()
1043 work->cpu = sample->cpu; in workqueue_work_init()
1044 work->id = evsel__intval(evsel, sample, "work"); in workqueue_work_init()
1045 work->name = function_addr == 0 ? NULL : in workqueue_work_init()
1049 static void workqueue_work_name(struct kwork_work *work, char *buf, int len) in workqueue_work_name() argument
1051 if (work->name != NULL) in workqueue_work_name()
1052 snprintf(buf, len, "(w)%s", work->name); in workqueue_work_name()
1054 snprintf(buf, len, "(w)0x%" PRIx64, work->id); in workqueue_work_name()
1078 static int report_print_work(struct perf_kwork *kwork, struct kwork_work *work) in report_print_work() argument
1090 if (work->class && work->class->work_name) { in report_print_work()
1091 work->class->work_name(work, kwork_name, in report_print_work()
1101 ret += printf(" %0*d |", PRINT_CPU_WIDTH, work->cpu); in report_print_work()
1109 (double)work->total_runtime / NSEC_PER_MSEC); in report_print_work()
1113 (double)work->total_latency / in report_print_work()
1114 work->nr_atoms / NSEC_PER_MSEC); in report_print_work()
1120 ret += printf(" %*" PRIu64 " |", PRINT_COUNT_WIDTH, work->nr_atoms); in report_print_work()
1126 timestamp__scnprintf_usec(work->max_runtime_start, in report_print_work()
1129 timestamp__scnprintf_usec(work->max_runtime_end, in report_print_work()
1134 (double)work->max_runtime / NSEC_PER_MSEC, in report_print_work()
1142 timestamp__scnprintf_usec(work->max_latency_start, in report_print_work()
1145 timestamp__scnprintf_usec(work->max_latency_end, in report_print_work()
1150 (double)work->max_latency / NSEC_PER_MSEC, in report_print_work()
1440 struct kwork_work *work) in process_skipped_events() argument
1446 count = nr_list_entry(&work->atom_list[i]); in process_skipped_events()
1456 struct kwork_work *work = NULL; in perf_kwork_add_work() local
1458 work = work_new(key); in perf_kwork_add_work()
1459 if (work == NULL) in perf_kwork_add_work()
1462 work_insert(&class->work_root, work, &kwork->cmp_id); in perf_kwork_add_work()
1463 return work; in perf_kwork_add_work()
1508 struct kwork_work *work; in perf_kwork__report() local
1525 work = rb_entry(next, struct kwork_work, node); in perf_kwork__report()
1526 process_skipped_events(kwork, work); in perf_kwork__report()
1528 if (work->nr_atoms != 0) { in perf_kwork__report()
1529 report_print_work(kwork, work); in perf_kwork__report()
1531 kwork->all_runtime += work->total_runtime; in perf_kwork__report()
1532 kwork->all_count += work->nr_atoms; in perf_kwork__report()