20 #include <linux/kernel.h> 21 #include <linux/types.h> 51 #define MAX_TIMESTAMP (~0ULL) 164 unsigned char *buf,
size_t len)
173 ". ... Intel Processor Trace data: size %zu bytes\n",
184 for (i = 0; i < pkt_len; i++)
212 bool consecutive =
false;
261 if (might_overlap && !buffer->
consecutive && old_buffer &&
274 if (!old_buffer || (might_overlap && !buffer->
consecutive)) {
312 if (!strcmp(var,
"intel-pt.cache-divisor")) {
313 val = strtol(value, NULL, 0);
314 if (val > 0 && val <= INT_MAX)
345 if (size > (1 << 21))
347 return 32 - __builtin_clz(size);
370 u64 offset, u64 insn_cnt, u64 byte_cnt,
386 e->
op = intel_pt_insn->
op;
389 e->
rel = intel_pt_insn->
rel;
411 uint64_t *insn_cnt_ptr, uint64_t *ip,
412 uint64_t to_ip, uint64_t max_insn_cnt,
423 u64 offset, start_offset, start_ip;
427 intel_pt_insn->
length = 0;
429 if (to_ip && *ip == to_ip)
433 cpumode = PERF_RECORD_MISC_KERNEL;
435 cpumode = PERF_RECORD_MISC_USER;
439 if (cpumode != PERF_RECORD_MISC_KERNEL)
455 if (!to_ip && one_map) {
460 (!max_insn_cnt || e->
insn_cnt <= max_insn_cnt)) {
463 intel_pt_insn->
op = e->
op;
466 intel_pt_insn->
rel = e->
rel;
474 start_offset = offset;
499 if (max_insn_cnt && insn_cnt >= max_insn_cnt)
502 *ip += intel_pt_insn->
length;
504 if (to_ip && *ip == to_ip)
510 offset += intel_pt_insn->
length;
534 *ip - start_ip, intel_pt_insn);
544 uint64_t offset,
const char *
filename)
547 bool have_filter =
false;
548 bool hit_tracestop =
false;
549 bool hit_filter =
false;
555 if ((filename && !filt->
filename) ||
557 (filename && strcmp(filename, filt->
filename)))
560 if (!(offset >= filt->
addr && offset < filt->
addr + filt->
size))
563 intel_pt_log(
"TIP.PGD ip %#"PRIx64
" offset %#"PRIx64
" in %s hit filter: %s offset %#"PRIx64
" size %#"PRIx64
"\n",
564 ip, offset, filename ? filename :
"[kernel]",
565 filt->
start ?
"filter" :
"stop",
571 hit_tracestop =
true;
574 if (!hit_tracestop && !hit_filter)
575 intel_pt_log(
"TIP.PGD ip %#"PRIx64
" offset %#"PRIx64
" in %s is not in a filter region\n",
576 ip, offset, filename ? filename :
"[kernel]");
578 return hit_tracestop || (have_filter && !hit_filter);
592 cpumode = PERF_RECORD_MISC_USER;
617 *config = attr->config;
630 !evsel->
attr.exclude_kernel)
659 (config & 1) && !(config & 0x2000))
674 for (shift = 0, config = pt->
mtc_freq_bits; !(config & 1); shift++)
694 if (!(evsel->
attr.sample_type & PERF_SAMPLE_TIME))
698 timeless_decoding =
false;
712 !evsel->
attr.exclude_kernel)
834 if (env->
cpuid && !strncmp(env->
cpuid,
"GenuineIntel,6,92,", 18))
882 if (queue->
cpu == -1)
919 if (list_empty(&queue->
head))
928 if (queue->
cpu != -1)
949 intel_pt_log(
"queue %u decoding cpu %d pid %d tid %d\n",
999 bs_dst->
nr = bs_src->
nr;
1056 event->sample.header.type = PERF_RECORD_SAMPLE;
1057 event->sample.header.misc = PERF_RECORD_MISC_USER;
1058 event->sample.header.size =
sizeof(
struct perf_event_header);
1063 sample->
cpumode = PERF_RECORD_MISC_USER;
1104 pr_err(
"Intel PT: failed to deliver event, error %d\n", ret);
1114 struct dummy_branch_stack {
1135 dummy_bs = (
struct dummy_branch_stack){
1281 raw.
flags = cpu_to_le32(flags);
1393 pid_t
pid, pid_t tid, u64 ip)
1402 code, cpu, pid, tid, ip, msg);
1406 pr_err(
"Intel Processor Trace: failed to deliver error event, error %d\n",
1443 #define INTEL_PT_PWR_EVT (INTEL_PT_MWAIT_OP | INTEL_PT_PWR_ENTRY | \ 1444 INTEL_PT_EX_STOP | INTEL_PT_PWR_EXIT | \ 1540 }
else if (!state->
to_ip) {
1574 if (sym->
binding == STB_GLOBAL &&
1575 !strcmp(sym->
name,
"__switch_to")) {
1577 if (ip >= map->
start && ip < map->
end) {
1584 if (!switch_ip || !ptss_ip)
1588 ptss =
"perf_trace_sched_switch";
1590 ptss =
"__perf_event_task_sched_out";
1593 if (!strcmp(sym->
name, ptss)) {
1595 if (ip >= map->
start && ip < map->
end) {
1634 intel_pt_log(
"switch_ip: %"PRIx64
" ptss_ip: %"PRIx64
"\n",
1641 intel_pt_log(
"queue %u decoding cpu %d pid %d tid %d\n",
1710 unsigned int queue_nr;
1728 intel_pt_log(
"queue %u processing 0x%" PRIx64
" to 0x%" PRIx64
"\n",
1770 for (i = 0; i < queues->
nr_queues; i++) {
1774 if (ptq && (tid == -1 || ptq->
tid == tid)) {
1786 sample->
pid, sample->
tid, 0);
1804 for (j = 0; i > 0; j++) {
1853 intel_pt_log(
"ERROR: cpu %d expecting switch ip\n", cpu);
1876 intel_pt_log(
"sched_switch: cpu %d tid %d time %"PRIu64
" tsc %#"PRIx64
"\n",
1890 bool out =
event->header.misc & PERF_RECORD_MISC_SWITCH_OUT;
1899 if (event->
header.type != PERF_RECORD_SWITCH_CPU_WIDE) {
1900 pr_err(
"Expecting CPU-wide context switch event\n");
1903 pid =
event->context_switch.next_prev_pid;
1904 tid =
event->context_switch.next_prev_tid;
1913 pr_err(
"context_switch event has no tid\n");
1917 intel_pt_log(
"context_switch: cpu %d pid %d tid %d time %"PRIu64
" tsc %#"PRIx64
"\n",
1935 intel_pt_log(
"itrace_start: cpu %d pid %d tid %d time %"PRIu64
" tsc %#"PRIx64
"\n",
1959 pr_err(
"Intel Processor Trace requires ordered events\n");
1963 if (sample->
time && sample->
time != (u64)-1)
1975 if (event->
header.type == PERF_RECORD_EXIT) {
1980 }
else if (timestamp) {
1986 if (event->
header.type == PERF_RECORD_AUX &&
1987 (event->
aux.
flags & PERF_AUX_FLAG_TRUNCATED) &&
1996 else if (event->
header.type == PERF_RECORD_ITRACE_START)
1998 else if (event->
header.type == PERF_RECORD_SWITCH ||
1999 event->
header.type == PERF_RECORD_SWITCH_CPU_WIDE)
2002 intel_pt_log(
"event %s (%u): cpu %d time %"PRIu64
" tsc %#"PRIx64
"\n",
2004 sample->
cpu, sample->
time, timestamp);
2039 for (i = 0; i < queues->
nr_queues; i++) {
2077 data_offset = lseek(fd, 0, SEEK_CUR);
2078 if (data_offset == -1)
2083 data_offset, &buffer);
2111 container_of(tool,
struct intel_pt_synth,
dummy_tool);
2118 struct perf_event_attr *
attr, u64
id)
2123 pr_debug(
"Synthesizing '%s' event with id %" PRIu64
" sample type %#" PRIx64
"\n",
2124 name,
id, (u64)attr->sample_type);
2126 memset(&intel_pt_synth, 0,
sizeof(
struct intel_pt_synth));
2132 pr_err(
"%s: failed to synthesize '%s' event type\n",
2144 if (evsel->
id && evsel->
id[0] ==
id) {
2147 evsel->
name = strdup(name);
2171 struct perf_event_attr attr;
2176 pr_debug(
"There are no selected events with Intel Processor Trace data\n");
2180 memset(&attr, 0,
sizeof(
struct perf_event_attr));
2181 attr.size =
sizeof(
struct perf_event_attr);
2182 attr.type = PERF_TYPE_HARDWARE;
2184 attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID |
2187 attr.sample_type &= ~(u64)PERF_SAMPLE_TIME;
2189 attr.sample_type |= PERF_SAMPLE_TIME;
2191 attr.sample_type &= ~(u64)PERF_SAMPLE_CPU;
2192 attr.exclude_user = evsel->
attr.exclude_user;
2193 attr.exclude_kernel = evsel->
attr.exclude_kernel;
2194 attr.exclude_hv = evsel->
attr.exclude_hv;
2195 attr.exclude_host = evsel->
attr.exclude_host;
2196 attr.exclude_guest = evsel->
attr.exclude_guest;
2197 attr.sample_id_all = evsel->
attr.sample_id_all;
2198 attr.read_format = evsel->
attr.read_format;
2200 id = evsel->
id[0] + 1000000000;
2205 attr.config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS;
2206 attr.sample_period = 1;
2207 attr.sample_type |= PERF_SAMPLE_ADDR;
2215 attr.sample_type &= ~(u64)PERF_SAMPLE_ADDR;
2219 attr.sample_type |= PERF_SAMPLE_CALLCHAIN;
2221 attr.sample_type |= PERF_SAMPLE_BRANCH_STACK;
2224 attr.config = PERF_COUNT_HW_INSTRUCTIONS;
2226 attr.sample_period =
2239 attr.sample_type &= ~(u64)PERF_SAMPLE_PERIOD;
2240 attr.sample_period = 1;
2243 attr.config = PERF_COUNT_HW_INSTRUCTIONS;
2255 attr.sample_type |= PERF_SAMPLE_RAW;
2326 if (!strcmp(name,
"sched:sched_switch"))
2338 if (evsel->
attr.context_switch)
2349 if (!strcmp(var,
"intel-pt.mispred-all"))
2381 for (i = start; i <= finish; i++)
2390 fprintf(stdout,
" %-20s%s\n", name, str ? str :
"");
2395 return auxtrace_info->
header.size >=
2464 info_end = (
void *)info + auxtrace_info->
header.size;
2474 const char *
filter = (
const char *)info;
2478 if ((
void *)info > info_end) {
2479 pr_err(
"%s: bad filter string length\n", __func__);
2481 goto err_free_queues;
2483 pt->
filter = memdup(filter, len);
2486 goto err_free_queues;
2490 if (pt->
filter[len - 1]) {
2491 pr_err(
"%s: filter string not null terminated\n", __func__);
2493 goto err_free_queues;
2498 goto err_free_queues;
2511 goto err_free_queues;
2524 goto err_delete_thread;
2527 goto err_delete_thread;
2543 pr_err(
"%s: missing sched_switch event\n", __func__);
2545 goto err_delete_thread;
2549 pr_err(
"%s: missing context_switch attribute flag\n", __func__);
2551 goto err_delete_thread;
2576 (tsc_freq + 50000000) / 100000000;
2600 goto err_delete_thread;
2604 goto err_delete_thread;
2610 pr_debug2(
"Intel PT decoding without timestamps\n");
static bool intel_pt_pgd_ip(uint64_t ip, void *data)
static int intel_pt_deliver_synth_b_event(struct intel_pt *pt, union perf_event *event, struct perf_sample *sample, u64 type)
#define intel_pt_log(fmt,...)
static void intel_pt_dump(struct intel_pt *pt __maybe_unused, unsigned char *buf, size_t len)
void auxtrace_cache__free_entry(struct auxtrace_cache *c __maybe_unused, void *entry)
static struct intel_pt_queue * intel_pt_cpu_to_ptq(struct intel_pt *pt, int cpu)
static void intel_pt_dump_event(struct intel_pt *pt, unsigned char *buf, size_t len)
int color_fprintf(FILE *fp, const char *color, const char *fmt,...)
u64(* map_ip)(struct map *, u64)
static void intel_pt_reset_last_branch_rb(struct intel_pt_queue *ptq)
static int intel_pt_synth_events(struct intel_pt *pt, struct perf_session *session)
struct perf_evlist * evlist
int(* process_event)(struct perf_session *session, union perf_event *event, struct perf_sample *sample, struct perf_tool *tool)
void mem_bswap_64(void *src, int byte_size)
static unsigned int intel_pt_mtc_period(struct intel_pt *pt)
int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf, size_t buf_len)
struct perf_session * session
struct perf_tool dummy_tool
struct perf_event_header header
int auxtrace_queues__process_index(struct auxtrace_queues *queues, struct perf_session *session)
struct auxtrace_cache_entry entry
static void intel_pt_free(struct perf_session *session)
enum sort_mode sort__mode
static int intel_pt_lost(struct intel_pt *pt, struct perf_sample *sample)
struct perf_tsc_conversion tc
static u64 intel_pt_ns_to_ticks(const struct intel_pt *pt, u64 ns)
void * auxtrace_buffer__get_data(struct auxtrace_buffer *buffer, int fd)
struct auxtrace_queue * queue_array
const unsigned char * buf
struct auxtrace * auxtrace
static bool intel_pt_is_switch_ip(struct intel_pt_queue *ptq, u64 ip)
static struct intel_pt_cache_entry * intel_pt_cache_lookup(struct dso *dso, struct machine *machine, u64 offset)
static void intel_pt_set_event_name(struct perf_evlist *evlist, u64 id, const char *name)
#define thread__zput(thread)
#define INTEL_PT_INSN_BUF_SZ
void addr_filters__exit(struct addr_filters *filts)
static int intel_pt_synth_pwre_sample(struct intel_pt_queue *ptq)
struct auxtrace_heap_item * heap_array
unsigned max_non_turbo_ratio
#define MAX_AUXTRACE_ERROR_MSG
static void intel_pt_prep_b_sample(struct intel_pt *pt, struct intel_pt_queue *ptq, union perf_event *event, struct perf_sample *sample)
unsigned int callchain_sz
struct ip_callchain * callchain
static void * perf_synth__raw_data(void *p)
int perf_session__deliver_synth_event(struct perf_session *session, union perf_event *event, struct perf_sample *sample)
static bool intel_pt_have_tsc(struct intel_pt *pt)
struct map * thread__find_map(struct thread *thread, u8 cpumode, u64 addr, struct addr_location *al)
int perf_config_bool(const char *name, const char *value)
static int intel_pt_synth_mwait_sample(struct intel_pt_queue *ptq)
int intel_pt_insn_type(enum intel_pt_insn_op op)
u64 transactions_sample_type
static int intel_pt_setup_queues(struct intel_pt *pt)
enum intel_pt_insn_op insn_op
static void intel_pt_sample_flags(struct intel_pt_queue *ptq)
static int intel_pt_deliver_synth_event(struct intel_pt *pt, struct intel_pt_queue *ptq, union perf_event *event, struct perf_sample *sample, u64 type)
struct auxtrace_buffer * auxtrace_buffer__next(struct auxtrace_queue *queue, struct auxtrace_buffer *buffer)
enum intel_pt_insn_branch branch
static bool intel_pt_exclude_kernel(struct intel_pt *pt)
static bool intel_pt_match_pgd_ip(struct intel_pt *pt, uint64_t ip, uint64_t offset, const char *filename)
struct auxtrace_buffer * old_buffer
static int intel_pt_run_decoder(struct intel_pt_queue *ptq, u64 *timestamp)
struct itrace_synth_opts * itrace_synth_opts
enum intel_pt_insn_branch branch
#define pr_debug2(fmt,...)
#define evlist__for_each_entry_reverse(evlist, evsel)
void auxtrace_synth_error(struct auxtrace_error_event *auxtrace_error, int type, int code, int cpu, pid_t pid, pid_t tid, u64 ip, const char *msg)
int thread_stack__event(struct thread *thread, u32 flags, u64 from_ip, u64 to_ip, u16 insn_len, u64 trace_nr)
static int intel_pt_flush(struct perf_session *session, struct perf_tool *tool)
int auxtrace_queues__add_event(struct auxtrace_queues *queues, struct perf_session *session, union perf_event *event, off_t data_offset, struct auxtrace_buffer **buffer_ptr)
u64 instructions_sample_type
static int intel_pt_synth_ptwrite_sample(struct intel_pt_queue *ptq)
static int intel_pt_synth_error(struct intel_pt *pt, int code, int cpu, pid_t pid, pid_t tid, u64 ip)
static int intel_pt_sample(struct intel_pt_queue *ptq)
int auxtrace_cache__add(struct auxtrace_cache *c, u32 key, struct auxtrace_cache_entry *entry)
struct perf_session * session
int machine__set_current_tid(struct machine *machine, int cpu, pid_t pid, pid_t tid)
const struct intel_pt_state * state
unsigned char * intel_pt_find_overlap(unsigned char *buf_a, size_t len_a, unsigned char *buf_b, size_t len_b, bool have_tsc, bool *consecutive)
#define INTEL_PT_PKT_DESC_MAX
static bool intel_pt_find_switch(struct perf_evlist *evlist)
struct intel_pt_decoder * intel_pt_decoder_new(struct intel_pt_params *params)
struct auxtrace_buffer * buffer
struct itrace_start_event itrace_start
x86 movsq based memset() in arch/x86/lib/memset_64.S") MEMSET_FN(memset_erms
static int intel_pt_do_fix_overlap(struct intel_pt *pt, struct auxtrace_buffer *a, struct auxtrace_buffer *b)
int(* get_trace)(struct intel_pt_buffer *buffer, void *data)
static int intel_pt_next_tid(struct intel_pt *pt, struct intel_pt_queue *ptq)
void addr_filters__init(struct addr_filters *filts)
int thread__init_map_groups(struct thread *thread, struct machine *machine)
static void intel_pt_print_info(u64 *arr, int start, int finish)
static int intel_pt_walk_next_insn(struct intel_pt_insn *intel_pt_insn, uint64_t *insn_cnt_ptr, uint64_t *ip, uint64_t to_ip, uint64_t max_insn_cnt, void *data)
unsigned char buf[INTEL_PT_INSN_BUF_SZ]
struct branch_entry entries[0]
void intel_pt_log_enable(void)
static struct perf_evsel * intel_pt_find_sched_switch(struct perf_evlist *evlist)
static void intel_pt_free_events(struct perf_session *session)
static bool intel_pt_get_config(struct intel_pt *pt, struct perf_event_attr *attr, u64 *config)
static struct map * machine__kernel_map(struct machine *machine)
struct thread * machine__find_thread(struct machine *machine, pid_t pid, pid_t tid)
int perf_event__synthesize_sample(union perf_event *event, u64 type, u64 read_format, const struct perf_sample *sample)
struct branch_stack * last_branch_rb
static void intel_pt_prep_p_sample(struct intel_pt *pt, struct intel_pt_queue *ptq, union perf_event *event, struct perf_sample *sample)
static int intel_pt_cache_divisor(void)
struct perf_evlist * evlist
static int intel_pt_sync_switch(struct intel_pt *pt, int cpu, pid_t tid, u64 timestamp)
#define pr_debug(fmt,...)
int intel_pt_get_packet(const unsigned char *buf, size_t len, struct intel_pt_pkt *packet)
static int intel_pt_synth_event(struct perf_session *session, const char *name, struct perf_event_attr *attr, u64 id)
static int __intel_pt_pgd_ip(uint64_t ip, void *data)
static int intel_pt_process_auxtrace_event(struct perf_session *session, union perf_event *event, struct perf_tool *tool __maybe_unused)
#define evlist__for_each_entry(evlist, evsel)
struct thread * unknown_thread
void auxtrace_buffer__put_data(struct auxtrace_buffer *buffer)
u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc)
static int entry(u64 ip, struct unwind_info *ui)
#define INTEL_PT_PMU_NAME
enum intel_pt_period_type period_type
static int intel_pt_context_switch(struct intel_pt *pt, union perf_event *event, struct perf_sample *sample)
static void intel_pt_free_queue(void *priv)
static int intel_pt_synth_pwrx_sample(struct intel_pt_queue *ptq)
static int intel_pt_process_event(struct perf_session *session, union perf_event *event, struct perf_sample *sample, struct perf_tool *tool)
union perf_event * event_buf
void intel_pt_log_set_name(const char *name)
struct itrace_synth_opts synth_opts
static int intel_pt_opt_inject(struct intel_pt *pt, union perf_event *event, struct perf_sample *sample, u64 type)
void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts)
#define perf_synth__raw_size(d)
static struct perf_tool tool
static int intel_pt_synth_exstop_sample(struct intel_pt_queue *ptq)
static void intel_pt_print_info_str(const char *name, const char *str)
static int str(yyscan_t scanner, int token)
enum intel_pt_sample_type type
int intel_pt_get_insn(const unsigned char *buf, size_t len, int x86_64, struct intel_pt_insn *intel_pt_insn)
char insn[INTEL_PT_INSN_BUF_SZ]
void auxtrace_heap__free(struct auxtrace_heap *heap)
unsigned long long period
struct perf_evsel * perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id)
struct auxtrace_cache * auxtrace_cache__new(unsigned int bits, size_t entry_size, unsigned int limit_percent)
static bool intel_pt_has(struct auxtrace_info_event *auxtrace_info, int pos)
void auxtrace_buffer__drop_data(struct auxtrace_buffer *buffer)
int intel_pt_process_auxtrace_info(union perf_event *event, struct perf_session *session)
char insn[INTEL_PT_INSN_BUF_SZ]
struct branch_stack * branch_stack
u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample, const char *name)
#define INTEL_PT_ABORT_TX
static void intel_pt_copy_last_branch_rb(struct intel_pt_queue *ptq)
static unsigned int intel_pt_cache_size(struct dso *dso, struct machine *machine)
off_t dso__data_size(struct dso *dso, struct machine *machine)
const char * perf_event__name(unsigned int id)
char insn[INTEL_PT_INSN_BUF_SZ]
static int perf_data__fd(struct perf_data *data)
x86 movsq based memcpy() in arch/x86/lib/memcpy_64.S") MEMCPY_FN(memcpy_erms
void intel_pt_log_disable(void)
static int intel_pt_process_switch(struct intel_pt *pt, struct perf_sample *sample)
bool step_through_buffers
unsigned int last_branch_sz
const char * perf_evsel__name(struct perf_evsel *evsel)
static int intel_pt_synth_transaction_sample(struct intel_pt_queue *ptq)
static bool intel_pt_timeless_decoding(struct intel_pt *pt)
static int intel_pt_cache_add(struct dso *dso, struct machine *machine, u64 offset, u64 insn_cnt, u64 byte_cnt, struct intel_pt_insn *intel_pt_insn)
static int intel_pt_perf_config(const char *var, const char *value, void *data)
static int intel_pt_inject_event(union perf_event *event, struct perf_sample *sample, u64 type)
struct perf_event_header header
unsigned long initial_skip
static void intel_pt_update_last_branch_rb(struct intel_pt_queue *ptq)
static int thread__set_comm(struct thread *thread, const char *comm, u64 timestamp)
void * auxtrace_cache__lookup(struct auxtrace_cache *c, u32 key)
struct auxtrace_error_event auxtrace_error
struct branch_stack * last_branch
static int perf_data__is_pipe(struct perf_data *data)
static void intel_pt_prep_sample(struct intel_pt *pt, struct intel_pt_queue *ptq, union perf_event *event, struct perf_sample *sample)
static struct intel_pt_queue * intel_pt_alloc_queue(struct intel_pt *pt, unsigned int queue_nr)
struct auxtrace_cache * auxtrace_cache
struct ip_callchain * chain
struct perf_evsel * switch_evsel
static int intel_pt_setup_queue(struct intel_pt *pt, struct auxtrace_queue *queue, unsigned int queue_nr)
static u64 intel_pt_switch_ip(struct intel_pt *pt, u64 *ptss_ip)
struct auxtrace_queues queues
void(* free_events)(struct perf_session *session)
int(* flush_events)(struct perf_session *session, struct perf_tool *tool)
static void intel_pt_enable_sync_switch(struct intel_pt *pt)
void thread__put(struct thread *thread)
static const char *const intel_pt_info_fmts[]
u64 pwr_events_sample_type
int perf_config(config_fn_t fn, void *data)
unsigned max_non_turbo_ratio
static int intel_pt_synth_branch_sample(struct intel_pt_queue *ptq)
u64 tsc_to_perf_time(u64 cyc, struct perf_tsc_conversion *tc)
static int intel_pt_event_synth(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample __maybe_unused, struct machine *machine __maybe_unused)
static int sym(yyscan_t scanner, int type, int config)
static bool intel_pt_branch_enable(struct intel_pt *pt)
bool(* pgd_ip)(uint64_t ip, void *data)
struct thread * thread__new(pid_t pid, pid_t tid)
size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type, u64 read_format)
void auxtrace_heap__pop(struct auxtrace_heap *heap)
struct perf_header header
static int intel_pt_process_queues(struct intel_pt *pt, u64 timestamp)
#define PERF_SAMPLE_MAX_SIZE
static int intel_pt_synth_instruction_sample(struct intel_pt_queue *ptq)
void auxtrace_queues__free(struct auxtrace_queues *queues)
void thread_stack__sample(struct thread *thread, struct ip_callchain *chain, size_t sz, u64 ip)
static struct perf_evsel * intel_pt_evsel(struct intel_pt *pt, struct perf_evlist *evlist)
static bool intel_pt_skip_event(struct intel_pt *pt)
struct auxtrace_heap heap
static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data)
int auxtrace_heap__add(struct auxtrace_heap *heap, unsigned int queue_nr, u64 ordinal)
pid_t machine__get_current_tid(struct machine *machine, int cpu)
static struct auxtrace_cache * intel_pt_cache(struct dso *dso, struct machine *machine)
enum intel_pt_param_flags flags
void thread_stack__set_trace_nr(struct thread *thread, u64 trace_nr)
static int intel_pt_process_itrace_start(struct intel_pt *pt, union perf_event *event, struct perf_sample *sample)
u64(* unmap_ip)(struct map *, u64)
struct addr_filters filts
ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine, u64 offset, u8 *data, ssize_t size)
void(* free)(struct perf_session *session)
int auxtrace_queues__init(struct auxtrace_queues *queues)
static int intel_pt_synth_cbr_sample(struct intel_pt_queue *ptq)
static int intel_pt_config_div(const char *var, const char *value, void *data)
static void intel_pt_set_pid_tid_cpu(struct intel_pt *pt, struct auxtrace_queue *queue)
static int intel_pt_update_queues(struct intel_pt *pt)
struct symbol * dso__next_symbol(struct symbol *sym)
#define intel_pt_log_insn_no_data(arg,...)
static bool intel_pt_return_compression(struct intel_pt *pt)
void * auxtrace_cache__alloc_entry(struct auxtrace_cache *c)
int map__load(struct map *map)
void intel_pt_decoder_free(struct intel_pt_decoder *decoder)
static u64 machine__kernel_start(struct machine *machine)
int intel_pt__strerror(int code, char *buf, size_t buflen)
int callchain_register_param(struct callchain_param *param)
int(* walk_insn)(struct intel_pt_insn *intel_pt_insn, uint64_t *insn_cnt_ptr, uint64_t *ip, uint64_t to_ip, uint64_t max_insn_cnt, void *data)
struct symbol * dso__first_symbol(struct dso *dso)
struct perf_event_attr attr
const struct intel_pt_state * intel_pt_decode(struct intel_pt_decoder *decoder)
static bool intel_pt_tracing_kernel(struct intel_pt *pt)
struct branch_flags flags
bool dso__data_status_seen(struct dso *dso, enum dso_data_status_seen by)
int addr_filters__parse_bare_filter(struct addr_filters *filts, const char *filter)
#define intel_pt_log_insn(arg,...)
static int intel_pt_process_timeless_queues(struct intel_pt *pt, pid_t tid, u64 time_)
int(* process_auxtrace_event)(struct perf_session *session, union perf_event *event, struct perf_tool *tool)
void static void * zalloc(size_t size)
enum itrace_period_type period_type