Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf scripting python: Update documentation for srcline etc

Add new fields and functions to the perf-script-python documentation.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20210530192308.7382-12-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
1a329b1c e79457a5

+42 -4
+42 -4
tools/perf/Documentation/perf-script-python.txt
··· 550 550 pass 551 551 ---- 552 552 553 + *process_event*, if defined, is called for any non-tracepoint event 554 + 555 + ---- 556 + def process_event(param_dict): 557 + pass 558 + ---- 559 + 560 + *context_switch*, if defined, is called for any context switch 561 + 562 + ---- 563 + def context_switch(ts, cpu, pid, tid, np_pid, np_tid, machine_pid, out, out_preempt, *x): 564 + pass 565 + ---- 566 + 567 + *auxtrace_error*, if defined, is called for any AUX area tracing error 568 + 569 + ---- 570 + def auxtrace_error(typ, code, cpu, pid, tid, ip, ts, msg, cpumode, *x): 571 + pass 572 + ---- 573 + 553 574 The remaining sections provide descriptions of each of the available 554 575 built-in perf script Python modules and their associated functions. 555 576 ··· 613 592 perf_trace_context defines a set of functions that can be used to 614 593 access this data in the context of the current event. Each of these 615 594 functions expects a context variable, which is the same as the 616 - context variable passed into every event handler as the second 617 - argument. 595 + context variable passed into every tracepoint event handler as the second 596 + argument. For non-tracepoint events, the context variable is also present 597 + as perf_trace_context.perf_script_context . 618 598 619 599 common_pc(context) - returns common_preempt count for the current event 620 600 common_flags(context) - returns common_flags for the current event 621 601 common_lock_depth(context) - returns common_lock_depth for the current event 602 + perf_sample_insn(context) - returns the machine code instruction 603 + perf_set_itrace_options(context, itrace_options) - set --itrace options if they have not been set already 604 + perf_sample_srcline(context) - returns source_file_name, line_number 605 + perf_sample_srccode(context) - returns source_file_name, line_number, source_line 606 + 622 607 623 608 Util.py Module 624 609 ~~~~~~~~~~~~~~ ··· 643 616 Currently supported fields: 644 617 645 618 ev_name, comm, pid, tid, cpu, ip, time, period, phys_addr, addr, 646 - symbol, dso, time_enabled, time_running, values, callchain, 619 + symbol, symoff, dso, time_enabled, time_running, values, callchain, 647 620 brstack, brstacksym, datasrc, datasrc_decode, iregs, uregs, 648 - weight, transaction, raw_buf, attr. 621 + weight, transaction, raw_buf, attr, cpumode. 622 + 623 + Fields that may also be present: 624 + 625 + flags - sample flags 626 + flags_disp - sample flags display 627 + insn_cnt - instruction count for determining instructions-per-cycle (IPC) 628 + cyc_cnt - cycle count for determining IPC 629 + addr_correlates_sym - addr can correlate to a symbol 630 + addr_dso - addr dso 631 + addr_symbol - addr symbol 632 + addr_symoff - addr symbol offset 649 633 650 634 Some fields have sub items: 651 635