Lines Matching refs:kwork
47 void (*load_prepare)(struct perf_kwork *kwork);
91 static void irq_load_prepare(struct perf_kwork *kwork) in irq_load_prepare() argument
93 if (kwork->report == KWORK_REPORT_RUNTIME) { in irq_load_prepare()
104 static void softirq_load_prepare(struct perf_kwork *kwork) in softirq_load_prepare() argument
106 if (kwork->report == KWORK_REPORT_RUNTIME) { in softirq_load_prepare()
109 } else if (kwork->report == KWORK_REPORT_LATENCY) { in softirq_load_prepare()
120 static void workqueue_load_prepare(struct perf_kwork *kwork) in workqueue_load_prepare() argument
122 if (kwork->report == KWORK_REPORT_RUNTIME) { in workqueue_load_prepare()
125 } else if (kwork->report == KWORK_REPORT_LATENCY) { in workqueue_load_prepare()
148 static int setup_filters(struct perf_kwork *kwork) in setup_filters() argument
150 if (kwork->cpu_list != NULL) { in setup_filters()
161 map = perf_cpu_map__new(kwork->cpu_list); in setup_filters()
181 if (kwork->profile_name != NULL) { in setup_filters()
184 if (strlen(kwork->profile_name) >= MAX_KWORKNAME) { in setup_filters()
186 kwork->profile_name, MAX_KWORKNAME - 1); in setup_filters()
197 bpf_map_update_elem(fd, &key, kwork->profile_name, BPF_ANY); in setup_filters()
203 int perf_kwork__trace_prepare_bpf(struct perf_kwork *kwork) in perf_kwork__trace_prepare_bpf() argument
223 list_for_each_entry(class, &kwork->class_list, list) { in perf_kwork__trace_prepare_bpf()
235 class_bpf->load_prepare(kwork); in perf_kwork__trace_prepare_bpf()
238 if (kwork->cpu_list != NULL) in perf_kwork__trace_prepare_bpf()
240 if (kwork->profile_name != NULL) in perf_kwork__trace_prepare_bpf()
248 if (setup_filters(kwork)) in perf_kwork__trace_prepare_bpf()
263 static int add_work(struct perf_kwork *kwork, in add_work() argument
288 work = perf_kwork_add_work(kwork, tmp.class, &tmp); in add_work()
292 if (kwork->report == KWORK_REPORT_RUNTIME) { in add_work()
298 } else if (kwork->report == KWORK_REPORT_LATENCY) { in add_work()
305 pr_debug("Invalid bpf report type %d\n", kwork->report); in add_work()
309 kwork->timestart = (u64)ts_start.tv_sec * NSEC_PER_SEC + ts_start.tv_nsec; in add_work()
310 kwork->timeend = (u64)ts_end.tv_sec * NSEC_PER_SEC + ts_end.tv_nsec; in add_work()
315 int perf_kwork__report_read_bpf(struct perf_kwork *kwork) in perf_kwork__report_read_bpf() argument
341 if ((data.nr != 0) && (add_work(kwork, &key, &data) != 0)) in perf_kwork__report_read_bpf()