Lines Matching defs:ipc

5 static volatile struct idle_prof_common ipc;
29 if (ipc.status == IDLE_PROF_STATUS_PROF_STOP)
86 if (ipc.status == IDLE_PROF_STATUS_ABORT) {
124 if (ipc.status == IDLE_PROF_STATUS_ABORT) {
130 if (ipc.status == IDLE_PROF_STATUS_CALI_STOP) {
142 if (ipc.status == IDLE_PROF_STATUS_PROF_STOP) {
168 for (i = 0; i < ipc.nr_cpus; i++) {
169 ipt = &ipc.ipts[i];
173 ipc.cali_mean = sum/ipc.nr_cpus;
175 for (i = 0; i < ipc.nr_cpus; i++) {
176 ipt = &ipc.ipts[i];
177 var += pow(ipt->cali_time-ipc.cali_mean, 2);
180 ipc.cali_stddev = sqrt(var/(ipc.nr_cpus-1));
191 ipc.nr_cpus = cpus_online();
192 ipc.status = IDLE_PROF_STATUS_OK;
194 if (ipc.opt == IDLE_PROF_OPT_NONE)
206 ipc.ipts = malloc(ipc.nr_cpus * sizeof(struct idle_prof_thread));
207 if (!ipc.ipts) {
212 ipc.buf = malloc(ipc.nr_cpus * page_size);
213 if (!ipc.buf) {
215 free(ipc.ipts);
223 for (i = 0; i < ipc.nr_cpus; i++) {
224 ipt = &ipc.ipts[i];
228 ipt->data = (unsigned char *)(ipc.buf + page_size * i);
231 ipc.status = IDLE_PROF_STATUS_ABORT;
237 ipc.status = IDLE_PROF_STATUS_ABORT;
243 ipc.status = IDLE_PROF_STATUS_ABORT;
255 ipc.status = IDLE_PROF_STATUS_ABORT;
271 for (i = 0; i < ipc.nr_cpus; i++) {
272 ipt = &ipc.ipts[i];
276 if (ipc.status == IDLE_PROF_STATUS_ABORT)
280 for (i = 0; i < ipc.nr_cpus; i++) {
281 ipt = &ipc.ipts[i];
297 ipc.status = IDLE_PROF_STATUS_ABORT;
300 if (ipc.status != IDLE_PROF_STATUS_ABORT)
303 ipc.cali_mean = ipc.cali_stddev = 0.0;
305 if (ipc.opt == IDLE_PROF_OPT_CALI)
306 ipc.status = IDLE_PROF_STATUS_CALI_STOP;
314 if (ipc.opt == IDLE_PROF_OPT_NONE)
318 for (i = 0; i < ipc.nr_cpus; i++) {
319 ipt = &ipc.ipts[i];
332 if (ipc.opt == IDLE_PROF_OPT_NONE)
335 if (ipc.opt == IDLE_PROF_OPT_CALI)
338 ipc.status = IDLE_PROF_STATUS_PROF_STOP;
341 for (i = 0; i < ipc.nr_cpus; i++) {
342 ipt = &ipc.ipts[i];
355 if (ipc.cali_mean != 0.0) {
358 ipt->idleness = ipt->loops * ipc.cali_mean / runt;
377 int i, nr_cpus = ipc.nr_cpus;
381 if (ipc.opt == IDLE_PROF_OPT_NONE)
391 ipt = &ipc.ipts[i];
396 ipt = &ipc.ipts[cpu];
405 if (ipc.ipts) {
406 free(ipc.ipts);
407 ipc.ipts = NULL;
410 if (ipc.buf) {
411 free(ipc.buf);
412 ipc.buf = NULL;
418 ipc.opt = IDLE_PROF_OPT_NONE; /* default */
427 ipc.opt = IDLE_PROF_OPT_CALI;
434 ipc.opt = IDLE_PROF_OPT_SYSTEM;
437 ipc.opt = IDLE_PROF_OPT_PERCPU;
452 int i, nr_cpus = ipc.nr_cpus;
457 if (ipc.opt > IDLE_PROF_OPT_CALI)
459 else if (ipc.opt == IDLE_PROF_OPT_CALI)
462 if (ipc.opt >= IDLE_PROF_OPT_SYSTEM)
465 if (ipc.opt == IDLE_PROF_OPT_PERCPU) {
472 if (ipc.opt >= IDLE_PROF_OPT_CALI) {
473 log_buf(out, " unit work: mean=%3.2fus,", ipc.cali_mean);
474 log_buf(out, " stddev=%3.2f\n", ipc.cali_stddev);
478 if (ipc.opt != IDLE_PROF_OPT_NONE)
484 if ((ipc.opt != IDLE_PROF_OPT_NONE) && (output & FIO_OUTPUT_JSON)) {
495 if (ipc.opt == IDLE_PROF_OPT_PERCPU) {
502 json_object_add_value_float(tmp, "unit_mean", ipc.cali_mean);
503 json_object_add_value_float(tmp, "unit_stddev", ipc.cali_stddev);