Lines Matching refs:kwork
167 static int sort_dimension__add(struct perf_kwork *kwork __maybe_unused, in sort_dimension__add()
209 if (kwork->report == KWORK_REPORT_LATENCY) in sort_dimension__add()
222 static void setup_sorting(struct perf_kwork *kwork, in setup_sorting() argument
226 char *tmp, *tok, *str = strdup(kwork->sort_order); in setup_sorting()
230 if (sort_dimension__add(kwork, tok, &kwork->sort_list) < 0) in setup_sorting()
235 pr_debug("Sort order: %s\n", kwork->sort_order); in setup_sorting()
239 static struct kwork_atom *atom_new(struct perf_kwork *kwork, in atom_new() argument
246 list_for_each_entry(page, &kwork->atom_page_list, list) { in atom_new()
266 list_add_tail(&page->list, &kwork->atom_page_list); in atom_new()
394 static void profile_update_timespan(struct perf_kwork *kwork, in profile_update_timespan() argument
397 if (!kwork->summary) in profile_update_timespan()
400 if ((kwork->timestart == 0) || (kwork->timestart > sample->time)) in profile_update_timespan()
401 kwork->timestart = sample->time; in profile_update_timespan()
403 if (kwork->timeend < sample->time) in profile_update_timespan()
404 kwork->timeend = sample->time; in profile_update_timespan()
407 static bool profile_name_match(struct perf_kwork *kwork, in profile_name_match() argument
410 if (kwork->profile_name && work->name && in profile_name_match()
411 (strcmp(work->name, kwork->profile_name) != 0)) { in profile_name_match()
418 static bool profile_event_match(struct perf_kwork *kwork, in profile_event_match() argument
424 struct perf_time_interval *ptime = &kwork->ptime; in profile_event_match()
426 if ((kwork->cpu_list != NULL) && !test_bit(cpu, kwork->cpu_bitmap)) in profile_event_match()
437 if ((kwork->report != KWORK_REPORT_TOP) && in profile_event_match()
438 !profile_name_match(kwork, work)) { in profile_event_match()
442 profile_update_timespan(kwork, sample); in profile_event_match()
446 static int work_push_atom(struct perf_kwork *kwork, in work_push_atom() argument
460 class->work_init(kwork, class, &key, src_type, evsel, sample, machine); in work_push_atom()
462 atom = atom_new(kwork, sample); in work_push_atom()
466 work = work_findnew(&class->work_root, &key, &kwork->cmp_id); in work_push_atom()
472 if (!profile_event_match(kwork, work, sample)) { in work_push_atom()
495 kwork->nr_skipped_events[src_type]++; in work_push_atom()
496 kwork->nr_skipped_events[KWORK_TRACE_MAX]++; in work_push_atom()
505 static struct kwork_atom *work_pop_atom(struct perf_kwork *kwork, in work_pop_atom() argument
518 class->work_init(kwork, class, &key, src_type, evsel, sample, machine); in work_pop_atom()
520 work = work_findnew(&class->work_root, &key, &kwork->cmp_id); in work_pop_atom()
527 if (!profile_event_match(kwork, work, sample)) in work_pop_atom()
535 src_atom = atom_new(kwork, sample); in work_pop_atom()
565 static struct kwork_class *get_kwork_class(struct perf_kwork *kwork, in get_kwork_class() argument
570 list_for_each_entry(class, &kwork->class_list, list) { in get_kwork_class()
599 static int report_entry_event(struct perf_kwork *kwork, in report_entry_event() argument
605 return work_push_atom(kwork, class, KWORK_TRACE_ENTRY, in report_entry_event()
610 static int report_exit_event(struct perf_kwork *kwork, in report_exit_event() argument
619 atom = work_pop_atom(kwork, class, KWORK_TRACE_EXIT, in report_exit_event()
654 static int latency_raise_event(struct perf_kwork *kwork, in latency_raise_event() argument
660 return work_push_atom(kwork, class, KWORK_TRACE_RAISE, in latency_raise_event()
665 static int latency_entry_event(struct perf_kwork *kwork, in latency_entry_event() argument
674 atom = work_pop_atom(kwork, class, KWORK_TRACE_ENTRY, in latency_entry_event()
688 static void timehist_save_callchain(struct perf_kwork *kwork, in timehist_save_callchain() argument
698 if (!kwork->show_callchain || sample->callchain == NULL) in timehist_save_callchain()
711 NULL, NULL, kwork->max_stack + 2) != 0) { in timehist_save_callchain()
737 static void timehist_print_event(struct perf_kwork *kwork, in timehist_print_event() argument
794 if (kwork->show_callchain) { in timehist_print_event()
813 static int timehist_raise_event(struct perf_kwork *kwork, in timehist_raise_event() argument
819 return work_push_atom(kwork, class, KWORK_TRACE_RAISE, in timehist_raise_event()
824 static int timehist_entry_event(struct perf_kwork *kwork, in timehist_entry_event() argument
833 ret = work_push_atom(kwork, class, KWORK_TRACE_ENTRY, in timehist_entry_event()
840 timehist_save_callchain(kwork, sample, evsel, machine); in timehist_entry_event()
845 static int timehist_exit_event(struct perf_kwork *kwork, in timehist_exit_event() argument
863 atom = work_pop_atom(kwork, class, KWORK_TRACE_EXIT, in timehist_exit_event()
873 timehist_print_event(kwork, work, atom, sample, &al); in timehist_exit_event()
896 static int top_entry_event(struct perf_kwork *kwork, in top_entry_event() argument
902 return work_push_atom(kwork, class, KWORK_TRACE_ENTRY, in top_entry_event()
907 static int top_exit_event(struct perf_kwork *kwork, in top_exit_event() argument
917 atom = work_pop_atom(kwork, class, KWORK_TRACE_EXIT, in top_exit_event()
924 sched_class = get_kwork_class(kwork, KWORK_CLASS_SCHED); in top_exit_event()
937 static int top_sched_switch_event(struct perf_kwork *kwork, in top_sched_switch_event() argument
946 atom = work_pop_atom(kwork, class, KWORK_TRACE_EXIT, in top_sched_switch_event()
957 return top_entry_event(kwork, class, evsel, sample, machine); in top_sched_switch_event()
966 struct perf_kwork *kwork = container_of(tool, struct perf_kwork, tool); in process_irq_handler_entry_event() local
968 if (kwork->tp_handler->entry_event) in process_irq_handler_entry_event()
969 return kwork->tp_handler->entry_event(kwork, &kwork_irq, in process_irq_handler_entry_event()
979 struct perf_kwork *kwork = container_of(tool, struct perf_kwork, tool); in process_irq_handler_exit_event() local
981 if (kwork->tp_handler->exit_event) in process_irq_handler_exit_event()
982 return kwork->tp_handler->exit_event(kwork, &kwork_irq, in process_irq_handler_exit_event()
1004 static void irq_work_init(struct perf_kwork *kwork, in irq_work_init() argument
1015 if (kwork->report == KWORK_REPORT_TOP) { in irq_work_init()
1045 struct perf_kwork *kwork = container_of(tool, struct perf_kwork, tool); in process_softirq_raise_event() local
1047 if (kwork->tp_handler->raise_event) in process_softirq_raise_event()
1048 return kwork->tp_handler->raise_event(kwork, &kwork_softirq, in process_softirq_raise_event()
1059 struct perf_kwork *kwork = container_of(tool, struct perf_kwork, tool); in process_softirq_entry_event() local
1061 if (kwork->tp_handler->entry_event) in process_softirq_entry_event()
1062 return kwork->tp_handler->entry_event(kwork, &kwork_softirq, in process_softirq_entry_event()
1073 struct perf_kwork *kwork = container_of(tool, struct perf_kwork, tool); in process_softirq_exit_event() local
1075 if (kwork->tp_handler->exit_event) in process_softirq_exit_event()
1076 return kwork->tp_handler->exit_event(kwork, &kwork_softirq, in process_softirq_exit_event()
1131 static void softirq_work_init(struct perf_kwork *kwork, in softirq_work_init() argument
1144 if (kwork->report == KWORK_REPORT_TOP) { in softirq_work_init()
1175 struct perf_kwork *kwork = container_of(tool, struct perf_kwork, tool); in process_workqueue_activate_work_event() local
1177 if (kwork->tp_handler->raise_event) in process_workqueue_activate_work_event()
1178 return kwork->tp_handler->raise_event(kwork, &kwork_workqueue, in process_workqueue_activate_work_event()
1189 struct perf_kwork *kwork = container_of(tool, struct perf_kwork, tool); in process_workqueue_execute_start_event() local
1191 if (kwork->tp_handler->entry_event) in process_workqueue_execute_start_event()
1192 return kwork->tp_handler->entry_event(kwork, &kwork_workqueue, in process_workqueue_execute_start_event()
1203 struct perf_kwork *kwork = container_of(tool, struct perf_kwork, tool); in process_workqueue_execute_end_event() local
1205 if (kwork->tp_handler->exit_event) in process_workqueue_execute_end_event()
1206 return kwork->tp_handler->exit_event(kwork, &kwork_workqueue, in process_workqueue_execute_end_event()
1231 static void workqueue_work_init(struct perf_kwork *kwork __maybe_unused, in workqueue_work_init()
1274 struct perf_kwork *kwork = container_of(tool, struct perf_kwork, tool); in process_sched_switch_event() local
1276 if (kwork->tp_handler->sched_switch_event) in process_sched_switch_event()
1277 return kwork->tp_handler->sched_switch_event(kwork, &kwork_sched, in process_sched_switch_event()
1299 static void sched_work_init(struct perf_kwork *kwork __maybe_unused, in sched_work_init()
1346 static int report_print_work(struct perf_kwork *kwork, struct kwork_work *work) in report_print_work() argument
1374 if (kwork->report == KWORK_REPORT_RUNTIME) { in report_print_work()
1378 } else if (kwork->report == KWORK_REPORT_LATENCY) { // avg delay in report_print_work()
1393 if (kwork->report == KWORK_REPORT_RUNTIME) { in report_print_work()
1409 else if (kwork->report == KWORK_REPORT_LATENCY) { in report_print_work()
1427 static int report_print_header(struct perf_kwork *kwork) in report_print_header() argument
1436 if (kwork->report == KWORK_REPORT_RUNTIME) { in report_print_header()
1439 } else if (kwork->report == KWORK_REPORT_LATENCY) { in report_print_header()
1446 if (kwork->report == KWORK_REPORT_RUNTIME) { in report_print_header()
1451 } else if (kwork->report == KWORK_REPORT_LATENCY) { in report_print_header()
1499 static void print_summary(struct perf_kwork *kwork) in print_summary() argument
1501 u64 time = kwork->timeend - kwork->timestart; in print_summary()
1503 printf(" Total count : %9" PRIu64 "\n", kwork->all_count); in print_summary()
1505 (double)kwork->all_runtime / NSEC_PER_MSEC, in print_summary()
1506 time == 0 ? 0 : (double)kwork->all_runtime / time); in print_summary()
1522 static void print_skipped_events(struct perf_kwork *kwork) in print_skipped_events() argument
1531 if ((kwork->nr_skipped_events[KWORK_TRACE_MAX] != 0) && in print_skipped_events()
1532 (kwork->nr_events != 0)) { in print_skipped_events()
1534 (double)kwork->nr_skipped_events[KWORK_TRACE_MAX] / in print_skipped_events()
1535 (double)kwork->nr_events * 100.0, in print_skipped_events()
1536 kwork->nr_skipped_events[KWORK_TRACE_MAX]); in print_skipped_events()
1540 kwork->nr_skipped_events[i], in print_skipped_events()
1548 nr_list_entry(&kwork->atom_page_list)); in print_skipped_events()
1551 static void print_bad_events(struct perf_kwork *kwork) in print_bad_events() argument
1553 if ((kwork->nr_lost_events != 0) && (kwork->nr_events != 0)) { in print_bad_events()
1555 (double)kwork->nr_lost_events / in print_bad_events()
1556 (double)kwork->nr_events * 100.0, in print_bad_events()
1557 kwork->nr_lost_events, kwork->nr_events, in print_bad_events()
1558 kwork->nr_lost_chunks); in print_bad_events()
1564 static void top_print_per_cpu_load(struct perf_kwork *kwork) in top_print_per_cpu_load() argument
1568 struct kwork_top_stat *stat = &kwork->top_stat; in top_print_per_cpu_load()
1590 static void top_print_cpu_usage(struct perf_kwork *kwork) in top_print_cpu_usage() argument
1592 struct kwork_top_stat *stat = &kwork->top_stat; in top_print_cpu_usage()
1614 top_print_per_cpu_load(kwork); in top_print_cpu_usage()
1617 static void top_print_header(struct perf_kwork *kwork __maybe_unused) in top_print_header()
1625 kwork->use_bpf ? " " : "", in top_print_header()
1626 kwork->use_bpf ? PRINT_PID_WIDTH : 0, in top_print_header()
1627 kwork->use_bpf ? "SPID" : "", in top_print_header()
1628 kwork->use_bpf ? " " : "", in top_print_header()
1637 static int top_print_work(struct perf_kwork *kwork __maybe_unused, struct kwork_work *work) in top_print_work()
1651 if (kwork->use_bpf) in top_print_work()
1671 if (kwork->use_bpf) in top_print_work()
1683 static void work_sort(struct perf_kwork *kwork, in work_sort() argument
1697 work_insert(&kwork->sorted_work_root, in work_sort()
1698 data, &kwork->sort_list); in work_sort()
1702 static void perf_kwork__sort(struct perf_kwork *kwork) in perf_kwork__sort() argument
1706 list_for_each_entry(class, &kwork->class_list, list) in perf_kwork__sort()
1707 work_sort(kwork, class, &class->work_root); in perf_kwork__sort()
1710 static int perf_kwork__check_config(struct perf_kwork *kwork, in perf_kwork__check_config() argument
1736 switch (kwork->report) { in perf_kwork__check_config()
1738 kwork->tp_handler = &report_ops; in perf_kwork__check_config()
1741 kwork->tp_handler = &latency_ops; in perf_kwork__check_config()
1744 kwork->tp_handler = &timehist_ops; in perf_kwork__check_config()
1747 kwork->tp_handler = &top_ops; in perf_kwork__check_config()
1750 pr_debug("Invalid report type %d\n", kwork->report); in perf_kwork__check_config()
1754 list_for_each_entry(class, &kwork->class_list, list) in perf_kwork__check_config()
1759 if (kwork->cpu_list != NULL) { in perf_kwork__check_config()
1761 kwork->cpu_list, in perf_kwork__check_config()
1762 kwork->cpu_bitmap); in perf_kwork__check_config()
1769 if (kwork->time_str != NULL) { in perf_kwork__check_config()
1770 ret = perf_time__parse_str(&kwork->ptime, kwork->time_str); in perf_kwork__check_config()
1778 if (kwork->show_callchain && !evsel__has_callchain(evsel)) { in perf_kwork__check_config()
1780 kwork->show_callchain = 0; in perf_kwork__check_config()
1788 static int perf_kwork__read_events(struct perf_kwork *kwork) in perf_kwork__read_events() argument
1796 .force = kwork->force, in perf_kwork__read_events()
1799 session = perf_session__new(&data, &kwork->tool); in perf_kwork__read_events()
1807 if (perf_kwork__check_config(kwork, session) != 0) in perf_kwork__read_events()
1818 if (kwork->report == KWORK_REPORT_TIMEHIST) in perf_kwork__read_events()
1827 kwork->nr_events = session->evlist->stats.nr_events[0]; in perf_kwork__read_events()
1828 kwork->nr_lost_events = session->evlist->stats.total_lost; in perf_kwork__read_events()
1829 kwork->nr_lost_chunks = session->evlist->stats.nr_events[PERF_RECORD_LOST]; in perf_kwork__read_events()
1836 static void process_skipped_events(struct perf_kwork *kwork, in process_skipped_events() argument
1844 kwork->nr_skipped_events[i] += count; in process_skipped_events()
1845 kwork->nr_skipped_events[KWORK_TRACE_MAX] += count; in process_skipped_events()
1849 struct kwork_work *perf_kwork_add_work(struct perf_kwork *kwork, in perf_kwork_add_work() argument
1859 work_insert(&class->work_root, work, &kwork->cmp_id); in perf_kwork_add_work()
1872 static int perf_kwork__report_bpf(struct perf_kwork *kwork) in perf_kwork__report_bpf() argument
1879 ret = perf_kwork__trace_prepare_bpf(kwork); in perf_kwork__report_bpf()
1894 perf_kwork__report_read_bpf(kwork); in perf_kwork__report_bpf()
1901 static int perf_kwork__report(struct perf_kwork *kwork) in perf_kwork__report() argument
1907 if (kwork->use_bpf) in perf_kwork__report()
1908 ret = perf_kwork__report_bpf(kwork); in perf_kwork__report()
1910 ret = perf_kwork__read_events(kwork); in perf_kwork__report()
1915 perf_kwork__sort(kwork); in perf_kwork__report()
1919 ret = report_print_header(kwork); in perf_kwork__report()
1920 next = rb_first_cached(&kwork->sorted_work_root); in perf_kwork__report()
1923 process_skipped_events(kwork, work); in perf_kwork__report()
1926 report_print_work(kwork, work); in perf_kwork__report()
1927 if (kwork->summary) { in perf_kwork__report()
1928 kwork->all_runtime += work->total_runtime; in perf_kwork__report()
1929 kwork->all_count += work->nr_atoms; in perf_kwork__report()
1936 if (kwork->summary) { in perf_kwork__report()
1937 print_summary(kwork); in perf_kwork__report()
1941 print_bad_events(kwork); in perf_kwork__report()
1942 print_skipped_events(kwork); in perf_kwork__report()
1970 static int perf_kwork__timehist(struct perf_kwork *kwork) in perf_kwork__timehist() argument
1975 kwork->tool.comm = perf_event__process_comm; in perf_kwork__timehist()
1976 kwork->tool.exit = perf_event__process_exit; in perf_kwork__timehist()
1977 kwork->tool.fork = perf_event__process_fork; in perf_kwork__timehist()
1978 kwork->tool.attr = perf_event__process_attr; in perf_kwork__timehist()
1979 kwork->tool.tracing_data = perf_event__process_tracing_data; in perf_kwork__timehist()
1980 kwork->tool.build_id = perf_event__process_build_id; in perf_kwork__timehist()
1981 kwork->tool.ordered_events = true; in perf_kwork__timehist()
1982 kwork->tool.ordering_requires_timestamps = true; in perf_kwork__timehist()
1983 symbol_conf.use_callchain = kwork->show_callchain; in perf_kwork__timehist()
1992 return perf_kwork__read_events(kwork); in perf_kwork__timehist()
1995 static void top_calc_total_runtime(struct perf_kwork *kwork) in top_calc_total_runtime() argument
2000 struct kwork_top_stat *stat = &kwork->top_stat; in top_calc_total_runtime()
2002 class = get_kwork_class(kwork, KWORK_CLASS_SCHED); in top_calc_total_runtime()
2016 static void top_calc_idle_time(struct perf_kwork *kwork, in top_calc_idle_time() argument
2019 struct kwork_top_stat *stat = &kwork->top_stat; in top_calc_idle_time()
2027 static void top_calc_irq_runtime(struct perf_kwork *kwork, in top_calc_irq_runtime() argument
2031 struct kwork_top_stat *stat = &kwork->top_stat; in top_calc_irq_runtime()
2042 static void top_subtract_irq_runtime(struct perf_kwork *kwork, in top_subtract_irq_runtime() argument
2051 class = get_kwork_class(kwork, irq_class_list[i]); in top_subtract_irq_runtime()
2062 top_calc_irq_runtime(kwork, irq_class_list[i], data); in top_subtract_irq_runtime()
2067 static void top_calc_cpu_usage(struct perf_kwork *kwork) in top_calc_cpu_usage() argument
2072 struct kwork_top_stat *stat = &kwork->top_stat; in top_calc_cpu_usage()
2074 class = get_kwork_class(kwork, KWORK_CLASS_SCHED); in top_calc_cpu_usage()
2087 top_subtract_irq_runtime(kwork, work); in top_calc_cpu_usage()
2092 top_calc_idle_time(kwork, work); in top_calc_cpu_usage()
2098 static void top_calc_load_runtime(struct perf_kwork *kwork, in top_calc_load_runtime() argument
2101 struct kwork_top_stat *stat = &kwork->top_stat; in top_calc_load_runtime()
2109 static void top_merge_tasks(struct perf_kwork *kwork) in top_merge_tasks() argument
2117 class = get_kwork_class(kwork, KWORK_CLASS_SCHED); in top_merge_tasks()
2129 if (!profile_name_match(kwork, data)) in top_merge_tasks()
2136 work_insert(&merged_root, data, &kwork->cmp_id); in top_merge_tasks()
2142 top_calc_load_runtime(kwork, data); in top_merge_tasks()
2145 work_sort(kwork, class, &merged_root); in top_merge_tasks()
2148 static void perf_kwork__top_report(struct perf_kwork *kwork) in perf_kwork__top_report() argument
2155 top_print_cpu_usage(kwork); in perf_kwork__top_report()
2156 top_print_header(kwork); in perf_kwork__top_report()
2157 next = rb_first_cached(&kwork->sorted_work_root); in perf_kwork__top_report()
2160 process_skipped_events(kwork, work); in perf_kwork__top_report()
2165 top_print_work(kwork, work); in perf_kwork__top_report()
2174 static int perf_kwork__top_bpf(struct perf_kwork *kwork) in perf_kwork__top_bpf() argument
2181 ret = perf_kwork__top_prepare_bpf(kwork); in perf_kwork__top_bpf()
2196 perf_kwork__top_read_bpf(kwork); in perf_kwork__top_bpf()
2204 static int perf_kwork__top(struct perf_kwork *kwork) in perf_kwork__top() argument
2213 kwork->top_stat.cpus_runtime = cpus_runtime; in perf_kwork__top()
2214 bitmap_zero(kwork->top_stat.all_cpus_bitmap, MAX_NR_CPUS); in perf_kwork__top()
2216 if (kwork->use_bpf) in perf_kwork__top()
2217 ret = perf_kwork__top_bpf(kwork); in perf_kwork__top()
2219 ret = perf_kwork__read_events(kwork); in perf_kwork__top()
2224 top_calc_total_runtime(kwork); in perf_kwork__top()
2225 top_calc_cpu_usage(kwork); in perf_kwork__top()
2226 top_merge_tasks(kwork); in perf_kwork__top()
2230 perf_kwork__top_report(kwork); in perf_kwork__top()
2233 zfree(&kwork->top_stat.cpus_runtime); in perf_kwork__top()
2237 static void setup_event_list(struct perf_kwork *kwork, in setup_event_list() argument
2248 if (kwork->event_list_str == NULL) in setup_event_list()
2249 kwork->event_list_str = "irq, softirq, workqueue"; in setup_event_list()
2251 str = strdup(kwork->event_list_str); in setup_event_list()
2257 list_add_tail(&class->list, &kwork->class_list); in setup_event_list()
2269 list_for_each_entry(class, &kwork->class_list, list) in setup_event_list()
2274 static int perf_kwork__record(struct perf_kwork *kwork, in perf_kwork__record() argument
2291 list_for_each_entry(class, &kwork->class_list, list) in perf_kwork__record()
2301 list_for_each_entry(class, &kwork->class_list, list) { in perf_kwork__record()
2323 static struct perf_kwork kwork = { in cmd_kwork() local
2324 .class_list = LIST_HEAD_INIT(kwork.class_list), in cmd_kwork()
2325 .atom_page_list = LIST_HEAD_INIT(kwork.atom_page_list), in cmd_kwork()
2326 .sort_list = LIST_HEAD_INIT(kwork.sort_list), in cmd_kwork()
2327 .cmp_id = LIST_HEAD_INIT(kwork.cmp_id), in cmd_kwork()
2356 OPT_STRING('k', "kwork", &kwork.event_list_str, "kwork", in cmd_kwork()
2358 OPT_BOOLEAN('f', "force", &kwork.force, "don't complain, do it"), in cmd_kwork()
2362 OPT_STRING('s', "sort", &kwork.sort_order, "key[,key2...]", in cmd_kwork()
2364 OPT_STRING('C', "cpu", &kwork.cpu_list, "cpu", in cmd_kwork()
2366 OPT_STRING('n', "name", &kwork.profile_name, "name", in cmd_kwork()
2368 OPT_STRING(0, "time", &kwork.time_str, "str", in cmd_kwork()
2372 OPT_BOOLEAN('S', "with-summary", &kwork.summary, in cmd_kwork()
2375 OPT_BOOLEAN('b', "use-bpf", &kwork.use_bpf, in cmd_kwork()
2381 OPT_STRING('s', "sort", &kwork.sort_order, "key[,key2...]", in cmd_kwork()
2383 OPT_STRING('C', "cpu", &kwork.cpu_list, "cpu", in cmd_kwork()
2385 OPT_STRING('n', "name", &kwork.profile_name, "name", in cmd_kwork()
2387 OPT_STRING(0, "time", &kwork.time_str, "str", in cmd_kwork()
2392 OPT_BOOLEAN('b', "use-bpf", &kwork.use_bpf, in cmd_kwork()
2402 OPT_BOOLEAN('g', "call-graph", &kwork.show_callchain, in cmd_kwork()
2404 OPT_UINTEGER(0, "max-stack", &kwork.max_stack, in cmd_kwork()
2408 OPT_STRING(0, "time", &kwork.time_str, "str", in cmd_kwork()
2410 OPT_STRING('C', "cpu", &kwork.cpu_list, "cpu", in cmd_kwork()
2412 OPT_STRING('n', "name", &kwork.profile_name, "name", in cmd_kwork()
2419 OPT_STRING('s', "sort", &kwork.sort_order, "key[,key2...]", in cmd_kwork()
2421 OPT_STRING('C', "cpu", &kwork.cpu_list, "cpu", in cmd_kwork()
2423 OPT_STRING('n', "name", &kwork.profile_name, "name", in cmd_kwork()
2425 OPT_STRING(0, "time", &kwork.time_str, "str", in cmd_kwork()
2430 OPT_BOOLEAN('b', "use-bpf", &kwork.use_bpf, in cmd_kwork()
2459 perf_tool__init(&kwork.tool, /*ordered_events=*/true); in cmd_kwork()
2460 kwork.tool.mmap = perf_event__process_mmap; in cmd_kwork()
2461 kwork.tool.mmap2 = perf_event__process_mmap2; in cmd_kwork()
2462 kwork.tool.sample = perf_kwork__process_tracepoint_sample; in cmd_kwork()
2470 sort_dimension__add(&kwork, "id", &kwork.cmp_id); in cmd_kwork()
2473 setup_event_list(&kwork, kwork_options, kwork_usage); in cmd_kwork()
2474 return perf_kwork__record(&kwork, argc, argv); in cmd_kwork()
2476 kwork.sort_order = default_report_sort_order; in cmd_kwork()
2482 kwork.report = KWORK_REPORT_RUNTIME; in cmd_kwork()
2483 setup_sorting(&kwork, report_options, report_usage); in cmd_kwork()
2484 setup_event_list(&kwork, kwork_options, kwork_usage); in cmd_kwork()
2485 return perf_kwork__report(&kwork); in cmd_kwork()
2487 kwork.sort_order = default_latency_sort_order; in cmd_kwork()
2493 kwork.report = KWORK_REPORT_LATENCY; in cmd_kwork()
2494 setup_sorting(&kwork, latency_options, latency_usage); in cmd_kwork()
2495 setup_event_list(&kwork, kwork_options, kwork_usage); in cmd_kwork()
2496 return perf_kwork__report(&kwork); in cmd_kwork()
2503 kwork.report = KWORK_REPORT_TIMEHIST; in cmd_kwork()
2504 setup_event_list(&kwork, kwork_options, kwork_usage); in cmd_kwork()
2505 return perf_kwork__timehist(&kwork); in cmd_kwork()
2507 kwork.sort_order = default_top_sort_order; in cmd_kwork()
2513 kwork.report = KWORK_REPORT_TOP; in cmd_kwork()
2514 if (!kwork.event_list_str) in cmd_kwork()
2515 kwork.event_list_str = "sched, irq, softirq"; in cmd_kwork()
2516 setup_event_list(&kwork, kwork_options, kwork_usage); in cmd_kwork()
2517 setup_sorting(&kwork, top_options, top_usage); in cmd_kwork()
2518 return perf_kwork__top(&kwork); in cmd_kwork()