| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * intel_pt_pkt_decoder.h: Intel Processor Trace support |
|---|
| 3 | 4 | * Copyright (c) 2013-2014, Intel Corporation. |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 6 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 7 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 12 | | - * more details. |
|---|
| 13 | | - * |
|---|
| 14 | 5 | */ |
|---|
| 15 | 6 | |
|---|
| 16 | 7 | #ifndef INCLUDE__INTEL_PT_PKT_DECODER_H__ |
|---|
| .. | .. |
|---|
| 59 | 50 | INTEL_PT_MWAIT, |
|---|
| 60 | 51 | INTEL_PT_PWRE, |
|---|
| 61 | 52 | INTEL_PT_PWRX, |
|---|
| 53 | + INTEL_PT_BBP, |
|---|
| 54 | + INTEL_PT_BIP, |
|---|
| 55 | + INTEL_PT_BEP, |
|---|
| 56 | + INTEL_PT_BEP_IP, |
|---|
| 62 | 57 | }; |
|---|
| 63 | 58 | |
|---|
| 64 | 59 | struct intel_pt_pkt { |
|---|
| .. | .. |
|---|
| 67 | 62 | uint64_t payload; |
|---|
| 68 | 63 | }; |
|---|
| 69 | 64 | |
|---|
| 65 | +/* |
|---|
| 66 | + * Decoding of BIP packets conflicts with single-byte TNT packets. Since BIP |
|---|
| 67 | + * packets only occur in the context of a block (i.e. between BBP and BEP), that |
|---|
| 68 | + * context must be recorded and passed to the packet decoder. |
|---|
| 69 | + */ |
|---|
| 70 | +enum intel_pt_pkt_ctx { |
|---|
| 71 | + INTEL_PT_NO_CTX, /* BIP packets are invalid */ |
|---|
| 72 | + INTEL_PT_BLK_4_CTX, /* 4-byte BIP packets */ |
|---|
| 73 | + INTEL_PT_BLK_8_CTX, /* 8-byte BIP packets */ |
|---|
| 74 | +}; |
|---|
| 75 | + |
|---|
| 70 | 76 | const char *intel_pt_pkt_name(enum intel_pt_pkt_type); |
|---|
| 71 | 77 | |
|---|
| 72 | 78 | int intel_pt_get_packet(const unsigned char *buf, size_t len, |
|---|
| 73 | | - struct intel_pt_pkt *packet); |
|---|
| 79 | + struct intel_pt_pkt *packet, |
|---|
| 80 | + enum intel_pt_pkt_ctx *ctx); |
|---|
| 81 | + |
|---|
| 82 | +void intel_pt_upd_pkt_ctx(const struct intel_pt_pkt *packet, |
|---|
| 83 | + enum intel_pt_pkt_ctx *ctx); |
|---|
| 74 | 84 | |
|---|
| 75 | 85 | int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf, size_t len); |
|---|
| 76 | 86 | |
|---|