Lines Matching +full:packet +full:- +full:processor

2  * Copyright (c) 2013-2019, Intel Corporation
40 /* Intel(R) Processor Trace (Intel PT) decoder library.
44 * - Version
45 * - Errors
46 * - Configuration
47 * - Packet encoder / decoder
48 * - Query decoder
49 * - Traced image
50 * - Instruction flow decoder
51 * - Block decoder
136 /* Unexpected packet context. */
142 /* No packet matching the query to be found. */
163 /* No wall-clock time is available. */
207 return (status >= 0) ? pte_ok : (enum pt_error_code) -status;
242 /** BDM70: Intel(R) Processor Trace PSB+ Packets May Contain
247 * Some Intel Processor Trace packets should be issued only between
249 * packet is generated it may be preceded by a PSB+ that incorrectly
254 /** BDM64: An Incorrect LBR or Intel(R) Processor Trace Packet May Be
261 * Processor Trace (Intel(R) PT) packet before the LBR or Intel PT
262 * packet produced by the abort.
270 * Under complex micro-architectural conditions, an Intel PT (Processor
271 * Trace) OVF (Overflow) packet may be issued after the first byte of a
272 * multi-byte CYC (Cycle Count) packet, instead of any remaining bytes
281 * If VM entry clears Intel(R) PT (Intel Processor Trace)
283 * FUP (Flow Update Packet) will precede the TIP.PGD (Target IP Packet,
284 * Packet Generation Disable). VM entry can clear TraceEn if the
285 * VM-entry MSR-load area includes an entry for the IA32_RTIT_CTL MSR.
293 * Some Intel PT (Intel Processor Trace) OVF (Overflow) packets may not
294 * be followed by a FUP (Flow Update Packet) or TIP.PGE (Target IP
295 * Packet, Packet Generation Enable).
303 * When Intel PT (Intel Processor Trace) is enabled and a direct
305 * 0), due to this erratum, the resulting TIP.PGD (Target IP Packet,
306 * Packet Generation Disable) may not have an IP payload with the target
311 /** APL12: Intel(R) PT OVF May Be Followed By An Unexpected FUP Packet.
313 * Certain Intel PT (Processor Trace) packets including FUPs (Flow
315 * Packet - Packet Generaton Enable) and TIP.PGD (Target IP Packet -
316 * Packet Generation Disable) packets. When outside a TIP.PGE/TIP.PGD
318 * cleared, an OVF (Overflow) packet may be unexpectedly followed by a
323 /** APL11: Intel(R) PT OVF Pakcet May Be Followed by TIP.PGD Packet
325 * If Intel PT (Processor Trace) encounters an internal buffer overflow
326 * and generates an OVF (Overflow) packet just as IA32_RTIT_CTL (MSR
329 * OVF may be followed by a TIP.PGD (Target Instruction Pointer - Packet
330 * Generation Disable) packet.
338 * PT (Processor Trace) PSB (Packet Stream Boundary) packet can cause a
339 * single CYC (Cycle Count) packet, possibly along with an associated
340 * MTC (Mini Time Counter) packet, to be dropped.
348 /** A collection of decoder-specific configuration flags. */
421 /** An unknown packet. */
443 * It shall decode the packet at \@pos into \@unknown.
452 /** The user-defined context for this configuration. */
489 /** A collection of decoder-specific flags. */
497 /** Zero-initialize an Intel PT configuration. */
502 config->size = sizeof(*config);
510 * Returns -pte_invalid if \@errata or \@cpu is NULL.
511 * Returns -pte_bad_cpu if \@cpu is not known.
518 /* Packet encoder / decoder. */
522 /** Intel PT packet types. */
524 /* An invalid packet. */
527 /* A packet decodable by the optional decoder callback. */
590 /** Mode packet leaves. */
596 /** A TNT-8 or TNT-64 packet. */
605 /** A packet with IP payload. */
610 /** Zero-extended payload ip. */
614 /** A mode.exec packet. */
624 pt_get_exec_mode(const struct pt_packet_mode_exec *packet) argument
626 if (packet->csl)
627 return packet->csd ? ptem_unknown : ptem_64bit;
629 return packet->csd ? ptem_32bit : ptem_16bit;
635 struct pt_packet_mode_exec packet; local
639 packet.csl = 1;
640 packet.csd = 1;
644 packet.csl = 1;
645 packet.csd = 0;
649 packet.csl = 0;
650 packet.csd = 1;
654 packet.csl = 0;
655 packet.csd = 0;
659 return packet;
662 /** A mode.tsx packet. */
671 /** A mode packet. */
678 /** Packet: mode.exec. */
681 /** Packet: mode.tsx. */
686 /** A PIP packet. */
691 /** The non-root bit. */
695 /** A TSC packet. */
701 /** A CBR packet. */
707 /** A TMA packet. */
716 /** A MTC packet. */
722 /** A CYC packet. */
728 /** A VMCS packet. */
734 /** A MNT packet. */
740 /** A EXSTOP packet. */
742 /** A flag specifying the binding of the packet:
750 /** A MWAIT packet. */
759 /** A PWRE packet. */
761 /** The resolved thread C-state. */
764 /** The resolved thread sub C-state. */
767 /** A flag indicating whether the C-state entry was initiated by h/w. */
771 /** A PWRX packet. */
773 /** The core C-state at the time of the wake. */
776 /** The deepest core C-state achieved during sleep. */
781 * - due to external interrupt received.
785 /** - due to store to monitored address. */
788 /** - due to h/w autonomous condition such as HDC. */
792 /** A PTW packet. */
797 /** The payload size as encoded in the packet. */
817 return -pte_bad_packet;
820 return -pte_internal;
823 /** An unknown packet decodable by the optional decoder callback. */
825 /** Pointer to the raw packet bytes. */
826 const uint8_t *packet; member
828 /** Optional pointer to a user-defined structure. */
832 /** An Intel PT packet. */
834 /** The type of the packet.
840 /** The size of the packet including opcode and payload. */
843 /** Packet specific data. */
845 /** Packets: pad, ovf, psb, psbend, stop - no payload. */
847 /** Packet: tnt-8, tnt-64. */
850 /** Packet: tip, fup, tip.pge, tip.pgd. */
853 /** Packet: mode. */
856 /** Packet: pip. */
859 /** Packet: tsc. */
862 /** Packet: cbr. */
865 /** Packet: tma. */
868 /** Packet: mtc. */
871 /** Packet: cyc. */
874 /** Packet: vmcs. */
877 /** Packet: mnt. */
880 /** Packet: exstop. */
883 /** Packet: mwait. */
886 /** Packet: pwre. */
889 /** Packet: pwrx. */
892 /** Packet: ptw. */
895 /** Packet: unknown. */
902 /* Packet encoder. */
906 /** Allocate an Intel PT packet encoder.
916 /** Free an Intel PT packet encoder.
922 /** Hard set synchronization point of an Intel PT packet encoder.
928 * Returns -pte_eos if the given offset is behind the end of the trace buffer.
929 * Returns -pte_invalid if \@encoder is NULL.
934 /** Get the current packet encoder position.
942 * Returns -pte_invalid if \@encoder or \@offset is NULL.
949 * Returns a non-null pointer on success, NULL if \@encoder is NULL.
954 /** Encode an Intel PT packet.
956 * Writes \@packet at \@encoder's current position in the Intel PT buffer and
957 * advances the \@encoder beyond the written packet.
959 * The \@packet.size field is ignored.
967 * Returns -pte_bad_opc if \@packet.type is not known.
968 * Returns -pte_bad_packet if \@packet's payload is invalid.
969 * Returns -pte_eos if \@encoder reached the end of the Intel PT buffer.
970 * Returns -pte_invalid if \@encoder or \@packet is NULL.
973 const struct pt_packet *packet);
977 /* Packet decoder. */
981 /** Allocate an Intel PT packet decoder.
991 /** Free an Intel PT packet decoder.
997 /** Synchronize an Intel PT packet decoder.
1007 * Returns -pte_eos if no further synchronization point is found.
1008 * Returns -pte_invalid if \@decoder is NULL.
1019 * Returns -pte_eos if the given offset is behind the end of the trace buffer.
1020 * Returns -pte_invalid if \@decoder is NULL.
1033 * Returns -pte_invalid if \@decoder or \@offset is NULL.
1034 * Returns -pte_nosync if \@decoder is out of sync.
1047 * Returns -pte_invalid if \@decoder or \@offset is NULL.
1048 * Returns -pte_nosync if \@decoder is out of sync.
1056 * Returns a non-null pointer on success, NULL if \@decoder is NULL.
1061 /** Decode the next packet and advance the decoder.
1063 * Decodes the packet at \@decoder's current position into \@packet and
1064 * adjusts the \@decoder's position by the number of bytes the packet had
1072 * Returns -pte_bad_opc if the packet is unknown.
1073 * Returns -pte_bad_packet if an unknown packet payload is encountered.
1074 * Returns -pte_eos if \@decoder reached the end of the Intel PT buffer.
1075 * Returns -pte_invalid if \@decoder or \@packet is NULL.
1076 * Returns -pte_nosync if \@decoder is out of sync.
1079 struct pt_packet *packet, size_t size);
1256 * vmx non-root (guest) mode.
1276 * vmx non-root (guest) mode.
1323 * The address is zero-extended with the lower 12 bits
1337 * The address is zero-extended with the lower 12 bits
1383 /** The resolved thread C-state. */
1386 /** The resolved thread sub C-state. */
1389 /** A flag indicating whether the C-state entry was
1397 /** The core C-state at the time of the wake. */
1400 /** The deepest core C-state achieved during sleep. */
1405 * - due to external interrupt received.
1409 /** - due to store to monitored address. */
1412 /** - due to h/w autonomous condition such as HDC. */
1488 * Returns a non-negative pt_status_flag bit-vector on success, a negative error
1491 * Returns -pte_bad_opc if an unknown packet is encountered.
1492 * Returns -pte_bad_packet if an unknown packet payload is encountered.
1493 * Returns -pte_eos if no further synchronization point is found.
1494 * Returns -pte_invalid if \@decoder is NULL.
1504 * packet at \@offset.
1508 * Returns a non-negative pt_status_flag bit-vector on success, a negative error
1511 * Returns -pte_bad_opc if an unknown packet is encountered.
1512 * Returns -pte_bad_packet if an unknown packet payload is encountered.
1513 * Returns -pte_eos if \@offset lies outside of \@decoder's trace buffer.
1514 * Returns -pte_eos if \@decoder reaches the end of its trace buffer.
1515 * Returns -pte_invalid if \@decoder is NULL.
1516 * Returns -pte_nosync if there is no syncpoint at \@offset.
1529 * Returns -pte_invalid if \@decoder or \@offset is NULL.
1530 * Returns -pte_nosync if \@decoder is out of sync.
1543 * Returns -pte_invalid if \@decoder or \@offset is NULL.
1544 * Returns -pte_nosync if \@decoder is out of sync.
1552 * Returns a non-null pointer on success, NULL if \@decoder is NULL.
1562 * Returns a non-negative pt_status_flag bit-vector on success, a negative error
1565 * Returns -pte_bad_opc if an unknown packet is encountered.
1566 * Returns -pte_bad_packet if an unknown packet payload is encountered.
1567 * Returns -pte_bad_query if no conditional branch is found.
1568 * Returns -pte_eos if decoding reached the end of the Intel PT buffer.
1569 * Returns -pte_invalid if \@decoder or \@taken is NULL.
1570 * Returns -pte_nosync if \@decoder is out of sync.
1580 * Returns a non-negative pt_status_flag bit-vector on success, a negative error
1583 * Returns -pte_bad_opc if an unknown packet is encountered.
1584 * Returns -pte_bad_packet if an unknown packet payload is encountered.
1585 * Returns -pte_bad_query if no indirect branch is found.
1586 * Returns -pte_eos if decoding reached the end of the Intel PT buffer.
1587 * Returns -pte_invalid if \@decoder or \@ip is NULL.
1588 * Returns -pte_nosync if \@decoder is out of sync.
1599 * Returns a non-negative pt_status_flag bit-vector on success, a negative error
1602 * Returns -pte_bad_opc if an unknown packet is encountered.
1603 * Returns -pte_bad_packet if an unknown packet payload is encountered.
1604 * Returns -pte_bad_query if no event is found.
1605 * Returns -pte_eos if decoding reached the end of the Intel PT buffer.
1606 * Returns -pte_invalid if \@decoder or \@event is NULL.
1607 * Returns -pte_invalid if \@size is too small.
1608 * Returns -pte_nosync if \@decoder is out of sync.
1620 * to correlate with other TSC-based time sources. In this case, -pte_no_time
1623 * Some timing-related packets may need to be dropped (mostly due to missing
1632 * Returns -pte_invalid if \@decoder or \@time is NULL.
1633 * Returns -pte_no_time if there has not been a TSC packet.
1646 * Returns -pte_invalid if \@decoder or \@cbr is NULL.
1647 * Returns -pte_no_cbr if there has not been a CBR packet.
1664 /** The size of this object - set to sizeof(struct pt_asid). */
1683 asid->size = sizeof(*asid);
1684 asid->cr3 = pt_asid_no_cr3;
1685 asid->vmcs = pt_asid_no_vmcs;
1710 * Set the limit for a section cache in bytes. A non-zero limit will keep the
1715 * Returns -pte_invalid if \@iscache is NULL.
1740 * Returns -pte_invalid if \@iscache or \@filename is NULL.
1741 * Returns -pte_invalid if \@offset is too big.
1760 * Returns -pte_invalid if \@iscache or \@buffer is NULL.
1761 * Returns -pte_invalid if \@size is zero.
1762 * Returns -pte_nomap if \@vaddr is not contained in section \@isid.
1763 * Returns -pte_bad_image if \@iscache does not contain \@isid.
1800 * fields are considered when comparing with other address-spaces. Use this
1810 * Returns -pte_invalid if \@image or \@filename is NULL.
1811 * Returns -pte_invalid if \@offset is too big.
1827 * Returns -pte_invalid if \@image or \@iscache is NULL.
1828 * Returns -pte_bad_image if \@iscache does not contain \@isid.
1842 * Returns -pte_invalid if \@image or \@src is NULL.
1855 * Returns -pte_invalid if \@image or \@filename is NULL.
1869 * Returns -pte_invalid if \@image is NULL.
1895 * Returns -pte_invalid if \@image is NULL.
1931 /* The instruction is a call-like far transfer.
1936 /* The instruction is a return-like far transfer.
1941 /* The instruction is a jump-like far transfer.
1983 * - the instruction was executed speculatively.
1987 /** - this instruction is truncated in its image section.
2024 * Returns -pte_bad_opc if an unknown packet is encountered.
2025 * Returns -pte_bad_packet if an unknown packet payload is encountered.
2026 * Returns -pte_eos if no further synchronization point is found.
2027 * Returns -pte_invalid if \@decoder is NULL.
2035 * packet at \@offset.
2039 * Returns -pte_bad_opc if an unknown packet is encountered.
2040 * Returns -pte_bad_packet if an unknown packet payload is encountered.
2041 * Returns -pte_eos if \@offset lies outside of \@decoder's trace buffer.
2042 * Returns -pte_eos if \@decoder reaches the end of its trace buffer.
2043 * Returns -pte_invalid if \@decoder is NULL.
2044 * Returns -pte_nosync if there is no syncpoint at \@offset.
2057 * Returns -pte_invalid if \@decoder or \@offset is NULL.
2058 * Returns -pte_nosync if \@decoder is out of sync.
2069 * Returns -pte_invalid if \@decoder or \@offset is NULL.
2070 * Returns -pte_nosync if \@decoder is out of sync.
2095 * Return -pte_invalid if \@decoder is NULL.
2102 * Returns a non-null pointer on success, NULL if \@decoder is NULL.
2109 * On success, provides the time at the last preceding timing packet in \@time.
2114 * to correlate with other TSC-based time sources. In this case, -pte_no_time
2117 * Some timing-related packets may need to be dropped (mostly due to missing
2126 * Returns -pte_invalid if \@decoder or \@time is NULL.
2127 * Returns -pte_no_time if there has not been a TSC packet.
2140 * Returns -pte_invalid if \@decoder or \@cbr is NULL.
2141 * Returns -pte_no_cbr if there has not been a CBR packet.
2151 * bytes will be copied and \@asid->size will be set to the actual size of the
2156 * Returns -pte_invalid if \@decoder or \@asid is NULL.
2167 * Returns a non-negative pt_status_flag bit-vector on success, a negative error
2174 * Returns -pte_bad_context if the decoder encountered an unexpected packet.
2175 * Returns -pte_bad_opc if the decoder encountered unknown packets.
2176 * Returns -pte_bad_packet if the decoder encountered unknown packet payloads.
2177 * Returns -pte_bad_query if the decoder got out of sync.
2178 * Returns -pte_eos if decoding reached the end of the Intel PT buffer.
2179 * Returns -pte_invalid if \@decoder or \@insn is NULL.
2180 * Returns -pte_nomap if the memory at the instruction address can't be read.
2181 * Returns -pte_nosync if \@decoder is out of sync.
2192 * Returns a non-negative pt_status_flag bit-vector on success, a negative error
2195 * Returns -pte_bad_query if there is no event.
2196 * Returns -pte_invalid if \@decoder or \@event is NULL.
2197 * Returns -pte_invalid if \@size is too small.
2219 * This can be used for error-detection.
2261 * - all instructions in this block were executed speculatively.
2265 /** - the last instruction in this block is truncated.
2304 * Returns -pte_bad_opc if an unknown packet is encountered.
2305 * Returns -pte_bad_packet if an unknown packet payload is encountered.
2306 * Returns -pte_eos if no further synchronization point is found.
2307 * Returns -pte_invalid if \@decoder is NULL.
2315 * packet at \@offset.
2319 * Returns -pte_bad_opc if an unknown packet is encountered.
2320 * Returns -pte_bad_packet if an unknown packet payload is encountered.
2321 * Returns -pte_eos if \@offset lies outside of \@decoder's trace buffer.
2322 * Returns -pte_eos if \@decoder reaches the end of its trace buffer.
2323 * Returns -pte_invalid if \@decoder is NULL.
2324 * Returns -pte_nosync if there is no syncpoint at \@offset.
2337 * Returns -pte_invalid if \@decoder or \@offset is NULL.
2338 * Returns -pte_nosync if \@decoder is out of sync.
2349 * Returns -pte_invalid if \@decoder or \@offset is NULL.
2350 * Returns -pte_nosync if \@decoder is out of sync.
2374 * Return -pte_invalid if \@decoder is NULL.
2381 * Returns a non-null pointer on success, NULL if \@decoder is NULL.
2388 * On success, provides the time at the last preceding timing packet in \@time.
2393 * to correlate with other TSC-based time sources. In this case, -pte_no_time
2396 * Some timing-related packets may need to be dropped (mostly due to missing
2405 * Returns -pte_invalid if \@decoder or \@time is NULL.
2406 * Returns -pte_no_time if there has not been a TSC packet.
2419 * Returns -pte_invalid if \@decoder or \@cbr is NULL.
2420 * Returns -pte_no_cbr if there has not been a CBR packet.
2430 * bytes will be copied and \@asid->size will be set to the actual size of the
2435 * Returns -pte_invalid if \@decoder or \@asid is NULL.
2447 * Returns a non-negative pt_status_flag bit-vector on success, a negative error
2454 * Returns -pte_bad_context if the decoder encountered an unexpected packet.
2455 * Returns -pte_bad_opc if the decoder encountered unknown packets.
2456 * Returns -pte_bad_packet if the decoder encountered unknown packet payloads.
2457 * Returns -pte_bad_query if the decoder got out of sync.
2458 * Returns -pte_eos if decoding reached the end of the Intel PT buffer.
2459 * Returns -pte_invalid if \@decoder or \@block is NULL.
2460 * Returns -pte_nomap if the memory at the instruction address can't be read.
2461 * Returns -pte_nosync if \@decoder is out of sync.
2472 * Returns a non-negative pt_status_flag bit-vector on success, a negative error
2475 * Returns -pte_bad_query if there is no event.
2476 * Returns -pte_invalid if \@decoder or \@event is NULL.
2477 * Returns -pte_invalid if \@size is too small.