Lines Matching refs:ipc
5 static volatile struct idle_prof_common ipc; variable
29 if (ipc.status == IDLE_PROF_STATUS_PROF_STOP) in calibrate_unit()
86 if (ipc.status == IDLE_PROF_STATUS_ABORT) { in idle_prof_thread_fn()
124 if (ipc.status == IDLE_PROF_STATUS_ABORT) { in idle_prof_thread_fn()
130 if (ipc.status == IDLE_PROF_STATUS_CALI_STOP) { in idle_prof_thread_fn()
142 if (ipc.status == IDLE_PROF_STATUS_PROF_STOP) { in idle_prof_thread_fn()
168 for (i = 0; i < ipc.nr_cpus; i++) { in calibration_stats()
169 ipt = &ipc.ipts[i]; in calibration_stats()
173 ipc.cali_mean = sum/ipc.nr_cpus; in calibration_stats()
175 for (i = 0; i < ipc.nr_cpus; i++) { in calibration_stats()
176 ipt = &ipc.ipts[i]; in calibration_stats()
177 var += pow(ipt->cali_time-ipc.cali_mean, 2); in calibration_stats()
180 ipc.cali_stddev = sqrt(var/(ipc.nr_cpus-1)); in calibration_stats()
191 ipc.nr_cpus = cpus_online(); in fio_idle_prof_init()
192 ipc.status = IDLE_PROF_STATUS_OK; in fio_idle_prof_init()
194 if (ipc.opt == IDLE_PROF_OPT_NONE) in fio_idle_prof_init()
206 ipc.ipts = malloc(ipc.nr_cpus * sizeof(struct idle_prof_thread)); in fio_idle_prof_init()
207 if (!ipc.ipts) { in fio_idle_prof_init()
212 ipc.buf = malloc(ipc.nr_cpus * page_size); in fio_idle_prof_init()
213 if (!ipc.buf) { in fio_idle_prof_init()
215 free(ipc.ipts); in fio_idle_prof_init()
223 for (i = 0; i < ipc.nr_cpus; i++) { in fio_idle_prof_init()
224 ipt = &ipc.ipts[i]; in fio_idle_prof_init()
228 ipt->data = (unsigned char *)(ipc.buf + page_size * i); in fio_idle_prof_init()
231 ipc.status = IDLE_PROF_STATUS_ABORT; in fio_idle_prof_init()
237 ipc.status = IDLE_PROF_STATUS_ABORT; in fio_idle_prof_init()
243 ipc.status = IDLE_PROF_STATUS_ABORT; in fio_idle_prof_init()
255 ipc.status = IDLE_PROF_STATUS_ABORT; in fio_idle_prof_init()
271 for (i = 0; i < ipc.nr_cpus; i++) { in fio_idle_prof_init()
272 ipt = &ipc.ipts[i]; in fio_idle_prof_init()
276 if (ipc.status == IDLE_PROF_STATUS_ABORT) in fio_idle_prof_init()
280 for (i = 0; i < ipc.nr_cpus; i++) { in fio_idle_prof_init()
281 ipt = &ipc.ipts[i]; in fio_idle_prof_init()
297 ipc.status = IDLE_PROF_STATUS_ABORT; in fio_idle_prof_init()
300 if (ipc.status != IDLE_PROF_STATUS_ABORT) in fio_idle_prof_init()
303 ipc.cali_mean = ipc.cali_stddev = 0.0; in fio_idle_prof_init()
305 if (ipc.opt == IDLE_PROF_OPT_CALI) in fio_idle_prof_init()
306 ipc.status = IDLE_PROF_STATUS_CALI_STOP; in fio_idle_prof_init()
314 if (ipc.opt == IDLE_PROF_OPT_NONE) in fio_idle_prof_start()
318 for (i = 0; i < ipc.nr_cpus; i++) { in fio_idle_prof_start()
319 ipt = &ipc.ipts[i]; in fio_idle_prof_start()
332 if (ipc.opt == IDLE_PROF_OPT_NONE) in fio_idle_prof_stop()
335 if (ipc.opt == IDLE_PROF_OPT_CALI) in fio_idle_prof_stop()
338 ipc.status = IDLE_PROF_STATUS_PROF_STOP; in fio_idle_prof_stop()
341 for (i = 0; i < ipc.nr_cpus; i++) { in fio_idle_prof_stop()
342 ipt = &ipc.ipts[i]; in fio_idle_prof_stop()
355 if (ipc.cali_mean != 0.0) { in fio_idle_prof_stop()
358 ipt->idleness = ipt->loops * ipc.cali_mean / runt; in fio_idle_prof_stop()
377 int i, nr_cpus = ipc.nr_cpus; in fio_idle_prof_cpu_stat()
381 if (ipc.opt == IDLE_PROF_OPT_NONE) in fio_idle_prof_cpu_stat()
391 ipt = &ipc.ipts[i]; in fio_idle_prof_cpu_stat()
396 ipt = &ipc.ipts[cpu]; in fio_idle_prof_cpu_stat()
405 if (ipc.ipts) { in fio_idle_prof_cleanup()
406 free(ipc.ipts); in fio_idle_prof_cleanup()
407 ipc.ipts = NULL; in fio_idle_prof_cleanup()
410 if (ipc.buf) { in fio_idle_prof_cleanup()
411 free(ipc.buf); in fio_idle_prof_cleanup()
412 ipc.buf = NULL; in fio_idle_prof_cleanup()
418 ipc.opt = IDLE_PROF_OPT_NONE; /* default */ in fio_idle_prof_parse_opt()
427 ipc.opt = IDLE_PROF_OPT_CALI; in fio_idle_prof_parse_opt()
434 ipc.opt = IDLE_PROF_OPT_SYSTEM; in fio_idle_prof_parse_opt()
437 ipc.opt = IDLE_PROF_OPT_PERCPU; in fio_idle_prof_parse_opt()
451 int i, nr_cpus = ipc.nr_cpus; in show_idle_prof_stats()
456 if (ipc.opt > IDLE_PROF_OPT_CALI) in show_idle_prof_stats()
458 else if (ipc.opt == IDLE_PROF_OPT_CALI) in show_idle_prof_stats()
461 if (ipc.opt >= IDLE_PROF_OPT_SYSTEM) in show_idle_prof_stats()
464 if (ipc.opt == IDLE_PROF_OPT_PERCPU) { in show_idle_prof_stats()
471 if (ipc.opt >= IDLE_PROF_OPT_CALI) { in show_idle_prof_stats()
472 log_info(" unit work: mean=%3.2fus,", ipc.cali_mean); in show_idle_prof_stats()
473 log_info(" stddev=%3.2f\n", ipc.cali_stddev); in show_idle_prof_stats()
477 if (ipc.opt != IDLE_PROF_OPT_NONE) in show_idle_prof_stats()
483 if ((ipc.opt != IDLE_PROF_OPT_NONE) && (output == FIO_OUTPUT_JSON)) { in show_idle_prof_stats()
494 if (ipc.opt == IDLE_PROF_OPT_PERCPU) { in show_idle_prof_stats()
501 json_object_add_value_float(tmp, "unit_mean", ipc.cali_mean); in show_idle_prof_stats()
502 json_object_add_value_float(tmp, "unit_stddev", ipc.cali_stddev); in show_idle_prof_stats()