Linux Perf
intel-pt-pkt-decoder.c File Reference
#include <stdio.h>
#include <string.h>
#include <endian.h>
#include <byteswap.h>
#include <linux/compiler.h>
#include "intel-pt-pkt-decoder.h"
Include dependency graph for intel-pt-pkt-decoder.c:

Go to the source code of this file.

Macros

#define BIT(n)   (1 << (n))
 
#define BIT63   ((uint64_t)1 << 63)
 
#define NR_FLAG   BIT63
 
#define le16_to_cpu   bswap_16
 
#define le32_to_cpu   bswap_32
 
#define le64_to_cpu   bswap_64
 
#define memcpy_le64(d, s, n)
 

Functions

const char * intel_pt_pkt_name (enum intel_pt_pkt_type type)
 
static int intel_pt_get_long_tnt (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_pip (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_tracestop (struct intel_pt_pkt *packet)
 
static int intel_pt_get_cbr (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_vmcs (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_ovf (struct intel_pt_pkt *packet)
 
static int intel_pt_get_psb (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_psbend (struct intel_pt_pkt *packet)
 
static int intel_pt_get_tma (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_pad (struct intel_pt_pkt *packet)
 
static int intel_pt_get_mnt (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_3byte (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_ptwrite (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_exstop (struct intel_pt_pkt *packet)
 
static int intel_pt_get_exstop_ip (struct intel_pt_pkt *packet)
 
static int intel_pt_get_mwait (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_pwre (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_pwrx (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_ext (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_short_tnt (unsigned int byte, struct intel_pt_pkt *packet)
 
static int intel_pt_get_cyc (unsigned int byte, const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_ip (enum intel_pt_pkt_type type, unsigned int byte, const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_mode (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_tsc (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_get_mtc (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
static int intel_pt_do_get_packet (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
int intel_pt_get_packet (const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
 
int intel_pt_pkt_desc (const struct intel_pt_pkt *packet, char *buf, size_t buf_len)
 

Variables

static const char *const packet_name []
 

Macro Definition Documentation

◆ BIT

#define BIT (   n)    (1 << (n))

Definition at line 24 of file intel-pt-pkt-decoder.c.

◆ BIT63

#define BIT63   ((uint64_t)1 << 63)

Definition at line 26 of file intel-pt-pkt-decoder.c.

◆ le16_to_cpu

#define le16_to_cpu   bswap_16

Definition at line 31 of file intel-pt-pkt-decoder.c.

◆ le32_to_cpu

#define le32_to_cpu   bswap_32

Definition at line 32 of file intel-pt-pkt-decoder.c.

◆ le64_to_cpu

#define le64_to_cpu   bswap_64

Definition at line 33 of file intel-pt-pkt-decoder.c.

◆ memcpy_le64

#define memcpy_le64 (   d,
  s,
 
)
Value:
do { \
memcpy((d), (s), (n)); \
*(d) = le64_to_cpu(*(d)); \
} while (0)
#define le64_to_cpu

Definition at line 34 of file intel-pt-pkt-decoder.c.

◆ NR_FLAG

#define NR_FLAG   BIT63

Definition at line 28 of file intel-pt-pkt-decoder.c.

Function Documentation

◆ intel_pt_do_get_packet()

static int intel_pt_do_get_packet ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 479 of file intel-pt-pkt-decoder.c.

Here is the call graph for this function:

◆ intel_pt_get_3byte()

static int intel_pt_get_3byte ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 213 of file intel-pt-pkt-decoder.c.

Here is the call graph for this function:

◆ intel_pt_get_cbr()

static int intel_pt_get_cbr ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 127 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_cyc()

static int intel_pt_get_cyc ( unsigned int  byte,
const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 355 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_exstop()

static int intel_pt_get_exstop ( struct intel_pt_pkt packet)
static

Definition at line 250 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_exstop_ip()

static int intel_pt_get_exstop_ip ( struct intel_pt_pkt packet)
static

Definition at line 256 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_ext()

static int intel_pt_get_ext ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 292 of file intel-pt-pkt-decoder.c.

Here is the call graph for this function:

◆ intel_pt_get_ip()

static int intel_pt_get_ip ( enum intel_pt_pkt_type  type,
unsigned int  byte,
const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 377 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_long_tnt()

static int intel_pt_get_long_tnt ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 81 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_mnt()

static int intel_pt_get_mnt ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 202 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_mode()

static int intel_pt_get_mode ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 423 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_mtc()

static int intel_pt_get_mtc ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 469 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_mwait()

static int intel_pt_get_mwait ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 262 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_ovf()

static int intel_pt_get_ovf ( struct intel_pt_pkt packet)
static

Definition at line 155 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_packet()

int intel_pt_get_packet ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)

Definition at line 528 of file intel-pt-pkt-decoder.c.

Here is the call graph for this function:

◆ intel_pt_get_pad()

static int intel_pt_get_pad ( struct intel_pt_pkt packet)
static

Definition at line 196 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_pip()

static int intel_pt_get_pip ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 104 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_psb()

static int intel_pt_get_psb ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 161 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_psbend()

static int intel_pt_get_psbend ( struct intel_pt_pkt packet)
static

Definition at line 178 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_ptwrite()

static int intel_pt_get_ptwrite ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 227 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_pwre()

static int intel_pt_get_pwre ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 272 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_pwrx()

static int intel_pt_get_pwrx ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 282 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_short_tnt()

static int intel_pt_get_short_tnt ( unsigned int  byte,
struct intel_pt_pkt packet 
)
static

Definition at line 337 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_tma()

static int intel_pt_get_tma ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 184 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_tracestop()

static int intel_pt_get_tracestop ( struct intel_pt_pkt packet)
static

Definition at line 121 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_tsc()

static int intel_pt_get_tsc ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 459 of file intel-pt-pkt-decoder.c.

◆ intel_pt_get_vmcs()

static int intel_pt_get_vmcs ( const unsigned char *  buf,
size_t  len,
struct intel_pt_pkt packet 
)
static

Definition at line 137 of file intel-pt-pkt-decoder.c.

◆ intel_pt_pkt_desc()

int intel_pt_pkt_desc ( const struct intel_pt_pkt packet,
char *  buf,
size_t  buf_len 
)

Definition at line 541 of file intel-pt-pkt-decoder.c.

Here is the call graph for this function:

◆ intel_pt_pkt_name()

const char* intel_pt_pkt_name ( enum intel_pt_pkt_type  type)

Definition at line 76 of file intel-pt-pkt-decoder.c.

Variable Documentation

◆ packet_name

const char* const packet_name[]
static
Initial value:
= {
[INTEL_PT_BAD] = "Bad Packet!",
[INTEL_PT_PAD] = "PAD",
[INTEL_PT_TNT] = "TNT",
[INTEL_PT_TIP_PGD] = "TIP.PGD",
[INTEL_PT_TIP_PGE] = "TIP.PGE",
[INTEL_PT_TSC] = "TSC",
[INTEL_PT_TMA] = "TMA",
[INTEL_PT_MODE_EXEC] = "MODE.Exec",
[INTEL_PT_MODE_TSX] = "MODE.TSX",
[INTEL_PT_MTC] = "MTC",
[INTEL_PT_TIP] = "TIP",
[INTEL_PT_FUP] = "FUP",
[INTEL_PT_CYC] = "CYC",
[INTEL_PT_VMCS] = "VMCS",
[INTEL_PT_PSB] = "PSB",
[INTEL_PT_PSBEND] = "PSBEND",
[INTEL_PT_CBR] = "CBR",
[INTEL_PT_TRACESTOP] = "TraceSTOP",
[INTEL_PT_PIP] = "PIP",
[INTEL_PT_OVF] = "OVF",
[INTEL_PT_MNT] = "MNT",
[INTEL_PT_PTWRITE] = "PTWRITE",
[INTEL_PT_PTWRITE_IP] = "PTWRITE",
[INTEL_PT_EXSTOP] = "EXSTOP",
[INTEL_PT_EXSTOP_IP] = "EXSTOP",
[INTEL_PT_MWAIT] = "MWAIT",
[INTEL_PT_PWRE] = "PWRE",
[INTEL_PT_PWRX] = "PWRX",
}

Definition at line 45 of file intel-pt-pkt-decoder.c.