162306a36Sopenharmony_ciperf-inject(1)
262306a36Sopenharmony_ci==============
362306a36Sopenharmony_ci
462306a36Sopenharmony_ciNAME
562306a36Sopenharmony_ci----
662306a36Sopenharmony_ciperf-inject - Filter to augment the events stream with additional information
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciSYNOPSIS
962306a36Sopenharmony_ci--------
1062306a36Sopenharmony_ci[verse]
1162306a36Sopenharmony_ci'perf inject <options>'
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciDESCRIPTION
1462306a36Sopenharmony_ci-----------
1562306a36Sopenharmony_ciperf-inject reads a perf-record event stream and repipes it to stdout.  At any
1662306a36Sopenharmony_cipoint the processing code can inject other events into the event stream - in
1762306a36Sopenharmony_cithis case build-ids (-b option) are read and injected as needed into the event
1862306a36Sopenharmony_cistream.
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ciBuild-ids are just the first user of perf-inject - potentially anything that
2162306a36Sopenharmony_cineeds userspace processing to augment the events stream with additional
2262306a36Sopenharmony_ciinformation could make use of this facility.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciOPTIONS
2562306a36Sopenharmony_ci-------
2662306a36Sopenharmony_ci-b::
2762306a36Sopenharmony_ci--build-ids::
2862306a36Sopenharmony_ci	Inject build-ids of DSOs hit by samples into the output stream.
2962306a36Sopenharmony_ci	This means it needs to process all SAMPLE records to find the DSOs.
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci--buildid-all::
3262306a36Sopenharmony_ci	Inject build-ids of all DSOs into the output stream regardless of hits
3362306a36Sopenharmony_ci	and skip SAMPLE processing.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci--known-build-ids=::
3662306a36Sopenharmony_ci	Override build-ids to inject using these comma-separated pairs of
3762306a36Sopenharmony_ci	build-id and path. Understands file://filename to read these pairs
3862306a36Sopenharmony_ci	from a file, which can be generated with perf buildid-list.
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci-v::
4162306a36Sopenharmony_ci--verbose::
4262306a36Sopenharmony_ci	Be more verbose.
4362306a36Sopenharmony_ci-i::
4462306a36Sopenharmony_ci--input=::
4562306a36Sopenharmony_ci	Input file name. (default: stdin)
4662306a36Sopenharmony_ci-o::
4762306a36Sopenharmony_ci--output=::
4862306a36Sopenharmony_ci	Output file name. (default: stdout)
4962306a36Sopenharmony_ci-s::
5062306a36Sopenharmony_ci--sched-stat::
5162306a36Sopenharmony_ci	Merge sched_stat and sched_switch for getting events where and how long
5262306a36Sopenharmony_ci	tasks slept. sched_switch contains a callchain where a task slept and
5362306a36Sopenharmony_ci	sched_stat contains a timeslice how long a task slept.
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci-k::
5662306a36Sopenharmony_ci--vmlinux=<file>::
5762306a36Sopenharmony_ci        vmlinux pathname
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci--ignore-vmlinux::
6062306a36Sopenharmony_ci	Ignore vmlinux files.
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci--kallsyms=<file>::
6362306a36Sopenharmony_ci	kallsyms pathname
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci--itrace::
6662306a36Sopenharmony_ci	Decode Instruction Tracing data, replacing it with synthesized events.
6762306a36Sopenharmony_ci	Options are:
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ciinclude::itrace.txt[]
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci--strip::
7262306a36Sopenharmony_ci	Use with --itrace to strip out non-synthesized events.
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci-j::
7562306a36Sopenharmony_ci--jit::
7662306a36Sopenharmony_ci	Process jitdump files by injecting the mmap records corresponding to jitted
7762306a36Sopenharmony_ci	functions. This option also generates the ELF images for each jitted function
7862306a36Sopenharmony_ci	found in the jitdumps files captured in the input perf.data file. Use this option
7962306a36Sopenharmony_ci	if you are monitoring environment using JIT runtimes, such as Java, DART or V8.
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci-f::
8262306a36Sopenharmony_ci--force::
8362306a36Sopenharmony_ci	Don't complain, do it.
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci--vm-time-correlation[=OPTIONS]::
8662306a36Sopenharmony_ci	Some architectures may capture AUX area data which contains timestamps
8762306a36Sopenharmony_ci	affected by virtualization. This option will update those timestamps
8862306a36Sopenharmony_ci	in place, to correlate with host timestamps. The in-place update means
8962306a36Sopenharmony_ci	that an output file is not specified, and instead the input file is
9062306a36Sopenharmony_ci	modified.  The options are architecture specific, except that they may
9162306a36Sopenharmony_ci	start with "dry-run" which will cause the file to be processed but
9262306a36Sopenharmony_ci	without updating it. Currently this option is supported only by
9362306a36Sopenharmony_ci	Intel PT, refer linkperf:perf-intel-pt[1]
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci--guest-data=<path>,<pid>[,<time offset>[,<time scale>]]::
9662306a36Sopenharmony_ci	Insert events from a perf.data file recorded in a virtual machine at
9762306a36Sopenharmony_ci	the same time as the input perf.data file was recorded on the host.
9862306a36Sopenharmony_ci	The Process ID (PID) of the QEMU hypervisor process must be provided,
9962306a36Sopenharmony_ci	and the time offset and time scale (multiplier) will likely be needed
10062306a36Sopenharmony_ci	to convert guest time stamps into host time stamps. For example, for
10162306a36Sopenharmony_ci	x86 the TSC Offset and Multiplier could be provided for a virtual machine
10262306a36Sopenharmony_ci	using Linux command line option no-kvmclock.
10362306a36Sopenharmony_ci	Currently only mmap, mmap2, comm, task, context_switch, ksymbol,
10462306a36Sopenharmony_ci	and text_poke events are inserted, as well as build ID information.
10562306a36Sopenharmony_ci	The QEMU option -name debug-threads=on is needed so that thread names
10662306a36Sopenharmony_ci	can be used to determine which thread is running which VCPU. Note
10762306a36Sopenharmony_ci	libvirt seems to use this by default.
10862306a36Sopenharmony_ci	When using perf record in the guest, option --sample-identifier
10962306a36Sopenharmony_ci	should be used, and also --buildid-all and --switch-events may be
11062306a36Sopenharmony_ci	useful.
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ci:GMEXAMPLECMD: inject
11362306a36Sopenharmony_ci:GMEXAMPLESUBCMD:
11462306a36Sopenharmony_ciinclude::guestmount.txt[]
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ciSEE ALSO
11762306a36Sopenharmony_ci--------
11862306a36Sopenharmony_cilinkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-archive[1],
11962306a36Sopenharmony_cilinkperf:perf-intel-pt[1]
120