111d232ecSArnaldo Carvalho de Meloperf-inject(1)
211d232ecSArnaldo Carvalho de Melo==============
311d232ecSArnaldo Carvalho de Melo
411d232ecSArnaldo Carvalho de MeloNAME
511d232ecSArnaldo Carvalho de Melo----
611d232ecSArnaldo Carvalho de Meloperf-inject - Filter to augment the events stream with additional information
711d232ecSArnaldo Carvalho de Melo
811d232ecSArnaldo Carvalho de MeloSYNOPSIS
911d232ecSArnaldo Carvalho de Melo--------
1011d232ecSArnaldo Carvalho de Melo[verse]
1111d232ecSArnaldo Carvalho de Melo'perf inject <options>'
1211d232ecSArnaldo Carvalho de Melo
1311d232ecSArnaldo Carvalho de MeloDESCRIPTION
1411d232ecSArnaldo Carvalho de Melo-----------
1511d232ecSArnaldo Carvalho de Meloperf-inject reads a perf-record event stream and repipes it to stdout.  At any
1611d232ecSArnaldo Carvalho de Melopoint the processing code can inject other events into the event stream - in
1711d232ecSArnaldo Carvalho de Melothis case build-ids (-b option) are read and injected as needed into the event
1811d232ecSArnaldo Carvalho de Melostream.
1911d232ecSArnaldo Carvalho de Melo
2011d232ecSArnaldo Carvalho de MeloBuild-ids are just the first user of perf-inject - potentially anything that
2111d232ecSArnaldo Carvalho de Meloneeds userspace processing to augment the events stream with additional
2211d232ecSArnaldo Carvalho de Meloinformation could make use of this facility.
2311d232ecSArnaldo Carvalho de Melo
2411d232ecSArnaldo Carvalho de MeloOPTIONS
2511d232ecSArnaldo Carvalho de Melo-------
2611d232ecSArnaldo Carvalho de Melo-b::
2727c9c342SNamhyung Kim--build-ids::
28*fd941521SNamhyung Kim	Inject build-ids of DSOs hit by samples into the output stream.
29*fd941521SNamhyung Kim	This means it needs to process all SAMPLE records to find the DSOs.
3027c9c342SNamhyung Kim
318012243eSRaul Silvera--buildid-all::
32*fd941521SNamhyung Kim	Inject build-ids of all DSOs into the output stream regardless of hits
33*fd941521SNamhyung Kim	and skip SAMPLE processing.
3427c9c342SNamhyung Kim
358012243eSRaul Silvera--known-build-ids=::
368012243eSRaul Silvera	Override build-ids to inject using these comma-separated pairs of
378012243eSRaul Silvera	build-id and path. Understands file://filename to read these pairs
388012243eSRaul Silvera	from a file, which can be generated with perf buildid-list.
398012243eSRaul Silvera
4011d232ecSArnaldo Carvalho de Melo-v::
4111d232ecSArnaldo Carvalho de Melo--verbose::
4211d232ecSArnaldo Carvalho de Melo	Be more verbose.
43e558a5bdSAndrew Vagin-i::
44e558a5bdSAndrew Vagin--input=::
45e558a5bdSAndrew Vagin	Input file name. (default: stdin)
46e558a5bdSAndrew Vagin-o::
47e558a5bdSAndrew Vagin--output=::
48e558a5bdSAndrew Vagin	Output file name. (default: stdout)
4926a031e1SAndrew Vagin-s::
5026a031e1SAndrew Vagin--sched-stat::
5126a031e1SAndrew Vagin	Merge sched_stat and sched_switch for getting events where and how long
5226a031e1SAndrew Vagin	tasks slept. sched_switch contains a callchain where a task slept and
5326a031e1SAndrew Vagin	sched_stat contains a timeslice how long a task slept.
5411d232ecSArnaldo Carvalho de Melo
55b3a018fcSJames Clark-k::
56b3a018fcSJames Clark--vmlinux=<file>::
57b3a018fcSJames Clark        vmlinux pathname
58b3a018fcSJames Clark
59b3a018fcSJames Clark--ignore-vmlinux::
60b3a018fcSJames Clark	Ignore vmlinux files.
61b3a018fcSJames Clark
62a7a2b8b4SAdrian Hunter--kallsyms=<file>::
63a7a2b8b4SAdrian Hunter	kallsyms pathname
64a7a2b8b4SAdrian Hunter
650f0aa5e0SAdrian Hunter--itrace::
660f0aa5e0SAdrian Hunter	Decode Instruction Tracing data, replacing it with synthesized events.
670f0aa5e0SAdrian Hunter	Options are:
680f0aa5e0SAdrian Hunter
6960b88d87SAdrian Hunterinclude::itrace.txt[]
700f0aa5e0SAdrian Hunter
71f56fb986SAdrian Hunter--strip::
72f56fb986SAdrian Hunter	Use with --itrace to strip out non-synthesized events.
73f56fb986SAdrian Hunter
749b07e27fSStephane Eranian-j::
759b07e27fSStephane Eranian--jit::
769b07e27fSStephane Eranian	Process jitdump files by injecting the mmap records corresponding to jitted
779b07e27fSStephane Eranian	functions. This option also generates the ELF images for each jitted function
789b07e27fSStephane Eranian	found in the jitdumps files captured in the input perf.data file. Use this option
799b07e27fSStephane Eranian	if you are monitoring environment using JIT runtimes, such as Java, DART or V8.
809b07e27fSStephane Eranian
8152186b8aSSihyeon Jang-f::
8252186b8aSSihyeon Jang--force::
8352186b8aSSihyeon Jang	Don't complain, do it.
8452186b8aSSihyeon Jang
8583d7f5f1SAdrian Hunter--vm-time-correlation[=OPTIONS]::
8683d7f5f1SAdrian Hunter	Some architectures may capture AUX area data which contains timestamps
8783d7f5f1SAdrian Hunter	affected by virtualization. This option will update those timestamps
8883d7f5f1SAdrian Hunter	in place, to correlate with host timestamps. The in-place update means
8983d7f5f1SAdrian Hunter	that an output file is not specified, and instead the input file is
9083d7f5f1SAdrian Hunter	modified.  The options are architecture specific, except that they may
9183d7f5f1SAdrian Hunter	start with "dry-run" which will cause the file to be processed but
9283d7f5f1SAdrian Hunter	without updating it. Currently this option is supported only by
9383d7f5f1SAdrian Hunter	Intel PT, refer linkperf:perf-intel-pt[1]
9483d7f5f1SAdrian Hunter
9597406a7eSAdrian Hunter--guest-data=<path>,<pid>[,<time offset>[,<time scale>]]::
9697406a7eSAdrian Hunter	Insert events from a perf.data file recorded in a virtual machine at
9797406a7eSAdrian Hunter	the same time as the input perf.data file was recorded on the host.
9897406a7eSAdrian Hunter	The Process ID (PID) of the QEMU hypervisor process must be provided,
9997406a7eSAdrian Hunter	and the time offset and time scale (multiplier) will likely be needed
10097406a7eSAdrian Hunter	to convert guest time stamps into host time stamps. For example, for
10197406a7eSAdrian Hunter	x86 the TSC Offset and Multiplier could be provided for a virtual machine
10297406a7eSAdrian Hunter	using Linux command line option no-kvmclock.
10397406a7eSAdrian Hunter	Currently only mmap, mmap2, comm, task, context_switch, ksymbol,
10497406a7eSAdrian Hunter	and text_poke events are inserted, as well as build ID information.
10597406a7eSAdrian Hunter	The QEMU option -name debug-threads=on is needed so that thread names
10697406a7eSAdrian Hunter	can be used to determine which thread is running which VCPU. Note
10797406a7eSAdrian Hunter	libvirt seems to use this by default.
10897406a7eSAdrian Hunter	When using perf record in the guest, option --sample-identifier
10997406a7eSAdrian Hunter	should be used, and also --buildid-all and --switch-events may be
11097406a7eSAdrian Hunter	useful.
11197406a7eSAdrian Hunter
11253e76d35SAdrian Hunter:GMEXAMPLECMD: inject
11353e76d35SAdrian Hunter:GMEXAMPLESUBCMD:
11453e76d35SAdrian Hunterinclude::guestmount.txt[]
115d9ca43c0SAdrian Hunter
11611d232ecSArnaldo Carvalho de MeloSEE ALSO
11711d232ecSArnaldo Carvalho de Melo--------
118870d325bSAdrian Hunterlinkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-archive[1],
119870d325bSAdrian Hunterlinkperf:perf-intel-pt[1]
120