Lines Matching refs:ctx
29 int ctx; member
57 if (a->ctx != b->ctx) in saved_value_cmp()
58 return a->ctx - b->ctx; in saved_value_cmp()
102 int ctx, in saved_value_lookup() argument
111 .ctx = ctx, in saved_value_lookup()
151 int ctx = 0; in evsel_context() local
154 ctx |= CTX_BIT_KERNEL; in evsel_context()
156 ctx |= CTX_BIT_USER; in evsel_context()
158 ctx |= CTX_BIT_HV; in evsel_context()
160 ctx |= CTX_BIT_HOST; in evsel_context()
162 ctx |= CTX_BIT_IDLE; in evsel_context()
164 return ctx; in evsel_context()
196 int ctx, int cpu, u64 count) in update_runtime_stat() argument
199 type, ctx, st); in update_runtime_stat()
213 int ctx = evsel_context(counter); in perf_stat__update_shadow_stats() local
222 update_runtime_stat(st, STAT_CYCLES, ctx, cpu, count); in perf_stat__update_shadow_stats()
224 update_runtime_stat(st, STAT_CYCLES_IN_TX, ctx, cpu, count); in perf_stat__update_shadow_stats()
226 update_runtime_stat(st, STAT_TRANSACTION, ctx, cpu, count); in perf_stat__update_shadow_stats()
228 update_runtime_stat(st, STAT_ELISION, ctx, cpu, count); in perf_stat__update_shadow_stats()
231 ctx, cpu, count); in perf_stat__update_shadow_stats()
234 ctx, cpu, count); in perf_stat__update_shadow_stats()
237 ctx, cpu, count); in perf_stat__update_shadow_stats()
240 ctx, cpu, count); in perf_stat__update_shadow_stats()
243 ctx, cpu, count); in perf_stat__update_shadow_stats()
246 ctx, cpu, count); in perf_stat__update_shadow_stats()
249 ctx, cpu, count); in perf_stat__update_shadow_stats()
252 ctx, cpu, count); in perf_stat__update_shadow_stats()
255 ctx, cpu, count); in perf_stat__update_shadow_stats()
258 ctx, cpu, count); in perf_stat__update_shadow_stats()
261 ctx, cpu, count); in perf_stat__update_shadow_stats()
263 update_runtime_stat(st, STAT_BRANCHES, ctx, cpu, count); in perf_stat__update_shadow_stats()
265 update_runtime_stat(st, STAT_CACHEREFS, ctx, cpu, count); in perf_stat__update_shadow_stats()
267 update_runtime_stat(st, STAT_L1_DCACHE, ctx, cpu, count); in perf_stat__update_shadow_stats()
269 update_runtime_stat(st, STAT_L1_ICACHE, ctx, cpu, count); in perf_stat__update_shadow_stats()
271 update_runtime_stat(st, STAT_LL_CACHE, ctx, cpu, count); in perf_stat__update_shadow_stats()
273 update_runtime_stat(st, STAT_DTLB_CACHE, ctx, cpu, count); in perf_stat__update_shadow_stats()
275 update_runtime_stat(st, STAT_ITLB_CACHE, ctx, cpu, count); in perf_stat__update_shadow_stats()
277 update_runtime_stat(st, STAT_SMI_NUM, ctx, cpu, count); in perf_stat__update_shadow_stats()
279 update_runtime_stat(st, STAT_APERF, ctx, cpu, count); in perf_stat__update_shadow_stats()
338 struct expr_parse_ctx ctx; in perf_stat__collect_metric_expr() local
343 expr__ctx_init(&ctx); in perf_stat__collect_metric_expr()
351 expr__ctx_clear(&ctx); in perf_stat__collect_metric_expr()
356 &ctx, 1) < 0) in perf_stat__collect_metric_expr()
360 hashmap__size(&ctx.ids) + 1); in perf_stat__collect_metric_expr()
362 expr__ctx_clear(&ctx); in perf_stat__collect_metric_expr()
369 hashmap__for_each_entry((&ctx.ids), cur, bkt) { in perf_stat__collect_metric_expr()
421 expr__ctx_clear(&ctx); in perf_stat__collect_metric_expr()
425 enum stat_type type, int ctx, int cpu) in runtime_stat_avg() argument
429 v = saved_value_lookup(NULL, cpu, false, type, ctx, st); in runtime_stat_avg()
437 enum stat_type type, int ctx, int cpu) in runtime_stat_n() argument
441 v = saved_value_lookup(NULL, cpu, false, type, ctx, st); in runtime_stat_n()
456 int ctx = evsel_context(evsel); in print_stalled_cycles_frontend() local
458 total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu); in print_stalled_cycles_frontend()
466 out->print_metric(config, out->ctx, color, "%7.2f%%", "frontend cycles idle", in print_stalled_cycles_frontend()
469 out->print_metric(config, out->ctx, NULL, NULL, "frontend cycles idle", 0); in print_stalled_cycles_frontend()
480 int ctx = evsel_context(evsel); in print_stalled_cycles_backend() local
482 total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu); in print_stalled_cycles_backend()
489 out->print_metric(config, out->ctx, color, "%7.2f%%", "backend cycles idle", ratio); in print_stalled_cycles_backend()
501 int ctx = evsel_context(evsel); in print_branch_misses() local
503 total = runtime_stat_avg(st, STAT_BRANCHES, ctx, cpu); in print_branch_misses()
510 out->print_metric(config, out->ctx, color, "%7.2f%%", "of all branches", ratio); in print_branch_misses()
523 int ctx = evsel_context(evsel); in print_l1_dcache_misses() local
525 total = runtime_stat_avg(st, STAT_L1_DCACHE, ctx, cpu); in print_l1_dcache_misses()
532 out->print_metric(config, out->ctx, color, "%7.2f%%", "of all L1-dcache accesses", ratio); in print_l1_dcache_misses()
545 int ctx = evsel_context(evsel); in print_l1_icache_misses() local
547 total = runtime_stat_avg(st, STAT_L1_ICACHE, ctx, cpu); in print_l1_icache_misses()
553 out->print_metric(config, out->ctx, color, "%7.2f%%", "of all L1-icache accesses", ratio); in print_l1_icache_misses()
565 int ctx = evsel_context(evsel); in print_dtlb_cache_misses() local
567 total = runtime_stat_avg(st, STAT_DTLB_CACHE, ctx, cpu); in print_dtlb_cache_misses()
573 out->print_metric(config, out->ctx, color, "%7.2f%%", "of all dTLB cache accesses", ratio); in print_dtlb_cache_misses()
585 int ctx = evsel_context(evsel); in print_itlb_cache_misses() local
587 total = runtime_stat_avg(st, STAT_ITLB_CACHE, ctx, cpu); in print_itlb_cache_misses()
593 out->print_metric(config, out->ctx, color, "%7.2f%%", "of all iTLB cache accesses", ratio); in print_itlb_cache_misses()
605 int ctx = evsel_context(evsel); in print_ll_cache_misses() local
607 total = runtime_stat_avg(st, STAT_LL_CACHE, ctx, cpu); in print_ll_cache_misses()
613 out->print_metric(config, out->ctx, color, "%7.2f%%", "of all LL-cache accesses", ratio); in print_ll_cache_misses()
665 static double td_total_slots(int ctx, int cpu, struct runtime_stat *st) in td_total_slots() argument
667 return runtime_stat_avg(st, STAT_TOPDOWN_TOTAL_SLOTS, ctx, cpu); in td_total_slots()
670 static double td_bad_spec(int ctx, int cpu, struct runtime_stat *st) in td_bad_spec() argument
676 total = runtime_stat_avg(st, STAT_TOPDOWN_SLOTS_ISSUED, ctx, cpu) - in td_bad_spec()
677 runtime_stat_avg(st, STAT_TOPDOWN_SLOTS_RETIRED, ctx, cpu) + in td_bad_spec()
678 runtime_stat_avg(st, STAT_TOPDOWN_RECOVERY_BUBBLES, ctx, cpu); in td_bad_spec()
680 total_slots = td_total_slots(ctx, cpu, st); in td_bad_spec()
686 static double td_retiring(int ctx, int cpu, struct runtime_stat *st) in td_retiring() argument
689 double total_slots = td_total_slots(ctx, cpu, st); in td_retiring()
691 ctx, cpu); in td_retiring()
698 static double td_fe_bound(int ctx, int cpu, struct runtime_stat *st) in td_fe_bound() argument
701 double total_slots = td_total_slots(ctx, cpu, st); in td_fe_bound()
703 ctx, cpu); in td_fe_bound()
710 static double td_be_bound(int ctx, int cpu, struct runtime_stat *st) in td_be_bound() argument
712 double sum = (td_fe_bound(ctx, cpu, st) + in td_be_bound()
713 td_bad_spec(ctx, cpu, st) + in td_be_bound()
714 td_retiring(ctx, cpu, st)); in td_be_bound()
725 static double td_metric_ratio(int ctx, int cpu, in td_metric_ratio() argument
729 double sum = runtime_stat_avg(stat, STAT_TOPDOWN_RETIRING, ctx, cpu) + in td_metric_ratio()
730 runtime_stat_avg(stat, STAT_TOPDOWN_FE_BOUND, ctx, cpu) + in td_metric_ratio()
731 runtime_stat_avg(stat, STAT_TOPDOWN_BE_BOUND, ctx, cpu) + in td_metric_ratio()
732 runtime_stat_avg(stat, STAT_TOPDOWN_BAD_SPEC, ctx, cpu); in td_metric_ratio()
733 double d = runtime_stat_avg(stat, type, ctx, cpu); in td_metric_ratio()
745 static bool full_td(int ctx, int cpu, in full_td() argument
750 if (runtime_stat_avg(stat, STAT_TOPDOWN_RETIRING, ctx, cpu) > 0) in full_td()
752 if (runtime_stat_avg(stat, STAT_TOPDOWN_BE_BOUND, ctx, cpu) > 0) in full_td()
754 if (runtime_stat_avg(stat, STAT_TOPDOWN_FE_BOUND, ctx, cpu) > 0) in full_td()
756 if (runtime_stat_avg(stat, STAT_TOPDOWN_BAD_SPEC, ctx, cpu) > 0) in full_td()
767 int ctx = evsel_context(evsel); in print_smi_cost() local
770 smi_num = runtime_stat_avg(st, STAT_SMI_NUM, ctx, cpu); in print_smi_cost()
771 aperf = runtime_stat_avg(st, STAT_APERF, ctx, cpu); in print_smi_cost()
772 cycles = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu); in print_smi_cost()
782 out->print_metric(config, out->ctx, color, "%8.1f%%", "SMI cycles%", cost); in print_smi_cost()
783 out->print_metric(config, out->ctx, NULL, "%4.0f", "SMI#", smi_num); in print_smi_cost()
860 void *ctxp = out->ctx; in generic_metric()
929 void *ctxp = out->ctx; in perf_stat__print_shadow_stats()
933 int ctx = evsel_context(evsel); in perf_stat__print_shadow_stats() local
938 total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu); in perf_stat__print_shadow_stats()
949 ctx, cpu); in perf_stat__print_shadow_stats()
953 ctx, cpu)); in perf_stat__print_shadow_stats()
963 if (runtime_stat_n(st, STAT_BRANCHES, ctx, cpu) != 0) in perf_stat__print_shadow_stats()
973 if (runtime_stat_n(st, STAT_L1_DCACHE, ctx, cpu) != 0) in perf_stat__print_shadow_stats()
983 if (runtime_stat_n(st, STAT_L1_ICACHE, ctx, cpu) != 0) in perf_stat__print_shadow_stats()
993 if (runtime_stat_n(st, STAT_DTLB_CACHE, ctx, cpu) != 0) in perf_stat__print_shadow_stats()
1003 if (runtime_stat_n(st, STAT_ITLB_CACHE, ctx, cpu) != 0) in perf_stat__print_shadow_stats()
1013 if (runtime_stat_n(st, STAT_LL_CACHE, ctx, cpu) != 0) in perf_stat__print_shadow_stats()
1018 total = runtime_stat_avg(st, STAT_CACHEREFS, ctx, cpu); in perf_stat__print_shadow_stats()
1023 if (runtime_stat_n(st, STAT_CACHEREFS, ctx, cpu) != 0) in perf_stat__print_shadow_stats()
1042 total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu); in perf_stat__print_shadow_stats()
1052 total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu); in perf_stat__print_shadow_stats()
1053 total2 = runtime_stat_avg(st, STAT_CYCLES_IN_TX, ctx, cpu); in perf_stat__print_shadow_stats()
1064 ctx, cpu); in perf_stat__print_shadow_stats()
1069 if (runtime_stat_n(st, STAT_CYCLES_IN_TX, ctx, cpu) != 0) in perf_stat__print_shadow_stats()
1077 ctx, cpu); in perf_stat__print_shadow_stats()
1090 double fe_bound = td_fe_bound(ctx, cpu, st); in perf_stat__print_shadow_stats()
1097 double retiring = td_retiring(ctx, cpu, st); in perf_stat__print_shadow_stats()
1104 double bad_spec = td_bad_spec(ctx, cpu, st); in perf_stat__print_shadow_stats()
1111 double be_bound = td_be_bound(ctx, cpu, st); in perf_stat__print_shadow_stats()
1124 if (td_total_slots(ctx, cpu, st) > 0) in perf_stat__print_shadow_stats()
1130 full_td(ctx, cpu, st)) { in perf_stat__print_shadow_stats()
1131 double retiring = td_metric_ratio(ctx, cpu, in perf_stat__print_shadow_stats()
1139 full_td(ctx, cpu, st)) { in perf_stat__print_shadow_stats()
1140 double fe_bound = td_metric_ratio(ctx, cpu, in perf_stat__print_shadow_stats()
1148 full_td(ctx, cpu, st)) { in perf_stat__print_shadow_stats()
1149 double be_bound = td_metric_ratio(ctx, cpu, in perf_stat__print_shadow_stats()
1157 full_td(ctx, cpu, st)) { in perf_stat__print_shadow_stats()
1158 double bad_spec = td_metric_ratio(ctx, cpu, in perf_stat__print_shadow_stats()