Lines Matching refs:counter

384 static bool is_mixed_hw_group(struct evsel *counter)  in is_mixed_hw_group()  argument
386 struct evlist *evlist = counter->evlist; in is_mixed_hw_group()
387 u32 pmu_type = counter->core.attr.type; in is_mixed_hw_group()
390 if (counter->core.nr_members < 2) in is_mixed_hw_group()
409 struct evsel *counter, double uval, in printout() argument
419 .evsel = counter, in printout()
447 if (counter->cgrp) in printout()
456 if (run == 0 || ena == 0 || counter->counts->scaled == -1) { in printout()
461 aggr_printout(config, counter, id, nr); in printout()
465 counter->supported ? CNTR_NOT_COUNTED : CNTR_NOT_SUPPORTED, in printout()
468 if (counter->supported) { in printout()
469 if (!evlist__has_hybrid(counter->evlist)) { in printout()
471 if (is_mixed_hw_group(counter)) in printout()
478 counter->unit, config->csv_sep); in printout()
481 config->csv_output ? 0 : -25, evsel__name(counter)); in printout()
483 print_cgroup(config, counter); in printout()
487 print_noise(config, counter, noise); in printout()
495 abs_printout(config, id, nr, counter, uval); in printout()
503 print_noise(config, counter, noise); in printout()
507 perf_stat__print_shadow_stats(config, counter, uval, in printout()
508 first_shadow_cpu(config, counter, id), in printout()
511 print_noise(config, counter, noise); in printout()
522 struct evsel *counter; in aggr_update_shadow() local
526 evlist__for_each_entry(evlist, counter) { in aggr_update_shadow()
528 for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { in aggr_update_shadow()
532 val += perf_counts(counter->counts, cpu, 0)->val; in aggr_update_shadow()
534 perf_stat__update_shadow_stats(counter, val, in aggr_update_shadow()
535 first_shadow_cpu(config, counter, id), in aggr_update_shadow()
541 static void uniquify_event_name(struct evsel *counter) in uniquify_event_name() argument
547 if (counter->uniquified_name || counter->use_config_name || in uniquify_event_name()
548 !counter->pmu_name || !strncmp(counter->name, counter->pmu_name, in uniquify_event_name()
549 strlen(counter->pmu_name))) in uniquify_event_name()
552 config = strchr(counter->name, '/'); in uniquify_event_name()
555 "%s%s", counter->pmu_name, config) > 0) { in uniquify_event_name()
556 free(counter->name); in uniquify_event_name()
557 counter->name = new_name; in uniquify_event_name()
562 counter->pmu_name, counter->name); in uniquify_event_name()
565 counter->name, counter->pmu_name); in uniquify_event_name()
569 free(counter->name); in uniquify_event_name()
570 counter->name = new_name; in uniquify_event_name()
574 counter->uniquified_name = true; in uniquify_event_name()
577 static void collect_all_aliases(struct perf_stat_config *config, struct evsel *counter, in collect_all_aliases() argument
578 void (*cb)(struct perf_stat_config *config, struct evsel *counter, void *data, in collect_all_aliases()
582 struct evlist *evlist = counter->evlist; in collect_all_aliases()
585 alias = list_prepare_entry(counter, &(evlist->core.entries), core.node); in collect_all_aliases()
587 if (strcmp(evsel__name(alias), evsel__name(counter)) || in collect_all_aliases()
588 alias->scale != counter->scale || in collect_all_aliases()
589 alias->cgrp != counter->cgrp || in collect_all_aliases()
590 strcmp(alias->unit, counter->unit) || in collect_all_aliases()
591 evsel__is_clock(alias) != evsel__is_clock(counter) || in collect_all_aliases()
592 !strcmp(alias->pmu_name, counter->pmu_name)) in collect_all_aliases()
611 static bool collect_data(struct perf_stat_config *config, struct evsel *counter, in collect_data() argument
612 void (*cb)(struct perf_stat_config *config, struct evsel *counter, void *data, in collect_data()
616 if (counter->merged_stat) in collect_data()
618 cb(config, counter, data, true); in collect_data()
619 if (config->no_merge || hybrid_uniquify(counter)) in collect_data()
620 uniquify_event_name(counter); in collect_data()
621 else if (counter->auto_merge_stats) in collect_data()
622 collect_all_aliases(config, counter, cb, data); in collect_data()
634 struct evsel *counter, void *data, bool first) in aggr_cb() argument
640 for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { in aggr_cb()
643 s2 = config->aggr_get_id(config, evsel__cpus(counter), cpu); in aggr_cb()
648 counts = perf_counts(counter->counts, cpu, 0); in aggr_cb()
654 counter->counts->scaled == -1) { in aggr_cb()
666 struct evsel *counter, int s, in print_counter_aggrdata() argument
680 if (!collect_data(config, counter, aggr_cb, &ad)) in print_counter_aggrdata()
692 aggr_printout(config, counter, id, nr); in print_counter_aggrdata()
697 uval = val * counter->scale; in print_counter_aggrdata()
702 printout(config, id, nr, counter, uval, in print_counter_aggrdata()
714 struct evsel *counter; in print_aggr() local
732 evlist__for_each_entry(evlist, counter) { in print_aggr()
733 print_counter_aggrdata(config, counter, s, in print_aggr()
749 struct evsel *counter, in sort_aggr_thread() argument
766 val += perf_counts(counter->counts, cpu, thread)->val; in sort_aggr_thread()
767 ena += perf_counts(counter->counts, cpu, thread)->ena; in sort_aggr_thread()
768 run += perf_counts(counter->counts, cpu, thread)->run; in sort_aggr_thread()
771 uval = val * counter->scale; in sort_aggr_thread()
780 buf[i].counter = counter; in sort_aggr_thread()
800 struct evsel *counter, char *prefix) in print_aggr_thread() argument
803 int nthreads = perf_thread_map__nr(counter->core.threads); in print_aggr_thread()
804 int ncpus = perf_cpu_map__nr(counter->core.cpus); in print_aggr_thread()
809 buf = sort_aggr_thread(counter, nthreads, ncpus, &sorted_threads, _target); in print_aggr_thread()
821 printout(config, id, 0, buf[thread].counter, buf[thread].uval, in print_aggr_thread()
825 printout(config, id, 0, buf[thread].counter, buf[thread].uval, in print_aggr_thread()
839 struct evsel *counter, void *data, in counter_aggr_cb() argument
843 struct perf_counts_values *aggr = &counter->counts->aggr; in counter_aggr_cb()
855 struct evsel *counter, char *prefix) in print_counter_aggr() argument
862 if (!collect_data(config, counter, counter_aggr_cb, &cd)) in print_counter_aggr()
868 uval = cd.avg * counter->scale; in print_counter_aggr()
869 printout(config, cpu_map__empty_aggr_cpu_id(), 0, counter, uval, prefix, cd.avg_running, in print_counter_aggr()
876 struct evsel *counter, void *data, in counter_cb() argument
881 ad->val += perf_counts(counter->counts, ad->cpu, 0)->val; in counter_cb()
882 ad->ena += perf_counts(counter->counts, ad->cpu, 0)->ena; in counter_cb()
883 ad->run += perf_counts(counter->counts, ad->cpu, 0)->run; in counter_cb()
891 struct evsel *counter, char *prefix) in print_counter() argument
899 for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { in print_counter()
902 if (!collect_data(config, counter, counter_cb, &ad)) in print_counter()
911 uval = val * counter->scale; in print_counter()
914 printout(config, id, 0, counter, uval, prefix, in print_counter()
927 struct evsel *counter; in print_no_aggr_metric() local
938 evlist__for_each_entry(evlist, counter) { in print_no_aggr_metric()
942 aggr_printout(config, counter, id, 0); in print_no_aggr_metric()
945 val = perf_counts(counter->counts, cpu, 0)->val; in print_no_aggr_metric()
946 ena = perf_counts(counter->counts, cpu, 0)->ena; in print_no_aggr_metric()
947 run = perf_counts(counter->counts, cpu, 0)->run; in print_no_aggr_metric()
949 uval = val * counter->scale; in print_no_aggr_metric()
950 printout(config, id, 0, counter, uval, prefix, in print_no_aggr_metric()
980 struct evsel *counter; in print_metric_headers() local
1001 evlist__for_each_entry(evlist, counter) { in print_metric_headers()
1002 os.evsel = counter; in print_metric_headers()
1007 perf_stat__print_shadow_stats(config, counter, 0, in print_metric_headers()
1207 struct evsel *counter, char *prefix) in print_percore_thread() argument
1213 for (int i = 0; i < evsel__nr_cpus(counter); i++) { in print_percore_thread()
1214 s2 = config->aggr_get_id(config, evsel__cpus(counter), i); in print_percore_thread()
1221 print_counter_aggrdata(config, counter, s, in print_percore_thread()
1228 struct evsel *counter, char *prefix) in print_percore() argument
1239 return print_percore_thread(config, counter, prefix); in print_percore()
1245 print_counter_aggrdata(config, counter, s, in print_percore()
1259 struct evsel *counter; in evlist__print_counters() local
1289 evlist__for_each_entry(evlist, counter) { in evlist__print_counters()
1290 print_aggr_thread(config, _target, counter, prefix); in evlist__print_counters()
1298 evlist__for_each_entry(evlist, counter) { in evlist__print_counters()
1299 print_counter_aggr(config, counter, prefix); in evlist__print_counters()
1309 evlist__for_each_entry(evlist, counter) { in evlist__print_counters()
1310 if (counter->percore) in evlist__print_counters()
1311 print_percore(config, counter, prefix); in evlist__print_counters()
1313 print_counter(config, counter, prefix); in evlist__print_counters()