Lines Matching full:os
377 struct outstate *os = ctx; in new_line_std() local
379 os->newline = true; in new_line_std()
383 struct outstate *os) in __new_line_std_csv() argument
385 fputc('\n', os->fh); in __new_line_std_csv()
386 if (os->prefix) in __new_line_std_csv()
387 fputs(os->prefix, os->fh); in __new_line_std_csv()
388 aggr_printout(config, os->evsel, os->id, os->aggr_nr); in __new_line_std_csv()
391 static inline void __new_line_std(struct outstate *os) in __new_line_std() argument
393 fprintf(os->fh, " "); in __new_line_std()
397 struct outstate *os) in do_new_line_std() argument
399 __new_line_std_csv(config, os); in do_new_line_std()
401 fprintf(os->fh, " "); in do_new_line_std()
402 __new_line_std(os); in do_new_line_std()
409 struct outstate *os = ctx; in print_metric_std() local
410 FILE *out = os->fh; in print_metric_std()
412 bool newline = os->newline; in print_metric_std()
414 os->newline = false; in print_metric_std()
422 do_new_line_std(config, os); in print_metric_std()
434 struct outstate *os = ctx; in new_line_csv() local
437 __new_line_std_csv(config, os); in new_line_csv()
438 for (i = 0; i < os->nfields; i++) in new_line_csv()
439 fputs(config->csv_sep, os->fh); in new_line_csv()
447 struct outstate *os = ctx; in print_metric_csv() local
448 FILE *out = os->fh; in print_metric_csv()
469 struct outstate *os = ctx; in print_metric_json() local
470 FILE *out = os->fh; in print_metric_json()
480 struct outstate *os = ctx; in new_line_json() local
482 fputs("\n{", os->fh); in new_line_json()
483 if (os->prefix) in new_line_json()
484 fprintf(os->fh, "%s", os->prefix); in new_line_json()
485 aggr_printout(config, os->evsel, os->id, os->aggr_nr); in new_line_json()
503 struct outstate *os = ctx; in print_metricgroup_header_csv() local
508 for (i = 0; i < os->nfields - 2; i++) in print_metricgroup_header_csv()
509 fputs(config->csv_sep, os->fh); in print_metricgroup_header_csv()
513 for (i = 0; i < os->nfields; i++) in print_metricgroup_header_csv()
514 fputs(config->csv_sep, os->fh); in print_metricgroup_header_csv()
523 struct outstate *os = ctx; in print_metricgroup_header_std() local
527 __new_line_std(os); in print_metricgroup_header_std()
563 struct outstate *os = ctx; in print_metric_only() local
564 FILE *out = os->fh; in print_metric_only()
570 unit = fixunit(buf, os->evsel, unit); in print_metric_only()
579 os->first = false; in print_metric_only()
587 struct outstate *os = ctx; in print_metric_only_csv() local
588 FILE *out = os->fh; in print_metric_only_csv()
594 unit = fixunit(tbuf, os->evsel, unit); in print_metric_only_csv()
601 os->first = false; in print_metric_only_csv()
609 struct outstate *os = ctx; in print_metric_only_json() local
610 FILE *out = os->fh; in print_metric_only_json()
616 unit = fixunit(tbuf, os->evsel, unit); in print_metric_only_json()
624 fprintf(out, "%s\"%s\" : \"%s\"", os->first ? "" : ", ", unit, vals); in print_metric_only_json()
625 os->first = false; in print_metric_only_json()
638 struct outstate *os = ctx; in print_metric_header() local
643 os->evsel->priv != os->evsel->evlist->selected->priv) in print_metric_header()
646 if (os->evsel->cgrp != os->cgrp) in print_metric_header()
651 unit = fixunit(tbuf, os->evsel, unit); in print_metric_header()
656 fprintf(os->fh, "%s%s", unit, config->csv_sep); in print_metric_header()
658 fprintf(os->fh, "%*s ", config->metric_only_len, unit); in print_metric_header()
781 static void printout(struct perf_stat_config *config, struct outstate *os, in printout() argument
789 struct evsel *counter = os->evsel; in printout()
795 os->nfields = 4 + (counter->cgrp ? 1 : 0); in printout()
808 pm(config, os, NULL, "", "", 0); in printout()
826 out.ctx = os; in printout()
830 abs_printout(config, os->id, os->aggr_nr, counter, uval, ok); in printout()
840 aggr_printout(config, os->evsel, os->id, os->aggr_nr); in printout()
848 new_line_json(config, (void *)os); in printout()
850 __new_line_std_csv(config, os); in printout()
863 pm(config, os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); in printout()
971 struct outstate *os) in print_counter_aggrdata() argument
982 os->id = id; in print_counter_aggrdata()
983 os->aggr_nr = aggr->nr; in print_counter_aggrdata()
984 os->evsel = counter; in print_counter_aggrdata()
1005 if (os->prefix) in print_counter_aggrdata()
1006 fprintf(output, "%s", os->prefix); in print_counter_aggrdata()
1014 printout(config, os, uval, run, ena, avg, aggr_idx); in print_counter_aggrdata()
1022 struct outstate *os, int aggr_idx) in print_metric_begin() argument
1028 os->first = true; in print_metric_begin()
1034 if (os->prefix) in print_metric_begin()
1035 fprintf(config->output, "%s", os->prefix); in print_metric_begin()
1042 print_cgroup(config, os->cgrp ? : evsel->cgrp); in print_metric_begin()
1045 static void print_metric_end(struct perf_stat_config *config, struct outstate *os) in print_metric_end() argument
1053 if (os->first) in print_metric_end()
1062 struct outstate *os) in print_aggr() argument
1075 print_metric_begin(config, evlist, os, aggr_idx); in print_aggr()
1078 print_counter_aggrdata(config, counter, aggr_idx, os); in print_aggr()
1080 print_metric_end(config, os); in print_aggr()
1086 struct outstate *os) in print_aggr_cgroup() argument
1095 if (os->cgrp == evsel->cgrp) in print_aggr_cgroup()
1098 os->cgrp = evsel->cgrp; in print_aggr_cgroup()
1101 print_metric_begin(config, evlist, os, aggr_idx); in print_aggr_cgroup()
1104 if (counter->cgrp != os->cgrp) in print_aggr_cgroup()
1107 print_counter_aggrdata(config, counter, aggr_idx, os); in print_aggr_cgroup()
1109 print_metric_end(config, os); in print_aggr_cgroup()
1115 struct evsel *counter, struct outstate *os) in print_counter() argument
1124 print_counter_aggrdata(config, counter, aggr_idx, os); in print_counter()
1130 struct outstate *os) in print_no_aggr_metric() argument
1153 os->evsel = counter; in print_no_aggr_metric()
1154 os->id = aggr_cpu_id__cpu(cpu, /*data=*/NULL); in print_no_aggr_metric()
1156 print_metric_begin(config, evlist, os, aggr_idx); in print_no_aggr_metric()
1164 printout(config, os, uval, run, ena, 1.0, aggr_idx); in print_no_aggr_metric()
1167 print_metric_end(config, os); in print_no_aggr_metric()
1215 struct outstate os = { in print_metric_headers() local
1219 .ctx = &os, in print_metric_headers()
1236 os.cgrp = evlist__first(evlist)->cgrp; in print_metric_headers()
1244 os.evsel = counter; in print_metric_headers()
1495 struct evsel *counter, struct outstate *os) in print_percore() argument
1506 return print_counter(config, counter, os); in print_percore()
1532 print_counter_aggrdata(config, counter, aggr_idx, os); in print_percore()
1543 struct outstate *os) in print_cgroup_counter() argument
1548 if (os->cgrp != counter->cgrp) { in print_cgroup_counter()
1549 if (os->cgrp != NULL) in print_cgroup_counter()
1550 print_metric_end(config, os); in print_cgroup_counter()
1552 os->cgrp = counter->cgrp; in print_cgroup_counter()
1553 print_metric_begin(config, evlist, os, /*aggr_idx=*/0); in print_cgroup_counter()
1556 print_counter(config, counter, os); in print_cgroup_counter()
1558 if (os->cgrp) in print_cgroup_counter()
1559 print_metric_end(config, os); in print_cgroup_counter()
1570 struct outstate os = { in evlist__print_counters() local
1579 os.prefix = buf; in evlist__print_counters()
1593 print_aggr_cgroup(config, evlist, &os); in evlist__print_counters()
1595 print_aggr(config, evlist, &os); in evlist__print_counters()
1601 (iostat_print_counter_t)print_counter, &os); in evlist__print_counters()
1603 print_cgroup_counter(config, evlist, &os); in evlist__print_counters()
1605 print_metric_begin(config, evlist, &os, /*aggr_idx=*/0); in evlist__print_counters()
1607 print_counter(config, counter, &os); in evlist__print_counters()
1609 print_metric_end(config, &os); in evlist__print_counters()
1614 print_no_aggr_metric(config, evlist, &os); in evlist__print_counters()
1618 print_percore(config, counter, &os); in evlist__print_counters()
1620 print_counter(config, counter, &os); in evlist__print_counters()