Lines Matching full:os
363 struct outstate *os = ctx; in new_line_std() local
365 os->newline = true; in new_line_std()
369 struct outstate *os) in __new_line_std_csv() argument
371 fputc('\n', os->fh); in __new_line_std_csv()
372 if (os->prefix) in __new_line_std_csv()
373 fputs(os->prefix, os->fh); in __new_line_std_csv()
374 aggr_printout(config, os->evsel, os->id, os->aggr_nr); in __new_line_std_csv()
377 static inline void __new_line_std(struct outstate *os) in __new_line_std() argument
379 fprintf(os->fh, " "); in __new_line_std()
383 struct outstate *os) in do_new_line_std() argument
385 __new_line_std_csv(config, os); in do_new_line_std()
387 fprintf(os->fh, " "); in do_new_line_std()
388 __new_line_std(os); in do_new_line_std()
395 struct outstate *os = ctx; in print_metric_std() local
396 FILE *out = os->fh; in print_metric_std()
398 bool newline = os->newline; in print_metric_std()
400 os->newline = false; in print_metric_std()
408 do_new_line_std(config, os); in print_metric_std()
420 struct outstate *os = ctx; in new_line_csv() local
423 __new_line_std_csv(config, os); in new_line_csv()
424 for (i = 0; i < os->nfields; i++) in new_line_csv()
425 fputs(config->csv_sep, os->fh); in new_line_csv()
433 struct outstate *os = ctx; in print_metric_csv() local
434 FILE *out = os->fh; in print_metric_csv()
455 struct outstate *os = ctx; in print_metric_json() local
456 FILE *out = os->fh; in print_metric_json()
466 struct outstate *os = ctx; in new_line_json() local
468 fputs("\n{", os->fh); in new_line_json()
469 if (os->prefix) in new_line_json()
470 fprintf(os->fh, "%s", os->prefix); in new_line_json()
471 aggr_printout(config, os->evsel, os->id, os->aggr_nr); in new_line_json()
489 struct outstate *os = ctx; in print_metricgroup_header_csv() local
494 for (i = 0; i < os->nfields - 2; i++) in print_metricgroup_header_csv()
495 fputs(config->csv_sep, os->fh); in print_metricgroup_header_csv()
499 for (i = 0; i < os->nfields; i++) in print_metricgroup_header_csv()
500 fputs(config->csv_sep, os->fh); in print_metricgroup_header_csv()
509 struct outstate *os = ctx; in print_metricgroup_header_std() local
513 __new_line_std(os); in print_metricgroup_header_std()
549 struct outstate *os = ctx; in print_metric_only() local
550 FILE *out = os->fh; in print_metric_only()
556 unit = fixunit(buf, os->evsel, unit); in print_metric_only()
565 os->first = false; in print_metric_only()
573 struct outstate *os = ctx; in print_metric_only_csv() local
574 FILE *out = os->fh; in print_metric_only_csv()
580 unit = fixunit(tbuf, os->evsel, unit); in print_metric_only_csv()
587 os->first = false; in print_metric_only_csv()
595 struct outstate *os = ctx; in print_metric_only_json() local
596 FILE *out = os->fh; in print_metric_only_json()
602 unit = fixunit(tbuf, os->evsel, unit); in print_metric_only_json()
610 fprintf(out, "%s\"%s\" : \"%s\"", os->first ? "" : ", ", unit, vals); in print_metric_only_json()
611 os->first = false; in print_metric_only_json()
624 struct outstate *os = ctx; in print_metric_header() local
629 os->evsel->priv != os->evsel->evlist->selected->priv) in print_metric_header()
632 if (os->evsel->cgrp != os->cgrp) in print_metric_header()
637 unit = fixunit(tbuf, os->evsel, unit); in print_metric_header()
642 fprintf(os->fh, "%s%s", unit, config->csv_sep); in print_metric_header()
644 fprintf(os->fh, "%*s ", config->metric_only_len, unit); in print_metric_header()
767 static void printout(struct perf_stat_config *config, struct outstate *os, in printout() argument
775 struct evsel *counter = os->evsel; in printout()
781 os->nfields = 4 + (counter->cgrp ? 1 : 0); in printout()
794 pm(config, os, NULL, "", "", 0); in printout()
812 out.ctx = os; in printout()
816 abs_printout(config, os->id, os->aggr_nr, counter, uval, ok); in printout()
826 aggr_printout(config, os->evsel, os->id, os->aggr_nr); in printout()
834 new_line_json(config, (void *)os); in printout()
836 __new_line_std_csv(config, os); in printout()
849 pm(config, os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); in printout()
957 struct outstate *os) in print_counter_aggrdata() argument
968 os->id = id; in print_counter_aggrdata()
969 os->aggr_nr = aggr->nr; in print_counter_aggrdata()
970 os->evsel = counter; in print_counter_aggrdata()
991 if (os->prefix) in print_counter_aggrdata()
992 fprintf(output, "%s", os->prefix); in print_counter_aggrdata()
1000 printout(config, os, uval, run, ena, avg, aggr_idx); in print_counter_aggrdata()
1008 struct outstate *os, int aggr_idx) in print_metric_begin() argument
1014 os->first = true; in print_metric_begin()
1020 if (os->prefix) in print_metric_begin()
1021 fprintf(config->output, "%s", os->prefix); in print_metric_begin()
1028 print_cgroup(config, os->cgrp ? : evsel->cgrp); in print_metric_begin()
1031 static void print_metric_end(struct perf_stat_config *config, struct outstate *os) in print_metric_end() argument
1039 if (os->first) in print_metric_end()
1048 struct outstate *os) in print_aggr() argument
1061 print_metric_begin(config, evlist, os, aggr_idx); in print_aggr()
1064 print_counter_aggrdata(config, counter, aggr_idx, os); in print_aggr()
1066 print_metric_end(config, os); in print_aggr()
1072 struct outstate *os) in print_aggr_cgroup() argument
1081 if (os->cgrp == evsel->cgrp) in print_aggr_cgroup()
1084 os->cgrp = evsel->cgrp; in print_aggr_cgroup()
1087 print_metric_begin(config, evlist, os, aggr_idx); in print_aggr_cgroup()
1090 if (counter->cgrp != os->cgrp) in print_aggr_cgroup()
1093 print_counter_aggrdata(config, counter, aggr_idx, os); in print_aggr_cgroup()
1095 print_metric_end(config, os); in print_aggr_cgroup()
1101 struct evsel *counter, struct outstate *os) in print_counter() argument
1110 print_counter_aggrdata(config, counter, aggr_idx, os); in print_counter()
1116 struct outstate *os) in print_no_aggr_metric() argument
1134 os->evsel = counter; in print_no_aggr_metric()
1135 os->id = aggr_cpu_id__cpu(cpu, /*data=*/NULL); in print_no_aggr_metric()
1137 print_metric_begin(config, evlist, os, aggr_idx); in print_no_aggr_metric()
1145 printout(config, os, uval, run, ena, 1.0, aggr_idx); in print_no_aggr_metric()
1148 print_metric_end(config, os); in print_no_aggr_metric()
1185 struct outstate os = { in print_metric_headers() local
1189 .ctx = &os, in print_metric_headers()
1206 os.cgrp = evlist__first(evlist)->cgrp; in print_metric_headers()
1214 os.evsel = counter; in print_metric_headers()
1464 struct evsel *counter, struct outstate *os) in print_percore() argument
1475 return print_counter(config, counter, os); in print_percore()
1501 print_counter_aggrdata(config, counter, aggr_idx, os); in print_percore()
1512 struct outstate *os) in print_cgroup_counter() argument
1517 if (os->cgrp != counter->cgrp) { in print_cgroup_counter()
1518 if (os->cgrp != NULL) in print_cgroup_counter()
1519 print_metric_end(config, os); in print_cgroup_counter()
1521 os->cgrp = counter->cgrp; in print_cgroup_counter()
1522 print_metric_begin(config, evlist, os, /*aggr_idx=*/0); in print_cgroup_counter()
1525 print_counter(config, counter, os); in print_cgroup_counter()
1527 if (os->cgrp) in print_cgroup_counter()
1528 print_metric_end(config, os); in print_cgroup_counter()
1539 struct outstate os = { in evlist__print_counters() local
1548 os.prefix = buf; in evlist__print_counters()
1561 print_aggr_cgroup(config, evlist, &os); in evlist__print_counters()
1563 print_aggr(config, evlist, &os); in evlist__print_counters()
1569 (iostat_print_counter_t)print_counter, &os); in evlist__print_counters()
1571 print_cgroup_counter(config, evlist, &os); in evlist__print_counters()
1573 print_metric_begin(config, evlist, &os, /*aggr_idx=*/0); in evlist__print_counters()
1575 print_counter(config, counter, &os); in evlist__print_counters()
1577 print_metric_end(config, &os); in evlist__print_counters()
1582 print_no_aggr_metric(config, evlist, &os); in evlist__print_counters()
1586 print_percore(config, counter, &os); in evlist__print_counters()
1588 print_counter(config, counter, &os); in evlist__print_counters()