28 #define MAX_LOG_NAME 256 57 for (i = 0; i < indent; i++)
60 fprintf(
f,
" %08" PRIx64
": ", pos);
61 for (i = 0; i < len; i++)
62 fprintf(
f,
" %02x", buf[i]);
72 for (i = 0; i < indent; i++)
75 fprintf(
f,
" %08" PRIx64
": ", pos);
76 for (i = 0; i < 16; i++)
102 uint64_t pos,
const unsigned char *buf)
111 fprintf(
f,
"%s\n", desc);
117 size_t len = intel_pt_insn->
length;
126 fprintf(
f,
"%s\n", desc);
128 fprintf(
f,
"Bad instruction!\n");
141 fprintf(
f,
"%s\n", desc);
143 fprintf(
f,
"Bad instruction!\n");
154 vfprintf(
f, fmt, args);
bool intel_pt_enable_logging
static void intel_pt_print_data(const unsigned char *buf, int len, uint64_t pos, int indent)
int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf, size_t buf_len)
#define INTEL_PT_INSN_BUF_SZ
static void intel_pt_print_no_data(uint64_t pos, int indent)
static char log_name[MAX_LOG_NAME]
#define INTEL_PT_PKT_DESC_MAX
void __intel_pt_log_packet(const struct intel_pt_pkt *packet, int pkt_len, uint64_t pos, const unsigned char *buf)
unsigned char buf[INTEL_PT_INSN_BUF_SZ]
void intel_pt_log_enable(void)
int intel_pt_insn_desc(const struct intel_pt_insn *intel_pt_insn, char *buf, size_t buf_len)
#define INTEL_PT_INSN_DESC_MAX
void intel_pt_log_set_name(const char *name)
void __intel_pt_log_insn_no_data(struct intel_pt_insn *intel_pt_insn, uint64_t ip)
void __intel_pt_log(const char *fmt,...)
void intel_pt_log_disable(void)
void __intel_pt_log_insn(struct intel_pt_insn *intel_pt_insn, uint64_t ip)
static int intel_pt_log_open(void)