Lines Matching full:sample

499 		pr_err("Display of symbols requested but neither sample IP nor "  in evsel__check_attr()
500 "sample address\navailable. Hence, no addresses to convert " in evsel__check_attr()
515 pr_err("Display of source line number requested but sample IP is not\n" in evsel__check_attr()
775 static int perf_sample__fprintf_iregs(struct perf_sample *sample, in perf_sample__fprintf_iregs() argument
778 return perf_sample__fprintf_regs(&sample->intr_regs, in perf_sample__fprintf_iregs()
782 static int perf_sample__fprintf_uregs(struct perf_sample *sample, in perf_sample__fprintf_uregs() argument
785 return perf_sample__fprintf_regs(&sample->user_regs, in perf_sample__fprintf_uregs()
790 struct perf_sample *sample, in perf_sample__fprintf_start() argument
814 if (PRINT_FIELD(MACHINE_PID) && sample->machine_pid) in perf_sample__fprintf_start()
815 printed += fprintf(fp, "VM:%5d ", sample->machine_pid); in perf_sample__fprintf_start()
818 if (PRINT_FIELD(VCPU) && sample->machine_pid) in perf_sample__fprintf_start()
819 printed += fprintf(fp, "VCPU:%03d ", sample->vcpu); in perf_sample__fprintf_start()
833 printed += fprintf(fp, "%7d/%-7d ", sample->pid, sample->tid); in perf_sample__fprintf_start()
835 printed += fprintf(fp, "%7d ", sample->pid); in perf_sample__fprintf_start()
837 printed += fprintf(fp, "%7d ", sample->tid); in perf_sample__fprintf_start()
841 printed += fprintf(fp, "%3d ", sample->cpu); in perf_sample__fprintf_start()
843 printed += fprintf(fp, "[%03d] ", sample->cpu); in perf_sample__fprintf_start()
850 (sample->misc & PERF_RECORD_MISC_##m) == PERF_RECORD_MISC_##m in perf_sample__fprintf_start()
877 if (sample->misc & PERF_RECORD_MISC_SWITCH_OUT_PREEMPT) in perf_sample__fprintf_start()
891 tod_scnprintf(script, tstr, sizeof(tstr), sample->time); in perf_sample__fprintf_start()
896 u64 t = sample->time; in perf_sample__fprintf_start()
899 initial_time = sample->time; in perf_sample__fprintf_start()
900 t = sample->time - initial_time; in perf_sample__fprintf_start()
903 t = sample->time - previous_time; in perf_sample__fprintf_start()
907 previous_time = sample->time; in perf_sample__fprintf_start()
945 static int perf_sample__fprintf_brstack(struct perf_sample *sample, in perf_sample__fprintf_brstack() argument
949 struct branch_stack *br = sample->branch_stack; in perf_sample__fprintf_brstack()
950 struct branch_entry *entries = perf_sample__branch_entries(sample); in perf_sample__fprintf_brstack()
967 thread__find_map_fb(thread, sample->cpumode, from, &alf); in perf_sample__fprintf_brstack()
968 thread__find_map_fb(thread, sample->cpumode, to, &alt); in perf_sample__fprintf_brstack()
984 static int perf_sample__fprintf_brstacksym(struct perf_sample *sample, in perf_sample__fprintf_brstacksym() argument
988 struct branch_stack *br = sample->branch_stack; in perf_sample__fprintf_brstacksym()
989 struct branch_entry *entries = perf_sample__branch_entries(sample); in perf_sample__fprintf_brstacksym()
1004 thread__find_symbol_fb(thread, sample->cpumode, from, &alf); in perf_sample__fprintf_brstacksym()
1005 thread__find_symbol_fb(thread, sample->cpumode, to, &alt); in perf_sample__fprintf_brstacksym()
1022 static int perf_sample__fprintf_brstackoff(struct perf_sample *sample, in perf_sample__fprintf_brstackoff() argument
1026 struct branch_stack *br = sample->branch_stack; in perf_sample__fprintf_brstackoff()
1027 struct branch_entry *entries = perf_sample__branch_entries(sample); in perf_sample__fprintf_brstackoff()
1042 if (thread__find_map_fb(thread, sample->cpumode, from, &alf) && in perf_sample__fprintf_brstackoff()
1046 if (thread__find_map_fb(thread, sample->cpumode, to, &alt) && in perf_sample__fprintf_brstackoff()
1321 static int perf_sample__fprintf_brstackinsn(struct perf_sample *sample, in perf_sample__fprintf_brstackinsn() argument
1327 struct branch_stack *br = sample->branch_stack; in perf_sample__fprintf_brstackinsn()
1328 struct branch_entry *entries = perf_sample__branch_entries(sample); in perf_sample__fprintf_brstackinsn()
1346 x.cpu = sample->cpu; in perf_sample__fprintf_brstackinsn()
1348 if (PRINT_FIELD(BRCNTR) && sample->branch_stack_cntr) in perf_sample__fprintf_brstackinsn()
1349 br_cntr = sample->branch_stack_cntr[nr - 1]; in perf_sample__fprintf_brstackinsn()
1392 if (PRINT_FIELD(BRCNTR) && sample->branch_stack_cntr) in perf_sample__fprintf_brstackinsn()
1393 br_cntr = sample->branch_stack_cntr[i]; in perf_sample__fprintf_brstackinsn()
1421 if (entries[0].from == sample->ip) in perf_sample__fprintf_brstackinsn()
1427 * Print final block up to sample in perf_sample__fprintf_brstackinsn()
1431 * between final branch and sample. When this happens just in perf_sample__fprintf_brstackinsn()
1435 end = sample->ip; in perf_sample__fprintf_brstackinsn()
1444 len = grab_bb(buffer, sample->ip, sample->ip, in perf_sample__fprintf_brstackinsn()
1449 printed += fprintf(fp, "\t%016" PRIx64 "\t", sample->ip); in perf_sample__fprintf_brstackinsn()
1450 printed += any_dump_insn(attr, &x, sample->ip, buffer, len, &ilen, fp); in perf_sample__fprintf_brstackinsn()
1455 print_srccode(thread, x.cpumode, sample->ip); in perf_sample__fprintf_brstackinsn()
1469 && start + off != sample->ip) { in perf_sample__fprintf_brstackinsn()
1473 printed += fprintf(fp, "\t... not reaching sample ...\n"); in perf_sample__fprintf_brstackinsn()
1483 static int perf_sample__fprintf_addr(struct perf_sample *sample, in perf_sample__fprintf_addr() argument
1488 int printed = fprintf(fp, "%16" PRIx64, sample->addr); in perf_sample__fprintf_addr()
1494 thread__resolve(thread, &al, sample); in perf_sample__fprintf_addr()
1511 static const char *resolve_branch_sym(struct perf_sample *sample, in resolve_branch_sym() argument
1521 if (sample->flags & (PERF_IP_FLAG_CALL | PERF_IP_FLAG_TRACE_BEGIN)) { in resolve_branch_sym()
1524 thread__resolve(thread, addr_al, sample); in resolve_branch_sym()
1528 *ip = sample->addr; in resolve_branch_sym()
1530 *ip = sample->addr; in resolve_branch_sym()
1532 } else if (sample->flags & (PERF_IP_FLAG_RETURN | PERF_IP_FLAG_TRACE_END)) { in resolve_branch_sym()
1536 *ip = sample->ip; in resolve_branch_sym()
1541 static int perf_sample__fprintf_callindent(struct perf_sample *sample, in perf_sample__fprintf_callindent() argument
1549 size_t depth = thread_stack__depth(thread, sample->cpu); in perf_sample__fprintf_callindent()
1560 if (thread__ts(thread) && sample->flags & PERF_IP_FLAG_RETURN) in perf_sample__fprintf_callindent()
1563 name = resolve_branch_sym(sample, evsel, thread, al, addr_al, &ip); in perf_sample__fprintf_callindent()
1592 __weak void arch_fetch_insn(struct perf_sample *sample __maybe_unused, in arch_fetch_insn()
1598 void script_fetch_insn(struct perf_sample *sample, struct thread *thread, in script_fetch_insn() argument
1601 if (sample->insn_len == 0 && native_arch) in script_fetch_insn()
1602 arch_fetch_insn(sample, thread, machine); in script_fetch_insn()
1605 static int perf_sample__fprintf_insn(struct perf_sample *sample, in perf_sample__fprintf_insn() argument
1614 script_fetch_insn(sample, thread, machine); in perf_sample__fprintf_insn()
1617 printed += fprintf(fp, " ilen: %d", sample->insn_len); in perf_sample__fprintf_insn()
1618 if (PRINT_FIELD(INSN) && sample->insn_len) { in perf_sample__fprintf_insn()
1620 printed += sample__fprintf_insn_raw(sample, fp); in perf_sample__fprintf_insn()
1622 if (PRINT_FIELD(DISASM) && sample->insn_len) { in perf_sample__fprintf_insn()
1624 printed += sample__fprintf_insn_asm(sample, thread, machine, fp, al); in perf_sample__fprintf_insn()
1627 printed += perf_sample__fprintf_brstackinsn(sample, evsel, thread, attr, machine, fp); in perf_sample__fprintf_insn()
1632 static int perf_sample__fprintf_ipc(struct perf_sample *sample, in perf_sample__fprintf_ipc() argument
1637 if (!PRINT_FIELD(IPC) || !sample->cyc_cnt || !sample->insn_cnt) in perf_sample__fprintf_ipc()
1640 ipc = (sample->insn_cnt * 100) / sample->cyc_cnt; in perf_sample__fprintf_ipc()
1643 ipc / 100, ipc % 100, sample->insn_cnt, sample->cyc_cnt); in perf_sample__fprintf_ipc()
1646 static int perf_sample__fprintf_bts(struct perf_sample *sample, in perf_sample__fprintf_bts() argument
1659 printed += perf_sample__fprintf_callindent(sample, evsel, thread, al, addr_al, fp); in perf_sample__fprintf_bts()
1666 if (symbol_conf.use_callchain && sample->callchain) { in perf_sample__fprintf_bts()
1669 sample, NULL, NULL, in perf_sample__fprintf_bts()
1682 printed += sample__fprintf_sym(sample, al, 0, print_opts, cursor, in perf_sample__fprintf_bts()
1691 printed += perf_sample__fprintf_addr(sample, thread, attr, fp); in perf_sample__fprintf_bts()
1694 printed += perf_sample__fprintf_ipc(sample, attr, fp); in perf_sample__fprintf_bts()
1699 printed += perf_sample__fprintf_insn(sample, evsel, attr, thread, machine, fp, al); in perf_sample__fprintf_bts()
1867 static int perf_sample__fprintf_bpf_output(struct perf_sample *sample, FILE *fp) in perf_sample__fprintf_bpf_output() argument
1869 unsigned int nr_bytes = sample->raw_size; in perf_sample__fprintf_bpf_output()
1871 int printed = binary__fprintf(sample->raw_data, nr_bytes, 8, in perf_sample__fprintf_bpf_output()
1875 printed += fprintf(fp, "%17s \"%s\"\n", "BPF string:", (char *)(sample->raw_data)); in perf_sample__fprintf_bpf_output()
1914 static int perf_sample__fprintf_synth_ptwrite(struct perf_sample *sample, FILE *fp) in perf_sample__fprintf_synth_ptwrite() argument
1916 struct perf_synth_intel_ptwrite *data = perf_sample__synth_ptr(sample); in perf_sample__fprintf_synth_ptwrite()
1921 if (perf_sample__bad_synth_size(sample, *data)) in perf_sample__fprintf_synth_ptwrite()
1934 static int perf_sample__fprintf_synth_mwait(struct perf_sample *sample, FILE *fp) in perf_sample__fprintf_synth_mwait() argument
1936 struct perf_synth_intel_mwait *data = perf_sample__synth_ptr(sample); in perf_sample__fprintf_synth_mwait()
1939 if (perf_sample__bad_synth_size(sample, *data)) in perf_sample__fprintf_synth_mwait()
1947 static int perf_sample__fprintf_synth_pwre(struct perf_sample *sample, FILE *fp) in perf_sample__fprintf_synth_pwre() argument
1949 struct perf_synth_intel_pwre *data = perf_sample__synth_ptr(sample); in perf_sample__fprintf_synth_pwre()
1952 if (perf_sample__bad_synth_size(sample, *data)) in perf_sample__fprintf_synth_pwre()
1960 static int perf_sample__fprintf_synth_exstop(struct perf_sample *sample, FILE *fp) in perf_sample__fprintf_synth_exstop() argument
1962 struct perf_synth_intel_exstop *data = perf_sample__synth_ptr(sample); in perf_sample__fprintf_synth_exstop()
1965 if (perf_sample__bad_synth_size(sample, *data)) in perf_sample__fprintf_synth_exstop()
1972 static int perf_sample__fprintf_synth_pwrx(struct perf_sample *sample, FILE *fp) in perf_sample__fprintf_synth_pwrx() argument
1974 struct perf_synth_intel_pwrx *data = perf_sample__synth_ptr(sample); in perf_sample__fprintf_synth_pwrx()
1977 if (perf_sample__bad_synth_size(sample, *data)) in perf_sample__fprintf_synth_pwrx()
1986 static int perf_sample__fprintf_synth_cbr(struct perf_sample *sample, FILE *fp) in perf_sample__fprintf_synth_cbr() argument
1988 struct perf_synth_intel_cbr *data = perf_sample__synth_ptr(sample); in perf_sample__fprintf_synth_cbr()
1992 if (perf_sample__bad_synth_size(sample, *data)) in perf_sample__fprintf_synth_cbr()
2004 static int perf_sample__fprintf_synth_psb(struct perf_sample *sample, FILE *fp) in perf_sample__fprintf_synth_psb() argument
2006 struct perf_synth_intel_psb *data = perf_sample__synth_ptr(sample); in perf_sample__fprintf_synth_psb()
2009 if (perf_sample__bad_synth_size(sample, *data)) in perf_sample__fprintf_synth_psb()
2017 static int perf_sample__fprintf_synth_evt(struct perf_sample *sample, FILE *fp) in perf_sample__fprintf_synth_evt() argument
2019 struct perf_synth_intel_evt *data = perf_sample__synth_ptr(sample); in perf_sample__fprintf_synth_evt()
2027 if (perf_sample__bad_synth_size(sample, *data)) in perf_sample__fprintf_synth_evt()
2053 static int perf_sample__fprintf_synth_iflag_chg(struct perf_sample *sample, FILE *fp) in perf_sample__fprintf_synth_iflag_chg() argument
2055 struct perf_synth_intel_iflag_chg *data = perf_sample__synth_ptr(sample); in perf_sample__fprintf_synth_iflag_chg()
2058 if (perf_sample__bad_synth_size(sample, *data)) in perf_sample__fprintf_synth_iflag_chg()
2066 static int perf_sample__fprintf_synth(struct perf_sample *sample, in perf_sample__fprintf_synth() argument
2071 return perf_sample__fprintf_synth_ptwrite(sample, fp); in perf_sample__fprintf_synth()
2073 return perf_sample__fprintf_synth_mwait(sample, fp); in perf_sample__fprintf_synth()
2075 return perf_sample__fprintf_synth_pwre(sample, fp); in perf_sample__fprintf_synth()
2077 return perf_sample__fprintf_synth_exstop(sample, fp); in perf_sample__fprintf_synth()
2079 return perf_sample__fprintf_synth_pwrx(sample, fp); in perf_sample__fprintf_synth()
2081 return perf_sample__fprintf_synth_cbr(sample, fp); in perf_sample__fprintf_synth()
2083 return perf_sample__fprintf_synth_psb(sample, fp); in perf_sample__fprintf_synth()
2085 return perf_sample__fprintf_synth_evt(sample, fp); in perf_sample__fprintf_synth()
2087 return perf_sample__fprintf_synth_iflag_chg(sample, fp); in perf_sample__fprintf_synth()
2132 struct perf_sample *sample; member
2147 perf_sample__fprintf_start(NULL, mctx->sample, mctx->thread, mctx->evsel, in script_print_metric()
2162 perf_sample__fprintf_start(NULL, mctx->sample, mctx->thread, mctx->evsel, in script_new_line()
2170 struct perf_sample *sample, in perf_sample__fprint_metric() argument
2178 .sample = sample, in perf_sample__fprint_metric()
2192 val = sample->period * evsel->scale; in perf_sample__fprint_metric()
2198 sample->cpu, in perf_sample__fprint_metric()
2206 static bool show_event(struct perf_sample *sample, in show_event() argument
2212 int depth = thread_stack__depth(thread, sample->cpu); in show_event()
2226 const char *name = resolve_branch_sym(sample, evsel, thread, al, addr_al, in show_event()
2249 struct perf_sample *sample, struct evsel *evsel, in process_event() argument
2267 perf_sample__fprintf_start(script, sample, thread, evsel, in process_event()
2271 fprintf(fp, "%10" PRIu64 " ", sample->period); in process_event()
2283 perf_sample__fprintf_flags(sample->flags, fp); in process_event()
2286 perf_sample__fprintf_bts(sample, evsel, thread, al, addr_al, machine, fp); in process_event()
2290 if (PRINT_FIELD(TRACE) && sample->raw_data) { in process_event()
2291 event_format__fprintf(evsel->tp_format, sample->cpu, in process_event()
2292 sample->raw_data, sample->raw_size, fp); in process_event()
2296 perf_sample__fprintf_synth(sample, evsel, fp); in process_event()
2299 perf_sample__fprintf_addr(sample, thread, attr, fp); in process_event()
2302 data_src__fprintf(sample->data_src, fp); in process_event()
2305 fprintf(fp, "%16" PRIu64, sample->weight); in process_event()
2308 fprintf(fp, "%16" PRIu16, sample->ins_lat); in process_event()
2311 fprintf(fp, "%16" PRIu16, sample->retire_lat); in process_event()
2316 sample->cgroup); in process_event()
2330 if (symbol_conf.use_callchain && sample->callchain) { in process_event()
2333 sample, NULL, NULL, in process_event()
2338 sample__fprintf_sym(sample, al, 0, output[type].print_ip_opts, cursor, in process_event()
2343 perf_sample__fprintf_iregs(sample, attr, arch, fp); in process_event()
2346 perf_sample__fprintf_uregs(sample, attr, arch, fp); in process_event()
2349 perf_sample__fprintf_brstack(sample, thread, attr, fp); in process_event()
2351 perf_sample__fprintf_brstacksym(sample, thread, attr, fp); in process_event()
2353 perf_sample__fprintf_brstackoff(sample, thread, attr, fp); in process_event()
2356 perf_sample__fprintf_bpf_output(sample, fp); in process_event()
2357 perf_sample__fprintf_insn(sample, evsel, attr, thread, machine, fp, al); in process_event()
2360 fprintf(fp, "%16" PRIx64, sample->phys_addr); in process_event()
2363 fprintf(fp, " %s", get_page_size_name(sample->data_page_size, str)); in process_event()
2366 fprintf(fp, " %s", get_page_size_name(sample->code_page_size, str)); in process_event()
2368 perf_sample__fprintf_ipc(sample, attr, fp); in process_event()
2379 perf_sample__fprint_metric(script, thread, evsel, sample, fp); in process_event()
2452 static bool filter_cpu(struct perf_sample *sample) in filter_cpu() argument
2454 if (cpu_list && sample->cpu != (u32)-1) in filter_cpu()
2455 return !test_bit(sample->cpu, cpu_bitmap); in filter_cpu()
2461 struct perf_sample *sample, in process_sample_event() argument
2474 ret = dlfilter__filter_event_early(dlfilter, event, sample, evsel, machine, &al, &addr_al); in process_sample_event()
2482 sample->time)) { in process_sample_event()
2487 if (sample->time < last_timestamp) { in process_sample_event()
2490 sample->time); in process_sample_event()
2493 last_timestamp = sample->time; in process_sample_event()
2497 if (filter_cpu(sample)) in process_sample_event()
2500 if (!al.thread && machine__resolve(machine, &al, sample) < 0) { in process_sample_event()
2510 if (!show_event(sample, evsel, al.thread, &al, &addr_al)) in process_sample_event()
2516 ret = dlfilter__filter_event(dlfilter, event, sample, evsel, machine, &al, &addr_al); in process_sample_event()
2529 thread__resolve(al.thread, &addr_al, sample); in process_sample_event()
2532 scripting_ops->process_event(event, sample, evsel, &al, addr_al_ptr); in process_sample_event()
2534 process_event(scr, sample, evsel, &al, &addr_al, machine); in process_sample_event()
2614 struct perf_sample *sample, in print_event_with_time() argument
2620 struct evsel *evsel = evlist__id2evsel(session->evlist, sample->id); in print_event_with_time()
2624 sample->cpu = 0; in print_event_with_time()
2625 sample->time = timestamp; in print_event_with_time()
2626 sample->pid = pid; in print_event_with_time()
2627 sample->tid = tid; in print_event_with_time()
2630 if (filter_cpu(sample)) in print_event_with_time()
2637 perf_sample__fprintf_start(script, sample, thread, evsel, in print_event_with_time()
2649 struct perf_sample *sample, struct machine *machine, in print_event() argument
2652 return print_event_with_time(tool, event, sample, machine, pid, tid, 0); in print_event()
2657 struct perf_sample *sample, in process_comm_event() argument
2660 if (perf_event__process_comm(tool, event, sample, machine) < 0) in process_comm_event()
2663 return print_event(tool, event, sample, machine, event->comm.pid, in process_comm_event()
2669 struct perf_sample *sample, in process_namespaces_event() argument
2672 if (perf_event__process_namespaces(tool, event, sample, machine) < 0) in process_namespaces_event()
2675 return print_event(tool, event, sample, machine, event->namespaces.pid, in process_namespaces_event()
2681 struct perf_sample *sample, in process_cgroup_event() argument
2684 if (perf_event__process_cgroup(tool, event, sample, machine) < 0) in process_cgroup_event()
2687 return print_event(tool, event, sample, machine, sample->pid, in process_cgroup_event()
2688 sample->tid); in process_cgroup_event()
2693 struct perf_sample *sample, in process_fork_event() argument
2696 if (perf_event__process_fork(tool, event, sample, machine) < 0) in process_fork_event()
2699 return print_event_with_time(tool, event, sample, machine, in process_fork_event()
2705 struct perf_sample *sample, in process_exit_event() argument
2709 if (print_event_with_time(tool, event, sample, machine, event->fork.pid, in process_exit_event()
2713 return perf_event__process_exit(tool, event, sample, machine); in process_exit_event()
2718 struct perf_sample *sample, in process_mmap_event() argument
2721 if (perf_event__process_mmap(tool, event, sample, machine) < 0) in process_mmap_event()
2724 return print_event(tool, event, sample, machine, event->mmap.pid, in process_mmap_event()
2730 struct perf_sample *sample, in process_mmap2_event() argument
2733 if (perf_event__process_mmap2(tool, event, sample, machine) < 0) in process_mmap2_event()
2736 return print_event(tool, event, sample, machine, event->mmap2.pid, in process_mmap2_event()
2742 struct perf_sample *sample, in process_switch_event() argument
2747 if (perf_event__process_switch(tool, event, sample, machine) < 0) in process_switch_event()
2750 if (scripting_ops && scripting_ops->process_switch && !filter_cpu(sample)) in process_switch_event()
2751 scripting_ops->process_switch(event, sample, machine); in process_switch_event()
2756 return print_event(tool, event, sample, machine, sample->pid, in process_switch_event()
2757 sample->tid); in process_switch_event()
2774 struct perf_sample *sample, in process_lost_event() argument
2777 return print_event(tool, event, sample, machine, sample->pid, in process_lost_event()
2778 sample->tid); in process_lost_event()
2784 struct perf_sample *sample, in process_throttle_event() argument
2788 scripting_ops->process_throttle(event, sample, machine); in process_throttle_event()
2805 struct perf_sample *sample, in process_bpf_events() argument
2808 if (machine__process_ksymbol(machine, event, sample) < 0) in process_bpf_events()
2811 return print_event(tool, event, sample, machine, sample->pid, in process_bpf_events()
2812 sample->tid); in process_bpf_events()
2817 struct perf_sample *sample, in process_text_poke_events() argument
2820 if (perf_event__process_text_poke(tool, event, sample, machine) < 0) in process_text_poke_events()
2823 return print_event(tool, event, sample, machine, sample->pid, in process_text_poke_events()
2824 sample->tid); in process_text_poke_events()
4126 * Enable guest sample processing. in cmd_script()
4327 script.tool.sample = process_sample_event; in cmd_script()